diff --git a/system/Database/SQLSRV/Connection.php b/system/Database/SQLSRV/Connection.php index a10fefd2e3c6..f980e3923e48 100755 --- a/system/Database/SQLSRV/Connection.php +++ b/system/Database/SQLSRV/Connection.php @@ -141,7 +141,7 @@ public function connect(bool $persistent = false) $errors = []; foreach (sqlsrv_errors(SQLSRV_ERR_ERRORS) as $error) { - $errors[] = preg_replace('/(\[.+\]\[.+\](?:\[.+\])?)(.+)/', '$2', $error['message']); + $errors[] = (string) preg_replace('/(\[.+\]\[.+\](?:\[.+\])?)(.+)/', '$2', $error['message']); } throw new DatabaseException(implode("\n", $errors)); diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index 2ecf69cc0242..1e8a1aedbaad 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -474,7 +474,7 @@ protected function setResponseHeaders(array $headers = []) } if (isset($matches[2])) { - $this->response->setStatusCode($matches[2], $matches[3] ?? null); + $this->response->setStatusCode((int) $matches[2], $matches[3] ?? null); } } } diff --git a/system/Helpers/text_helper.php b/system/Helpers/text_helper.php index 8ad9797d1ee9..51b2c7dbafa7 100755 --- a/system/Helpers/text_helper.php +++ b/system/Helpers/text_helper.php @@ -598,7 +598,7 @@ function increment_string(string $str, string $separator = '_', int $first = 1): { preg_match('/(.+)' . preg_quote($separator, '/') . '([0-9]+)$/', $str, $match); - return isset($match[2]) ? $match[1] . $separator . ($match[2] + 1) : $str . $separator . $first; + return isset($match[2]) ? $match[1] . $separator . ((int) $match[2] + 1) : $str . $separator . $first; } } diff --git a/system/Session/Handlers/MemcachedHandler.php b/system/Session/Handlers/MemcachedHandler.php index 5e963bf5048a..cc6365264e79 100644 --- a/system/Session/Handlers/MemcachedHandler.php +++ b/system/Session/Handlers/MemcachedHandler.php @@ -103,7 +103,7 @@ public function open($path, $name): bool continue; } - if (! $this->memcached->addServer($match[1], $match[2], $match[3] ?? 0)) { + if (! $this->memcached->addServer($match[1], (int) $match[2], $match[3] ?? 0)) { $this->logger->error('Could not add ' . $match[1] . ':' . $match[2] . ' to Memcached server pool.'); } else { $serverList[] = $match[1] . ':' . $match[2];