diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -1425,16 +1425,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager) | |||
1425 | // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) | 1425 | // If this is an HTTP(S) link, we try go get the page to extract the title (otherwise we will to straight to the edit form.) |
1426 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { | 1426 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { |
1427 | // Short timeout to keep the application responsive | 1427 | // Short timeout to keep the application responsive |
1428 | list($headers, $content) = get_http_response($url, 4); | 1428 | // The callback will fill $charset and $title with data from the downloaded page. |
1429 | if (strpos($headers[0], '200 OK') !== false) { | 1429 | get_http_response($url, 25, 4194304, get_curl_download_callback($charset, $title)); |
1430 | // Retrieve charset. | 1430 | if (! empty($title) && strtolower($charset) != 'utf-8') { |
1431 | $charset = get_charset($headers, $content); | 1431 | $title = mb_convert_encoding($title, 'utf-8', $charset); |
1432 | // Extract title. | ||
1433 | $title = html_extract_title($content); | ||
1434 | // Re-encode title in utf-8 if necessary. | ||
1435 | if (! empty($title) && strtolower($charset) != 'utf-8') { | ||
1436 | $title = mb_convert_encoding($title, 'utf-8', $charset); | ||
1437 | } | ||
1438 | } | 1432 | } |
1439 | } | 1433 | } |
1440 | 1434 | ||