Skip to content

Commit 522ad92

Browse files
committed
Leverage str_ends_with
added the php80 polyfill to requirements when necessary
1 parent 8285da4 commit 522ad92

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ private function getTrustedValues(int $type, string $ip = null): array
20112011
continue;
20122012
}
20132013
if (self::HEADER_X_FORWARDED_PORT === $type) {
2014-
if (']' === substr($v, -1) || false === $v = strrchr($v, ':')) {
2014+
if (str_ends_with($v, ']') || false === $v = strrchr($v, ':')) {
20152015
$v = $this->isSecure() ? ':443' : ':80';
20162016
}
20172017
$v = '0.0.0.0'.$v;

Tests/File/MimeType/MimeTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testGuessWithNonReadablePath()
8888
touch($path);
8989
@chmod($path, 0333);
9090

91-
if ('0333' == substr(sprintf('%o', fileperms($path)), -4)) {
91+
if (str_ends_with(sprintf('%o', fileperms($path)), '0333')) {
9292
$this->expectException(AccessDeniedException::class);
9393
MimeTypeGuesser::getInstance()->guess($path);
9494
} else {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=7.1.3",
2020
"symfony/mime": "^4.3|^5.0",
2121
"symfony/polyfill-mbstring": "~1.1",
22-
"symfony/polyfill-php80": "^1.15"
22+
"symfony/polyfill-php80": "^1.16"
2323
},
2424
"require-dev": {
2525
"predis/predis": "~1.0",

0 commit comments

Comments
 (0)