We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 393181b commit f015dbeCopy full SHA for f015dbe
system/Database/BaseConnection.php
@@ -17,6 +17,7 @@
17
use CodeIgniter\Database\Exceptions\DatabaseException;
18
use CodeIgniter\Events\Events;
19
use stdClass;
20
+use Stringable;
21
use Throwable;
22
23
/**
@@ -1309,12 +1310,15 @@ public function escape($str)
1309
1310
return array_map($this->escape(...), $str);
1311
}
1312
- /** @psalm-suppress NoValue I don't know why ERROR. */
1313
- if (is_string($str) || (is_object($str) && method_exists($str, '__toString'))) {
+ if ($str instanceof Stringable) {
1314
if ($str instanceof RawSql) {
1315
return $str->__toString();
1316
1317
1318
+ $str = (string) $str;
1319
+ }
1320
+
1321
+ if (is_string($str)) {
1322
return "'" . $this->escapeString($str) . "'";
1323
1324
0 commit comments