Deprecated: Invalid characters passed for attempted conversion, these have been ignored in include/template.class.php:1024 #1186

Closed
opened 2026-10-05 00:35:05 +02:00 by adam · 10 comments
Owner

Hello,

I recently got this error (this happened with php 7.4 afaik).

Deprecated: Invalid characters passed for attempted conversion, these have been ignored in include/template.class.php:1024

This is because crc32 can return negative integers. According to php documentation, this happens a lot with 32 bit systems, and sometimes with 64 bit systems.

I changed the base_convert call to base_convert(hash("crc32b", $compile_id), 16, 36), and this fixes the problem. Unless I'm mistaken this should be equivalent to the current code.

Sorry I'm too lazy too submit a PR for a one-liner.

Hello, I recently got this error (this happened with php 7.4 afaik). Deprecated: Invalid characters passed for attempted conversion, these have been ignored in include/template.class.php:1024 This is because crc32 can return negative integers. According to php documentation, this happens a lot with 32 bit systems, and sometimes with 64 bit systems. I changed the `base_convert` call to `base_convert(hash("crc32b", $compile_id), 16, 36)`, and this fixes the problem. Unless I'm mistaken this should be equivalent to the current code. Sorry I'm too lazy too submit a PR for a one-liner. <!-- github-sync-id:828245606 -->
adam closed this issue 2026-10-05 00:35:05 +02:00
Author
Owner

There are other calls to crc32 which should be fixed as well.

There are other calls to crc32 which should be fixed as well. <!-- github-comment-id:795983840 -->
Author
Owner

Will including this cause an issue with 64 Bit OS's?

Will including this cause an issue with 64 Bit OS's? <!-- github-comment-id:966758807 -->
Author
Owner

I'm getting four deprecated messages at the top of the web page when I first go to my piwigo site:

  • Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 215
  • Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1024
  • Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1024
  • Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1899

I'm in the process of upgrading from debian stretch to bullseye on a 32 bit pentium 4 machine. I've got both debian versions installed in a multiboot config. I haven't upgraded to piwigo 12 yet. From what I can tell looking at the source, commits and this issue, these haven't been fixed in 12. I'll go back to stretch and upgrade to piwigo 12, WHEN/IF the plugins I use are supported on 12. Then I'll periodically check bullseye when there are new piwigo releases. But, if there are patches to test, I'd like to help. Ideally (for me) they would be backward compatible with debian stretch because I'm using a partition shared by my bullseye and stretch installs for piwigo.

I'm getting four deprecated messages at the top of the web page when I first go to my piwigo site: - Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 215 - Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1024 - Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1024 - Deprecated: Invalid characters passed for attempted conversion, these have been ignored in .../piwigo/include/template.class.php on line 1899 I'm in the process of upgrading from debian stretch to bullseye on a 32 bit pentium 4 machine. I've got both debian versions installed in a multiboot config. I haven't upgraded to piwigo 12 yet. From what I can tell looking at the source, commits and this issue, these haven't been fixed in 12. I'll go back to stretch and upgrade to piwigo 12, WHEN/IF the plugins I use are supported on 12. Then I'll periodically check bullseye when there are new piwigo releases. But, if there are patches to test, I'd like to help. Ideally (for me) they would be backward compatible with debian stretch because I'm using a partition shared by my bullseye and stretch installs for piwigo. <!-- github-comment-id:968156745 -->
Author
Owner

I am having this same issue on the raspbian bullseye, with raspberry pi 4.
@ludo-c , since you added a fix on your fork, would it be possible to issue a pull request here?

I am having this same issue on the raspbian bullseye, with raspberry pi 4. @ludo-c , since you added a fix on your fork, would it be possible to issue a pull request here? <!-- github-comment-id:1003764761 -->
Author
Owner

@alexmogavero Hello,

A PR is already opened : https://github.com/Piwigo/Piwigo/pull/1420

@alexmogavero Hello, A PR is already opened : https://github.com/Piwigo/Piwigo/pull/1420 <!-- github-comment-id:1003765816 -->
Author
Owner

I am having this same issue on the raspbian bullseye, with raspberry pi 4. @ludo-c , since you added a fix on your fork, would it be possible to issue a pull request here?

@alexmogavero: Issue is related to 32bits processors. That mean for 32 bits operating systems. I bet you raspberry pi 4 run in 32 bits mode, not in 64 bits. Try to install 64 bits version: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit

Tested on Raspberry Pi 4 / 64 bits; issue is not present for me.

> I am having this same issue on the raspbian bullseye, with raspberry pi 4. @ludo-c , since you added a fix on your fork, would it be possible to issue a pull request here? @alexmogavero: Issue is related to 32bits processors. That mean for 32 bits operating systems. I bet you raspberry pi 4 run in 32 bits mode, not in 64 bits. Try to install 64 bits version: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit Tested on Raspberry Pi 4 / 64 bits; issue is not present for me. <!-- github-comment-id:1030416345 -->
Author
Owner

Tested on Raspberry Pi 4 / 64 bits; issue is not present for me.

So what's your point? We know it's a 32 bit issue. Until recently, there wasn't an official 64 bit version of raspberry pi os, and if you want to stream drm content, you still have to install the 32 bit version of chromium. Plus, rpi4 isn't the only hardware where one would want to run piwigo on a 32 bit OS. I have an old pentium 4 desktop computer where I'm running piwigo 11.5. I would like to upgrade to piwigo 12, but if the project isn't willing to support 32 bit OSs by accepting ludo-c's PR, then maybe I need to rethink my commitment to piwigo.

> Tested on Raspberry Pi 4 / 64 bits; issue is not present for me. So what's your point? We know it's a 32 bit issue. Until recently, there wasn't an official 64 bit version of raspberry pi os, and if you want to stream drm content, you still have to install the 32 bit version of chromium. Plus, rpi4 isn't the only hardware where one would want to run piwigo on a 32 bit OS. I have an old pentium 4 desktop computer where I'm running piwigo 11.5. I would like to upgrade to piwigo 12, but if the project isn't willing to support 32 bit OSs by accepting ludo-c's PR, then maybe I need to rethink my commitment to piwigo. <!-- github-comment-id:1030519661 -->
Author
Owner

ive got the same issue

ive got the same issue <!-- github-comment-id:1075446808 -->
Author
Owner

Thank you all for your report and clean solution. Merged.

Thank you all for your report and clean solution. Merged. <!-- github-comment-id:1192434870 -->
Author
Owner

Any chance this commit can be backported to 12.x?

Any chance this commit can be backported to 12.x? <!-- github-comment-id:1192955285 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1186