From: ArthurHoaro Date: Tue, 19 Jan 2021 14:03:18 +0000 (+0100) Subject: curl usage: support HTTP/2 response code header X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=6b76ce6f6285fd0b3565fc911f6469d21a132149 curl usage: support HTTP/2 response code header --- diff --git a/application/helper/ApplicationUtils.php b/application/helper/ApplicationUtils.php index a6c03aae..f79998b5 100644 --- a/application/helper/ApplicationUtils.php +++ b/application/helper/ApplicationUtils.php @@ -37,7 +37,7 @@ class ApplicationUtils { list($headers, $data) = get_http_response($url, $timeout); - if (strpos($headers[0], '200 OK') === false) { + if (preg_match('#HTTP/[\d\.]+ 200(?: OK)?#', $headers[0]) !== 1) { error_log('Failed to retrieve ' . $url); return false; }