]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
curl usage: support HTTP/2 response code header
authorArthurHoaro <arthur@hoa.ro>
Tue, 19 Jan 2021 14:03:18 +0000 (15:03 +0100)
committerArthurHoaro <arthur@hoa.ro>
Tue, 19 Jan 2021 14:03:18 +0000 (15:03 +0100)
application/helper/ApplicationUtils.php

index a6c03aaeae899daebb46bb37884dc3422694b6d0..f79998b51f54dcf68014db1c80b307d2919137df 100644 (file)
@@ -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;
         }