aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-10-24 20:26:32 +0200
committerMario <mario@mariovavti.com>2018-10-24 20:26:32 +0200
commita0a72a9f6d9e59ddf386a481e57dc64b882ff7ab (patch)
treebe0112497b338f1ed8e113d29ada40d917c034a4
parent01e11e904391504417f1a47c4fbb6277c154b5fd (diff)
parent24d68a7f09d00540ed181498239b954afe042db0 (diff)
downloadvolse-hubzilla-a0a72a9f6d9e59ddf386a481e57dc64b882ff7ab.tar.gz
volse-hubzilla-a0a72a9f6d9e59ddf386a481e57dc64b882ff7ab.tar.bz2
volse-hubzilla-a0a72a9f6d9e59ddf386a481e57dc64b882ff7ab.zip
Merge branch 'patch-19' into 'dev'
Convert non UTF-8 content on link embeding See merge request hubzilla/core!1347
-rw-r--r--Zotlabs/Module/Linkinfo.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php
index f0d62b5e0..a0ad17e68 100644
--- a/Zotlabs/Module/Linkinfo.php
+++ b/Zotlabs/Module/Linkinfo.php
@@ -228,8 +228,8 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$header = $result['header'];
$body = $result['body'];
-
- $body = mb_convert_encoding($body, 'UTF-8', 'UTF-8');
+
+ $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, 'HTML-ENTITIES', "UTF-8");
$doc = new \DOMDocument();