Merge pull request #1695 from ArthurHoaro/fix/ut-curl
This commit is contained in:
commit
055d97f9a9
2 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public static function getLatestGitVersionCode($url, $timeout = 2)
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue