1
1
Fork 0

Merge pull request #5888 from nupplaphil/curl_result_tests

Curl result tests
This commit is contained in:
Hypolite Petovan 2018-10-11 16:42:09 -04:00 committed by GitHub
commit 90254fd74b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 181 additions and 2 deletions

View file

@ -119,7 +119,7 @@ class CurlResult
$header = '';
$base = $result;
while (preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/', $base)) {
while (preg_match('/^HTTP\/.+? \d+/', $base)) {
$chunk = substr($base, 0, strpos($base, "\r\n\r\n") + 4);
$header .= $chunk;
$base = substr($base, strlen($chunk));
@ -177,7 +177,7 @@ class CurlResult
$this->redirectUrl .= '?' . $old_location_query;
}
$this->isRedirectUrl = filter_var($this->redirectUrl, FILTER_VALIDATE_URL);
$this->isRedirectUrl = filter_var($this->redirectUrl, FILTER_VALIDATE_URL) !== false;
} else {
$this->isRedirectUrl = false;
}