comparison program/lib/Roundcube/rcube_db.php @ 19:b6a96bdd6b29

More cleaning up php8 Warnings/deprecations
author Charlie Root
date Wed, 08 Oct 2025 08:50:44 -0400
parents abddb304201f
children
comparison
equal deleted inserted replaced
18:b631c1c7a3ce 19:b6a96bdd6b29
129 { 129 {
130 $this->db_error = false; 130 $this->db_error = false;
131 $this->db_error_msg = null; 131 $this->db_error_msg = null;
132 132
133 // return existing handle 133 // return existing handle
134 if ($this->dbhs[$mode]) { 134 if (!empty($this->dbhs[$mode])) {
135 $this->dbh = $this->dbhs[$mode]; 135 $this->dbh = $this->dbhs[$mode];
136 $this->db_mode = $mode; 136 $this->db_mode = $mode;
137 return $this->dbh; 137 return $this->dbh;
138 } 138 }
139 139
436 $pos = 0; 436 $pos = 0;
437 $idx = 0; 437 $idx = 0;
438 438
439 if (count($params)) { 439 if (count($params)) {
440 while ($pos = strpos($query, '?', $pos)) { 440 while ($pos = strpos($query, '?', $pos)) {
441 if ($query[$pos+1] == '?') { // skip escaped '?' 441 if (($query[$pos+1]??null) == '?') { // skip escaped '?'
442 $pos += 2; 442 $pos += 2;
443 } 443 }
444 else { 444 else {
445 $val = $this->quote($params[$idx++]); 445 $val = $this->quote($params[$idx++]);
446 unset($params[$idx-1]); 446 unset($params[$idx-1]);