@@ -292,7 +292,7 @@ public static function createFromGlobals()
292292 {
293293 $ request = self ::createRequestFromFactory ($ _GET , $ _POST , [], $ _COOKIE , $ _FILES , $ _SERVER );
294294
295- if (0 === strpos ($ request ->headers ->get ('CONTENT_TYPE ' , '' ), 'application/x-www-form-urlencoded ' )
295+ if (str_starts_with ($ request ->headers ->get ('CONTENT_TYPE ' , '' ), 'application/x-www-form-urlencoded ' )
296296 && \in_array (strtoupper ($ request ->server ->get ('REQUEST_METHOD ' , 'GET ' )), ['PUT ' , 'DELETE ' , 'PATCH ' ])
297297 ) {
298298 parse_str ($ request ->getContent (), $ data );
@@ -1647,7 +1647,7 @@ public function getLanguages()
16471647 $ languages = AcceptHeader::fromString ($ this ->headers ->get ('Accept-Language ' ))->all ();
16481648 $ this ->languages = [];
16491649 foreach ($ languages as $ lang => $ acceptHeaderItem ) {
1650- if (false !== strpos ($ lang , '- ' )) {
1650+ if (str_contains ($ lang , '- ' )) {
16511651 $ codes = explode ('- ' , $ lang );
16521652 if ('i ' === $ codes [0 ]) {
16531653 // Language not listed in ISO 639 that are not variants
@@ -1949,7 +1949,7 @@ private function setPhpDefaultLocale(string $locale): void
19491949 */
19501950 private function getUrlencodedPrefix (string $ string , string $ prefix ): ?string
19511951 {
1952- if (0 !== strpos (rawurldecode ($ string ), $ prefix )) {
1952+ if (! str_starts_with (rawurldecode ($ string ), $ prefix )) {
19531953 return null ;
19541954 }
19551955
@@ -2057,7 +2057,7 @@ private function normalizeAndFilterClientIps(array $clientIps, string $ip): arra
20572057 if ($ i ) {
20582058 $ clientIps [$ key ] = $ clientIp = substr ($ clientIp , 0 , $ i );
20592059 }
2060- } elseif (0 === strpos ($ clientIp , '[ ' )) {
2060+ } elseif (str_starts_with ($ clientIp , '[ ' )) {
20612061 // Strip brackets and :port from IPv6 addresses.
20622062 $ i = strpos ($ clientIp , '] ' , 1 );
20632063 $ clientIps [$ key ] = $ clientIp = substr ($ clientIp , 1 , $ i - 1 );
0 commit comments