From bafc7737f056a07dcecc612ce2357a1fc2043dbb Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sat, 18 Nov 2023 16:54:21 +0100 Subject: oci8: fix warning in qStr() with NULL on PHP 8.1 This is a follow-up commit on 1501ccd07868d626a51802d14ed41ed05a3532ad, as the original fix for #999 (see PR #1005) did not fully address the problem. Another PHP deprecated warning is thrown: strlen(): Passing null to parameter 1 ($string) of type string is deprecated. Fixes #1012 Backported from commit 8d88183538ae08b86c30af5b0f3280c2accd71c3. --- drivers/adodb-oci8.inc.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/adodb-oci8.inc.php b/drivers/adodb-oci8.inc.php index 965c1621..b92281c7 100644 --- a/drivers/adodb-oci8.inc.php +++ b/drivers/adodb-oci8.inc.php @@ -1576,11 +1576,8 @@ SELECT /*+ RULE */ distinct b.column_name */ function qStr($s, $magic_quotes=false) { - if ($this->noNullStrings && strlen($s) == 0) { - $s = ' '; - } - else if (strlen($s) == 0) { - return "''"; + if (strlen((string)$s) == 0) { + return $this->noNullStrings ? "' '" : "''"; } if ($this->replaceQuote[0] == '\\'){ $s = str_replace('\\','\\\\',$s); -- cgit v1.3