diff options
| author | Mark Newnham <mark@newnhams.com> | 2026-04-03 12:08:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-03 12:08:30 -0600 |
| commit | 0e1ac40dd292620c8450411d832429b81e4d21d0 (patch) | |
| tree | fdc746a379b63c6ebde9be7ae0924a23fe94738f | |
| parent | 99b4685b0b4ae6c4e833b41519294bb57f25bb9c (diff) | |
| parent | 4fba79d165cebf87fc38acdf99b601a2b7a82128 (diff) | |
| download | adodb-0e1ac40dd292620c8450411d832429b81e4d21d0.tar.gz adodb-0e1ac40dd292620c8450411d832429b81e4d21d0.tar.bz2 adodb-0e1ac40dd292620c8450411d832429b81e4d21d0.zip | |
Merge pull request #1235 from ADOdb/1234-core-php83-deprecation-warning-in-quote-functionsmaster
Fixes #1234 Passing null values to string quoting functions causes deprecation warning
| -rw-r--r-- | adodb.inc.php | 6 | ||||
| -rw-r--r-- | drivers/adodb-pdo.inc.php | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/adodb.inc.php b/adodb.inc.php index 991ec791..2af0863a 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -3671,11 +3671,15 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1 * @param bool $magic_quotes This param is not used since 5.21.0. * It remains for backwards compatibility. * - * @return string Quoted string + * @return null|string Quoted string * * @noinspection PhpUnusedParameterInspection */ function addQ($s, $magic_quotes=false) { + + if (!$s) { + return $s; + } if ($this->replaceQuote[0] == '\\') { $s = str_replace( array('\\', "\0"), diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php index f25006ba..9fd01d67 100644 --- a/drivers/adodb-pdo.inc.php +++ b/drivers/adodb-pdo.inc.php @@ -665,10 +665,13 @@ class ADODB_pdo extends ADOConnection { * @param bool $magic_quotes This param is not used since 5.21.0. * It remains for backwards compatibility. * - * @return string Quoted string + * @return null|string Quoted string */ function qStr($s, $magic_quotes = false) { + if (!$s) { + return $s; + } if ($this->_connectionID) { return $this->_connectionID->quote($s); } |
