Serendipity icon indicating copy to clipboard operation
Serendipity copied to clipboard

bugfix: pg_escape_string() in serendipity_db_escape_string() works again

Open HQJaTu opened this issue 1 year ago • 2 comments

Docs: https://www.php.net/manual/en/function.pg-escape-string.php

In PHP 8.1+ there is no default connection. A mandatory connection must be given as a parameter. This PR restores PostgreSQL support for S9y.

Not sure if PHP <8.1 must be supported. If yes, PHP_MAJOR_VERSION and PHP_MINOR_VERSION could be checked to determine which interface of pg_escape_string() needs to be used.

HQJaTu avatar Oct 08 '24 20:10 HQJaTu

Great :)

Not sure if PHP <8.1 must be supported. If yes, PHP_MAJOR_VERSION and PHP_MINOR_VERSION could be checked to determine which interface of pg_escape_string() needs to be used.

It would be nice to support older PHP versions. It makes upgrades for old blogs a lot easier, and so far we were still compatible I think.

onli avatar Oct 13 '24 14:10 onli

Checked after the commit. Correction: PHP 8.1 is still supported by security updates. https://www.php.net/supported-versions.php

My own agenda is to move into PHP 8.2. When stable status reached, then bump into 8.3 to see what breaks.

HQJaTu avatar Oct 13 '24 18:10 HQJaTu

Hi :) I did not see the progress here, sorry. Thank you for changing it to version_compare, judging from the code that part looks good to me now!

But now there are some additional commits in this branch that probably ended up here by accident, like https://github.com/s9y/Serendipity/pull/855/commits/5c75b730fb836def4936c1fe56b2c0d76665f20e. Could you separate that, so we can merge this PR first? You could either rebase the branch to pick only the commits we need here or just open a new PR, whatever is easier.

The other commits could then in a PHP 8.2 fixes PR. Those I could actually test, and then we can pinpoint better if something broke.

onli avatar Oct 29 '24 20:10 onli

I could not fix this PR, so instead the relevant commit was reused in https://github.com/s9y/Serendipity/pull/882. Will close here.

onli avatar Mar 31 '25 21:03 onli