When running php 8.1, I get this Deprecation warning with piwigo 13.8.0:
Deprecated: nl2br(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/piwigo/include/functions_plugins.inc.php on line 214
It occurs on the main page a lot and in each album or photo once.
I tested it also with php8.2 where I get this warning as well + a ton more.
[Piwigo](https://piwigo.org/) 13.8.0
Installed on 24 April 2022, 1 year 3 months 3 weeks 2 days ago
Operating system: Linux
PHP: 8.1.22
MySQL: 10.5.19-MariaDB-0+deb11u2 [2023-08-18 12:37:00]
Graphics Library: External ImageMagick 6.9.11-60
When running php 8.1, I get this Deprecation warning with piwigo 13.8.0:
```
Deprecated: nl2br(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/piwigo/include/functions_plugins.inc.php on line 214
```
It occurs on the main page a lot and in each album or photo once.
I tested it also with php8.2 where I get this warning as well + a ton more.
```
[Piwigo](https://piwigo.org/) 13.8.0
Installed on 24 April 2022, 1 year 3 months 3 weeks 2 days ago
Operating system: Linux
PHP: 8.1.22
MySQL: 10.5.19-MariaDB-0+deb11u2 [2023-08-18 12:37:00]
Graphics Library: External ImageMagick 6.9.11-60
```
<!-- github-sync-id:1856648398 -->
I quickly created a new gallery with the current master and it seems to throw no more deprecation warnings, even on php 8.2.
However, I did not replicate my other gallery, thus some plugins might interfere and produce warnings.
I quickly created a new gallery with the current master and it seems to throw no more deprecation warnings, even on php 8.2.
However, I did not replicate my other gallery, thus some plugins might interfere and produce warnings.
<!-- github-comment-id:1774639090 -->
I'm closing this issue, but I have encountered the same problem while testing $conf['allow_html_descriptions'] = false; because Piwigo, in include/common.inc.php adds an event handler :
if ( !$conf['allow_html_descriptions'] )
{
add_event_handler('render_category_description', 'nl2br');
}
We're going to substitute nl2br with a custom pwg_nl2br
I'm closing this issue, but I have encountered the same problem while testing `$conf['allow_html_descriptions'] = false;` because Piwigo, in `include/common.inc.php` adds an event handler :
```
if ( !$conf['allow_html_descriptions'] )
{
add_event_handler('render_category_description', 'nl2br');
}
```
We're going to substitute `nl2br` with a custom `pwg_nl2br`
<!-- github-comment-id:2551034583 -->
adam
changed title from PHP8.1: Deprecated: nl2br(): Passing null to parameter #1 to PHP8.1: Deprecated: nl2br(): Passing null to parameter #1 2026-10-27 11:27:12 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When running php 8.1, I get this Deprecation warning with piwigo 13.8.0:
It occurs on the main page a lot and in each album or photo once.
I tested it also with php8.2 where I get this warning as well + a ton more.
Did you try the new version 14 (beta3 currently) ? Does it still occur?
I quickly created a new gallery with the current master and it seems to throw no more deprecation warnings, even on php 8.2.
However, I did not replicate my other gallery, thus some plugins might interfere and produce warnings.
I'm closing this issue, but I have encountered the same problem while testing
$conf['allow_html_descriptions'] = false;because Piwigo, ininclude/common.inc.phpadds an event handler :We're going to substitute
nl2brwith a custompwg_nl2brPHP8.1: Deprecated: nl2br(): Passing null to parameter #1to PHP8.1: Deprecated: nl2br(): Passing null to parameter #1