diff options
-rw-r--r-- | Zotlabs/Module/Linkinfo.php | 7 | ||||
-rw-r--r-- | view/it/hstrings.php | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index a0ad17e68..670967370 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -228,8 +228,13 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; + + // Check codepage in HTTP headers or HTML if not exist + $cp = (preg_match('/Content-Type: text\/html; charset=(.+)\r\n/i', $header, $o) ? $o[1] : ''); + if(empty($cp)) + $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); - $body = mb_convert_encoding($body, 'UTF-8', (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'UTF-8')); + $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); $doc = new \DOMDocument(); diff --git a/view/it/hstrings.php b/view/it/hstrings.php index 42fc58347..1f5527946 100644 --- a/view/it/hstrings.php +++ b/view/it/hstrings.php @@ -1393,7 +1393,7 @@ App::$strings["This site is powered by \$Projectname"] = "Questo sito รจ costrui App::$strings["Federated and decentralised networking and identity services provided by Zot"] = ""; App::$strings["Version %s"] = "Versione %s"; App::$strings["Project homepage"] = "Homepage del progetto"; -App::$strings["Developer homepage"] = "Homepege dello sviluppatore"; +App::$strings["Developer homepage"] = "Homepage dello sviluppatore"; App::$strings["No ratings"] = "Nessuna valutazione"; App::$strings["Ratings"] = "Valutazioni"; App::$strings["Rating: "] = "Valutazione:"; |