Merge branch 'master' into themes
This commit is contained in:
commit
2e58d5cfa9
1 changed files with 4 additions and 1 deletions
|
@ -38,9 +38,12 @@ function getTitle($url) {
|
||||||
preg_match_all('/<title>(.*)<\/title>/si', $html, $matches);
|
preg_match_all('/<title>(.*)<\/title>/si', $html, $matches);
|
||||||
$title = $matches[1][0];
|
$title = $matches[1][0];
|
||||||
|
|
||||||
|
$encoding = 'utf-8';
|
||||||
// Get encoding from charset attribute
|
// Get encoding from charset attribute
|
||||||
preg_match_all('/<meta.*charset=([^;"]*)">/i', $html, $matches);
|
preg_match_all('/<meta.*charset=([^;"]*)">/i', $html, $matches);
|
||||||
|
if (isset($matches[1][0])) {
|
||||||
$encoding = strtoupper($matches[1][0]);
|
$encoding = strtoupper($matches[1][0]);
|
||||||
|
}
|
||||||
|
|
||||||
// Convert to UTF-8 from the original encoding
|
// Convert to UTF-8 from the original encoding
|
||||||
if (function_exists("mb_convert_encoding")) {
|
if (function_exists("mb_convert_encoding")) {
|
||||||
|
|
Loading…
Reference in a new issue