In debug mode, I regularly get several times the below line after calling pwg.categories.getImages:
<br /><b>Deprecated</b>: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in <b>
/home/…/piwigo/16.x/include/ws_functions/pwg.categories.php</b> on line <b>135</b><br />
Piwigo 16.0.0RC2
Operating system: Linux (container)
PHP: 8.2.29 [2025-11-16 22:48:21]
MySQL: 11.4.9-MariaDB [2025-11-16 22:48:21]
Graphics Library: External ImageMagick 6.9.13-25
Cache size 412.11 Mo calculated 5 days ago
PS: These lines are placed at the top of the JSON data returned by the API method.
In debug mode, I regularly get several times the below line after calling `pwg.categories.getImages`:
```
<br /><b>Deprecated</b>: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in <b>
/home/…/piwigo/16.x/include/ws_functions/pwg.categories.php</b> on line <b>135</b><br />
```
Piwigo 16.0.0RC2
Operating system: Linux (container)
PHP: 8.2.29 [2025-11-16 22:48:21]
MySQL: 11.4.9-MariaDB [2025-11-16 22:48:21]
Graphics Library: External ImageMagick 6.9.13-25
Cache size 412.11 Mo calculated 5 days ago
PS: These lines are placed at the top of the JSON data returned by the API method.
<!-- github-sync-id:3631185724 -->
OK, so here is the "problem": the photo title (or "name") can be empty. With recent versions of PHP, the strip_tags function requires a non-null input parameter. OK, so I simply added a ?? '' operation to input an empty string instead of null. I fixed pwg.categories.getImages as reported, but also pwg.images.getInfo and pwg.images.search as well.
But that may not be the right way to fix it.
On the page of the photo in the web user interface (I mean page picture.php) even if the photo title is empty, you get a title. Why is that? Because function render_element_name uses a modified version of the filename if the title is empty.
So question: should the API behaves like picture.php and use the filename when title is empty? In that case, especially for pwg.images.getInfo it's going to be important to use the new output field name_raw if remote apps want to fill an edit form for the photo.
@EddyLB what do you think?
OK, so here is the "problem": the photo title (or "name") can be empty. With recent versions of PHP, the `strip_tags` function requires a non-null input parameter. OK, so I simply added a `?? ''` operation to input an empty string instead of `null`. I fixed `pwg.categories.getImages` as reported, but also `pwg.images.getInfo` and `pwg.images.search` as well.
But that may not be the right way to fix it.
On the page of the photo in the web user interface (I mean page `picture.php`) even if the photo title is empty, you get a title. Why is that? Because function `render_element_name` uses a modified version of the filename if the title is empty.
So question: should the API behaves like `picture.php` and use the filename when title is empty? In that case, especially for `pwg.images.getInfo` it's going to be important to use the new output field `name_raw` if remote apps want to fill an edit form for the photo.
@EddyLB what do you think?
<!-- github-comment-id:3553320861 -->
Hi @plg,
Third-party apps manage empty photo titles as they wish/need already (probably like picture.php in many cases) and we should avoid breaking their functionality. If such modification was put in place, those storing data in cache would then probably store two times the filename of each photo, which would take space for useless reasons.
So I think that you should not change the behaviour of the API.
Hi @plg,
Third-party apps manage empty photo titles as they wish/need already (probably like `picture.php` in many cases) and we should avoid breaking their functionality. If such modification was put in place, those storing data in cache would then probably store two times the filename of each photo, which would take space for useless reasons.
So I think that you should not change the behaviour of the API.
<!-- github-comment-id:3556044980 -->
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.
In debug mode, I regularly get several times the below line after calling
pwg.categories.getImages:Piwigo 16.0.0RC2
Operating system: Linux (container)
PHP: 8.2.29 [2025-11-16 22:48:21]
MySQL: 11.4.9-MariaDB [2025-11-16 22:48:21]
Graphics Library: External ImageMagick 6.9.13-25
Cache size 412.11 Mo calculated 5 days ago
PS: These lines are placed at the top of the JSON data returned by the API method.
OK, so here is the "problem": the photo title (or "name") can be empty. With recent versions of PHP, the
strip_tagsfunction requires a non-null input parameter. OK, so I simply added a?? ''operation to input an empty string instead ofnull. I fixedpwg.categories.getImagesas reported, but alsopwg.images.getInfoandpwg.images.searchas well.But that may not be the right way to fix it.
On the page of the photo in the web user interface (I mean page
picture.php) even if the photo title is empty, you get a title. Why is that? Because functionrender_element_nameuses a modified version of the filename if the title is empty.So question: should the API behaves like
picture.phpand use the filename when title is empty? In that case, especially forpwg.images.getInfoit's going to be important to use the new output fieldname_rawif remote apps want to fill an edit form for the photo.@EddyLB what do you think?
Hi @plg,
Third-party apps manage empty photo titles as they wish/need already (probably like
picture.phpin many cases) and we should avoid breaking their functionality. If such modification was put in place, those storing data in cache would then probably store two times the filename of each photo, which would take space for useless reasons.So I think that you should not change the behaviour of the API.
OK. So I close this issue.