Merge pull request #1695 from ArthurHoaro/fix/ut-curl

This commit is contained in:
ArthurHoaro 2021-01-20 11:31:35 +01:00 committed by GitHub
commit 055d97f9a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View 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);
}

View 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;
}