Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20e5441

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Switched to non-null defaults in exception constructors Allow x-forwarded-prefix trusted header.
2 parents cc90ef3 + 3a2906c commit 20e5441

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getConfigTreeBuilder()
9898
->enumPrototype()
9999
->values([
100100
'forwarded',
101-
'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port',
101+
'x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix',
102102
])
103103
->end()
104104
->end()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,7 @@ private function resolveTrustedHeaders(array $headers): int
23952395
case 'x-forwarded-host': $trustedHeaders |= Request::HEADER_X_FORWARDED_HOST; break;
23962396
case 'x-forwarded-proto': $trustedHeaders |= Request::HEADER_X_FORWARDED_PROTO; break;
23972397
case 'x-forwarded-port': $trustedHeaders |= Request::HEADER_X_FORWARDED_PORT; break;
2398+
case 'x-forwarded-prefix': $trustedHeaders |= Request::HEADER_X_FORWARDED_PREFIX; break;
23982399
}
23992400
}
24002401

src/Symfony/Component/Config/Exception/LoaderLoadException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
class LoaderLoadException extends \Exception
2020
{
2121
/**
22-
* @param string $resource The resource that could not be imported
23-
* @param string $sourceResource The original resource importing the new resource
24-
* @param int $code The error code
25-
* @param \Throwable $previous A previous exception
26-
* @param string $type The type of resource
22+
* @param string $resource The resource that could not be imported
23+
* @param string|null $sourceResource The original resource importing the new resource
24+
* @param int|null $code The error code
25+
* @param \Throwable|null $previous A previous exception
26+
* @param string|null $type The type of resource
2727
*/
28-
public function __construct(string $resource, string $sourceResource = null, int $code = null, \Throwable $previous = null, string $type = null)
28+
public function __construct(string $resource, string $sourceResource = null, ?int $code = 0, \Throwable $previous = null, string $type = null)
2929
{
3030
$message = '';
3131
if ($previous) {

0 commit comments

Comments
 (0)