[16.x] stripslashes(): Passing null to parameter #1 ($string) of type string is deprecated in pwg.comments.php #2179

Closed
opened 2026-10-05 01:08:50 +02:00 by adam · 0 comments
Owner

In the user comments administration page, we now (since 16) use the API method pwg.userComments.getList and it sometimes outputs:

Deprecated: stripslashes(): Passing null to parameter #1 ($string) of type string is deprecated in include/ws_functions/pwg.comments.php on line 145

$author_name = stripslashes($row['username']);

After investigating the database, it seems the comments.author_id is "broken", meaning "no longer related to an existing user". In that cas, we need a fallback.

In the user comments administration page, we now (since 16) use the API method `pwg.userComments.getList` and it sometimes outputs: > Deprecated: stripslashes(): Passing null to parameter #1 ($string) of type string is deprecated in include/ws_functions/pwg.comments.php on line 145 ``` $author_name = stripslashes($row['username']); ``` After investigating the database, it seems the `comments.author_id` is "broken", meaning "no longer related to an existing user". In that cas, we need a fallback. <!-- github-sync-id:3817526751 -->
adam closed this issue 2026-10-05 01:08:51 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#2179