summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2023-11-18 16:54:21 +0100
committerDamien Regad <dregad@mantisbt.org>2024-05-26 16:21:27 +0200
commitbafc7737f056a07dcecc612ce2357a1fc2043dbb (patch)
treea7cda66a51e855541aa80e013f9323e3d72e1eb5 /drivers
parent5f589f64cea42c792929832cffe26825831f8c94 (diff)
downloadadodb-bafc7737f056a07dcecc612ce2357a1fc2043dbb.tar.gz
adodb-bafc7737f056a07dcecc612ce2357a1fc2043dbb.tar.bz2
adodb-bafc7737f056a07dcecc612ce2357a1fc2043dbb.zip
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.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/adodb-oci8.inc.php7
1 files changed, 2 insertions, 5 deletions
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);