@@ -286,12 +286,12 @@ public function request($method, $uri, array $parameters = [], array $files = []
286286
287287 $ server = array_merge ($ this ->server , $ server );
288288
289- if (!empty ($ server ['HTTP_HOST ' ]) && null === parse_url ($ originalUri , PHP_URL_HOST )) {
289+ if (!empty ($ server ['HTTP_HOST ' ]) && null === parse_url ($ originalUri , \ PHP_URL_HOST )) {
290290 $ uri = preg_replace ('{^(https?\://) ' .preg_quote ($ this ->extractHost ($ uri )).'} ' , '${1} ' .$ server ['HTTP_HOST ' ], $ uri );
291291 }
292292
293- if (isset ($ server ['HTTPS ' ]) && null === parse_url ($ originalUri , PHP_URL_SCHEME )) {
294- $ uri = preg_replace ('{^ ' .parse_url ($ uri , PHP_URL_SCHEME ).'} ' , $ server ['HTTPS ' ] ? 'https ' : 'http ' , $ uri );
293+ if (isset ($ server ['HTTPS ' ]) && null === parse_url ($ originalUri , \ PHP_URL_SCHEME )) {
294+ $ uri = preg_replace ('{^ ' .parse_url ($ uri , \ PHP_URL_SCHEME ).'} ' , $ server ['HTTPS ' ] ? 'https ' : 'http ' , $ uri );
295295 }
296296
297297 if (!isset ($ server ['HTTP_REFERER ' ]) && !$ this ->history ->isEmpty ()) {
@@ -302,7 +302,7 @@ public function request($method, $uri, array $parameters = [], array $files = []
302302 $ server ['HTTP_HOST ' ] = $ this ->extractHost ($ uri );
303303 }
304304
305- $ server ['HTTPS ' ] = 'https ' == parse_url ($ uri , PHP_URL_SCHEME );
305+ $ server ['HTTPS ' ] = 'https ' == parse_url ($ uri , \ PHP_URL_SCHEME );
306306
307307 $ this ->internalRequest = new Request ($ uri , $ method , $ parameters , $ files , $ this ->cookieJar ->allValues ($ uri ), $ server , $ content );
308308
@@ -362,9 +362,9 @@ protected function doRequestInProcess($request)
362362 foreach ($ deprecations ? unserialize ($ deprecations ) : [] as $ deprecation ) {
363363 if ($ deprecation [0 ]) {
364364 // unsilenced on purpose
365- trigger_error ($ deprecation [1 ], E_USER_DEPRECATED );
365+ trigger_error ($ deprecation [1 ], \ E_USER_DEPRECATED );
366366 } else {
367- @trigger_error ($ deprecation [1 ], E_USER_DEPRECATED );
367+ @trigger_error ($ deprecation [1 ], \ E_USER_DEPRECATED );
368368 }
369369 }
370370 }
@@ -569,7 +569,7 @@ protected function getAbsoluteUri($uri)
569569
570570 // protocol relative URL
571571 if (0 === strpos ($ uri , '// ' )) {
572- return parse_url ($ currentUri , PHP_URL_SCHEME ).': ' .$ uri ;
572+ return parse_url ($ currentUri , \ PHP_URL_SCHEME ).': ' .$ uri ;
573573 }
574574
575575 // anchor or query string parameters?
@@ -578,7 +578,7 @@ protected function getAbsoluteUri($uri)
578578 }
579579
580580 if ('/ ' !== $ uri [0 ]) {
581- $ path = parse_url ($ currentUri , PHP_URL_PATH );
581+ $ path = parse_url ($ currentUri , \ PHP_URL_PATH );
582582
583583 if ('/ ' !== substr ($ path , -1 )) {
584584 $ path = substr ($ path , 0 , strrpos ($ path , '/ ' ) + 1 );
@@ -606,7 +606,7 @@ protected function requestFromRequest(Request $request, $changeHistory = true)
606606 private function updateServerFromUri ($ server , $ uri )
607607 {
608608 $ server ['HTTP_HOST ' ] = $ this ->extractHost ($ uri );
609- $ scheme = parse_url ($ uri , PHP_URL_SCHEME );
609+ $ scheme = parse_url ($ uri , \ PHP_URL_SCHEME );
610610 $ server ['HTTPS ' ] = null === $ scheme ? $ server ['HTTPS ' ] : 'https ' == $ scheme ;
611611 unset($ server ['HTTP_IF_NONE_MATCH ' ], $ server ['HTTP_IF_MODIFIED_SINCE ' ]);
612612
@@ -615,9 +615,9 @@ private function updateServerFromUri($server, $uri)
615615
616616 private function extractHost ($ uri )
617617 {
618- $ host = parse_url ($ uri , PHP_URL_HOST );
618+ $ host = parse_url ($ uri , \ PHP_URL_HOST );
619619
620- if ($ port = parse_url ($ uri , PHP_URL_PORT )) {
620+ if ($ port = parse_url ($ uri , \ PHP_URL_PORT )) {
621621 return $ host .': ' .$ port ;
622622 }
623623
0 commit comments