I have a Piwigo installed on my server for many years now, and it works like a charm, I love this soft, thanks for all the hard work ! ❤️
I open this issue to report a new error that I did not have when using Piwigo on PHP 7.x, and seems to have appeared when updating to PHP 8.1: when creating or renaming an album, if the name contains an apostrophe, I get the following error (when trying for example to create an album "vacances d'été 2022"):
Fatal error: Uncaught mysqli\_sql\_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'été 2022', `comment` = NULL, `commentable` = 'true' WHERE `id` = ...' at line 3 in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php:132 Stack trace: #0 //piwigo/include/dblayer/functions\_mysqli.inc.php(132): mysqli->query() #1 /photos/piwigo/include/dblayer/functions\_mysqli.inc.php(478): pwg\_query() #2 /photos/piwigo/admin/cat\_modify.php(118): single\_update() #3 /photos/piwigo/admin/album.php(60): include('...') #4 //photos/piwigo/admin.php(320): include('...') #5 {main} thrown in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php on line 132
As I am French, I have many existing albums with apostrophe, and there was no issue in the past. So I guess this is an issue with PHP 8 ? Note that when using Vacances d\'été 2022 for example, escaping the apostrophe with a \ the issue does not occur.
I am afraid this might also be a security issue, if the content of the SQL requests are not parsed to make sure unwanted characters are not interpreted ?
Thanks for your time !
HI,
I have a Piwigo installed on my server for many years now, and it works like a charm, I love this soft, thanks for all the hard work ! :heart:
I open this issue to report a new error that I did not have when using Piwigo on PHP 7.x, and seems to have appeared when updating to PHP 8.1: when creating or renaming an album, if the name contains an apostrophe, I get the following error (when trying for example to create an album "vacances d'été 2022"):
``
Fatal error: Uncaught mysqli\_sql\_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'été 2022', `comment` = NULL, `commentable` = 'true' WHERE `id` = ...' at line 3 in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php:132 Stack trace: #0 //piwigo/include/dblayer/functions\_mysqli.inc.php(132): mysqli->query() #1 /photos/piwigo/include/dblayer/functions\_mysqli.inc.php(478): pwg\_query() #2 /photos/piwigo/admin/cat\_modify.php(118): single\_update() #3 /photos/piwigo/admin/album.php(60): include('...') #4 //photos/piwigo/admin.php(320): include('...') #5 {main} thrown in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php on line 132
``
As I am French, I have many existing albums with apostrophe, and there was no issue in the past. So I guess this is an issue with PHP 8 ? Note that when using `Vacances d\'été 2022` for example, escaping the apostrophe with a `\` the issue does not occur.
I am afraid this might also be a security issue, if the content of the SQL requests are not parsed to make sure unwanted characters are not interpreted ?
Thanks for your time !
<!-- github-sync-id:1326079738 -->
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.
HI,
I have a Piwigo installed on my server for many years now, and it works like a charm, I love this soft, thanks for all the hard work ! ❤️
I open this issue to report a new error that I did not have when using Piwigo on PHP 7.x, and seems to have appeared when updating to PHP 8.1: when creating or renaming an album, if the name contains an apostrophe, I get the following error (when trying for example to create an album "vacances d'été 2022"):
Fatal error: Uncaught mysqli\_sql\_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'été 2022', `comment` = NULL, `commentable` = 'true' WHERE `id` = ...' at line 3 in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php:132 Stack trace: #0 //piwigo/include/dblayer/functions\_mysqli.inc.php(132): mysqli->query() #1 /photos/piwigo/include/dblayer/functions\_mysqli.inc.php(478): pwg\_query() #2 /photos/piwigo/admin/cat\_modify.php(118): single\_update() #3 /photos/piwigo/admin/album.php(60): include('...') #4 //photos/piwigo/admin.php(320): include('...') #5 {main} thrown in /photos/piwigo/include/dblayer/functions\_mysqli.inc.php on line 132As I am French, I have many existing albums with apostrophe, and there was no issue in the past. So I guess this is an issue with PHP 8 ? Note that when using
Vacances d\'été 2022for example, escaping the apostrophe with a\the issue does not occur.I am afraid this might also be a security issue, if the content of the SQL requests are not parsed to make sure unwanted characters are not interpreted ?
Thanks for your time !
Problem also occurs when you rename an album