diff --git a/system/BaseModel.php b/system/BaseModel.php index 26b6952291e4..06b8190f037f 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1711,7 +1711,7 @@ protected function transformDataToArray($data, string $type): array * * @param string $name Name * - * @return mixed + * @return array|bool|float|int|object|string|null */ public function __get(string $name) { diff --git a/system/Common.php b/system/Common.php index 1eb561445ce6..097e6dc67e64 100644 --- a/system/Common.php +++ b/system/Common.php @@ -66,8 +66,8 @@ function app_timezone(): string * cache()->save('foo', 'bar'); * $foo = cache('bar'); * - * @return CacheInterface|mixed - * @phpstan-return ($key is null ? CacheInterface : mixed) + * @return array|bool|CacheInterface|float|int|object|string|null + * @phpstan-return ($key is null ? CacheInterface : array|bool|float|int|object|string|null) */ function cache(?string $key = null) { @@ -1007,7 +1007,7 @@ function session(?string $val = null) * - $timer = service('timer') * - $timer = \CodeIgniter\Config\Services::timer(); * - * @param mixed ...$params + * @param array|bool|float|int|object|string|null ...$params * * @return object */ @@ -1021,7 +1021,7 @@ function service(string $name, ...$params) /** * Always returns a new instance of the class. * - * @param mixed ...$params + * @param array|bool|float|int|object|string|null ...$params * * @return object|null */ diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index 0c8e8c455ffd..87b4a508999b 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -387,6 +387,10 @@ public function send(string $method, string $url) $output = substr($output, strpos($output, $breakString) + 4); } + if (strpos($output, 'HTTP/1.1 200 Connection established') === 0) { + $output = substr($output, strpos($output, $breakString) + 4); + } + // If request and response have Digest if (isset($this->config['auth'][2]) && $this->config['auth'][2] === 'digest' && strpos($output, 'WWW-Authenticate: Digest') !== false) { $output = substr($output, strpos($output, $breakString) + 4); diff --git a/system/Helpers/number_helper.php b/system/Helpers/number_helper.php index c61229dad345..32dd4e09d68c 100644 --- a/system/Helpers/number_helper.php +++ b/system/Helpers/number_helper.php @@ -173,9 +173,9 @@ function format_number(float $num, int $precision = 1, ?string $locale = null, a /** * Convert a number to a roman numeral. * - * @param string $num it will convert to int + * @param int|string $num it will convert to int */ - function number_to_roman(string $num): ?string + function number_to_roman($num): ?string { static $map = [ 'M' => 1000, diff --git a/system/Model.php b/system/Model.php index 80e4bb48a34c..b60bb966dd85 100644 --- a/system/Model.php +++ b/system/Model.php @@ -792,7 +792,7 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur * * @param string $name Name * - * @return mixed + * @return array|BaseBuilder|bool|float|int|object|string|null */ public function __get(string $name) { @@ -821,7 +821,7 @@ public function __isset(string $name): bool * Provides direct access to method in the builder (if available) * and the database connection. * - * @return mixed + * @return $this|array|BaseBuilder|bool|float|int|object|string|null */ public function __call(string $name, array $params) { diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php index 6f99779e7c71..b90b8242626c 100644 --- a/tests/system/HTTP/CURLRequestTest.php +++ b/tests/system/HTTP/CURLRequestTest.php @@ -779,6 +779,21 @@ public function testSendContinuedWithManyHeaders() $this->assertSame(200, $response->getStatusCode()); } + public function testSendProxied() + { + $request = $this->getRequest([ + 'base_uri' => 'http://www.foo.com/api/v1/', + 'delay' => 100, + ]); + + $output = "HTTP/1.1 200 Connection established +Proxy-Agent: Fortinet-Proxy/1.0\x0d\x0a\x0d\x0aHTTP/1.1 200 OK\x0d\x0a\x0d\x0aHi there"; + $request->setOutput($output); + + $response = $request->get('answer'); + $this->assertSame('Hi there', $response->getBody()); + } + /** * See: https://github.com/codeigniter4/CodeIgniter4/issues/7394 */ diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index c0470be967d5..b80c10ede526 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -174,7 +174,7 @@ Explanation of Values: **compress** Whether or not to use client compression (``MySQLi`` only). **strictOn** true/false (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application (``MySQLi`` only). -**port** The database port number. +**port** The database port number - Empty string ``''`` for default port (or dynamic port with ``SQLSRV``). **foreignKeys** true/false (boolean) - Whether or not to enable Foreign Key constraint (``SQLite3`` only). .. important:: SQLite3 Foreign Key constraint is disabled by default. diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst index d43967c502f7..0528aa07eee1 100644 --- a/user_guide_src/source/helpers/number_helper.rst +++ b/user_guide_src/source/helpers/number_helper.rst @@ -92,7 +92,7 @@ The following functions are available: .. php:function:: number_to_roman($num) - :param string $num: The number want to convert + :param int|string $num: The number want to convert :returns: The roman number converted from given parameter :rtype: string|null @@ -101,4 +101,4 @@ The following functions are available: .. literalinclude:: number_helper/009.php This function only handles numbers in the range 1 through 3999. - It will return null for any value outside that range. + It will return ``null`` for any value outside that range. diff --git a/user_guide_src/source/helpers/number_helper/009.php b/user_guide_src/source/helpers/number_helper/009.php index 0a520a198943..a55daa265677 100644 --- a/user_guide_src/source/helpers/number_helper/009.php +++ b/user_guide_src/source/helpers/number_helper/009.php @@ -1,5 +1,5 @@