Jshrink uses deprecated function, breaks javascript #949

Closed
opened 2026-10-05 00:25:06 +02:00 by adam · 9 comments
Owner

With Piwigo 2.10 and PHP 7.3 (Debian Buster, 7.3.9-1~deb10u1), Piwigo JShrink triggers a deprecation notice that ends up mixed with the javascript file:

<b>Deprecated</b>:  strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in <b>/var/www/include/jshrink.class.php</b> on line <b>195</b><br />;

This is obviously not corrrect Javascript, so the script fails to load in browser, triggering this error in firefox: SyntaxError: expected expression, got '<'

I think latest JShrink versions fix this.

edit: markdown syntax

With Piwigo 2.10 and PHP 7.3 (Debian Buster, 7.3.9-1~deb10u1), Piwigo JShrink triggers a deprecation notice that ends up mixed with the javascript file: ``` <b>Deprecated</b>: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in <b>/var/www/include/jshrink.class.php</b> on line <b>195</b><br />; ``` This is obviously not corrrect Javascript, so the script fails to load in browser, triggering this error in firefox: `SyntaxError: expected expression, got '<'` I think latest JShrink versions fix this. edit: markdown syntax <!-- github-sync-id:505084513 -->
adam closed this issue 2026-10-05 00:25:06 +02:00
Author
Owner

See #988 and #952

See #988 and #952 <!-- github-comment-id:540939077 -->
Author
Owner

Ah, pardon me.

Ah, pardon me. <!-- github-comment-id:540940204 -->
Author
Owner

No pardon, the issue mentioned above is marked closed, but there should definitely be an open issue for this :)

No pardon, the issue mentioned above is marked closed, but there should definitely be an open issue for this :) <!-- github-comment-id:540942075 -->
Author
Owner

Hmm, yeah. It seems that the old issue was marked resolved for 2.5, but it seems to happen for me with 2.10. I'm running it on Docker (https://github.com/maakuth/docker-piwigo) which does a clean install of Piwigo files (using pre-existing db and galleries), so it should not be a file integrity issue.

For now I'm using Debian Stretch based container as workaround, that has PHP 7.0.

Hmm, yeah. It seems that the old issue was marked resolved for 2.5, but it seems to happen for me with 2.10. I'm running it on Docker (https://github.com/maakuth/docker-piwigo) which does a clean install of Piwigo files (using pre-existing db and galleries), so it should not be a file integrity issue. For now I'm using Debian Stretch based container as workaround, that has PHP 7.0. <!-- github-comment-id:540950662 -->
Author
Owner

I think I'm simply gonna redo the same changes as we did on 15d8a19880

I think I'm simply gonna redo the same changes as we did on 15d8a19880a6e4e2e2a4557c9011584e61de7b4b <!-- github-comment-id:540959929 -->
Author
Owner

@maakuth can you copy the include/jshrink.class.php file from a Piwigo 2.9.5 to your 2.10.0 install and tell us if it removes the problem?

@maakuth can you copy the `include/jshrink.class.php` file from a Piwigo 2.9.5 to your 2.10.0 install and tell us if it removes the problem? <!-- github-comment-id:541120743 -->
Author
Owner

Actually I've been able to reproduce the bug and the fix from Piwigo 2.9.5 works fine https://piwigo.org/forum/viewtopic.php?pid=174596#p174596

(looks like Piwigo 2.10.1 is coming soon...)

Actually I've been able to reproduce the bug and the fix from Piwigo 2.9.5 works fine https://piwigo.org/forum/viewtopic.php?pid=174596#p174596 (looks like Piwigo 2.10.1 is coming soon...) <!-- github-comment-id:541126980 -->
Author
Owner

Ok, I was not available at that point, good to hear that you could repro it.

Ok, I was not available at that point, good to hear that you could repro it. <!-- github-comment-id:541507627 -->
Author
Owner

Fixed in 9b695da (master) and cherry-picked on 2.10 5cbe5aa

Fixed in 9b695da (master) and cherry-picked on 2.10 5cbe5aa <!-- github-comment-id:541603607 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#949