@@ -106,10 +106,8 @@ public static function createFromGlobals()
106106 $ httpType = (string ) $ request ->server ->get ('HTTP_CONTENT_TYPE ' );
107107 $ method = (string ) $ request ->server ->get ('REQUEST_METHOD ' , 'GET ' );
108108
109- if ((0 === strpos ($ type , 'application/x-www-form-urlencoded ' )
110- || (0 === strpos ($ httpType , 'application/x-www-form-urlencoded ' )))
111- && in_array (strtoupper ($ method ), ['PUT ' , 'DELETE ' , 'PATCH ' ])
112- ) {
109+ if ((0 === strpos ($ type , 'application/x-www-form-urlencoded ' ) || (0 === strpos ($ httpType , 'application/x-www-form-urlencoded ' )))
110+ && in_array (strtoupper ($ method ), ['PUT ' , 'DELETE ' , 'PATCH ' ])) {
113111 parse_str ($ request ->getContent (), $ data );
114112 $ request ->request = new Parameter ($ data );
115113 }
@@ -1305,12 +1303,8 @@ private function setPhpDefaultLocale($locale)
13051303 private function getUrlencodedPrefix ($ string , $ prefix )
13061304 {
13071305 $ prefix = (string ) $ prefix ;
1308-
1309- if (!$ prefix || 0 !== strpos ((string ) rawurldecode ($ string ), $ prefix )) {
1310- return false ;
1311- }
1312-
1313- $ len = mb_strlen ($ prefix , '8bit ' );
1314- return preg_match ('#^(%[[:xdigit:]]{2}|.){ ' . $ len . '}# ' , $ string , $ match ) ? $ match [0 ] : false ;
1306+ return (!$ prefix || 0 !== strpos ((string ) rawurldecode ($ string ), $ prefix ))
1307+ ? false
1308+ : (preg_match ('#^(%[[:xdigit:]]{2}|.){ ' . mb_strlen ($ prefix , '8bit ' ) . '}# ' , $ string , $ match ) ? $ match [0 ] : false );
13151309 }
13161310}
0 commit comments