From 1557cefbd76257ceb830f65806831b490faf0acc Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 4 Jan 2016 10:45:54 +0100 Subject: Fixes #410 - Retrieve title fails in multiple cases * `get_http_url()` renamed to `get_http_response()`. * Use the same HTTP context to retrieve response headers and content. * Follow HTTP 301 and 302 redirections to retrieve the title (default max 3 redirections). * Add `LinkUtils` to extract titles and charset. * Try to retrieve charset from HTTP headers first (new), then HTML content. * Use mb_string to re-encode title if necessary. --- application/ApplicationUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/ApplicationUtils.php') diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php index 274331e1..978fc9da 100644 --- a/application/ApplicationUtils.php +++ b/application/ApplicationUtils.php @@ -19,7 +19,7 @@ class ApplicationUtils */ public static function getLatestGitVersionCode($url, $timeout=2) { - list($headers, $data) = get_http_url($url, $timeout); + list($headers, $data) = get_http_response($url, $timeout); if (strpos($headers[0], '200 OK') === false) { error_log('Failed to retrieve ' . $url); -- cgit v1.2.3