]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1695 from ArthurHoaro/fix/ut-curl
authorArthurHoaro <arthur@hoa.ro>
Wed, 20 Jan 2021 10:31:35 +0000 (11:31 +0100)
committerGitHub <noreply@github.com>
Wed, 20 Jan 2021 10:31:35 +0000 (11:31 +0100)
application/Utils.php
application/helper/ApplicationUtils.php

index 952378ab8620e02a360f73fd10ad4d1147afda9d..c5cd884b7291ba328336837430d4579f12ec2b0e 100644 (file)
@@ -323,6 +323,7 @@ function format_date($date, $time = true, $intl = true)
         IntlDateFormatter::LONG,
         $time ? IntlDateFormatter::LONG : IntlDateFormatter::NONE
     );
+    $formatter->setTimeZone($date->getTimezone());
 
     return $formatter->format($date);
 }
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;
         }