Update Linkinfo.php

This commit is contained in:
Max Kostikov 2018-11-03 00:10:05 +01:00
parent 2f3b4a7aaf
commit a7624ea48b

View File

@ -230,7 +230,7 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$body = $result['body'];
// Check codepage in HTTP headers or HTML if not exist
$cp = trim((preg_match('/Content-Type: text\/html; charset=(.+)/im', $header, $o) ? $o[1] : ''));
$cp = (preg_match('/Content-Type: text\/html; charset=(.+)/i', $header, $o) ? trim($o[1]) : '');
if(empty($cp))
$cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO');