From f180558041507bcc4f80e8f373ca3e6bd635edea Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Tue, 23 Oct 2018 19:32:36 +0200 Subject: Convert non UTF-8 content on link embeding --- Zotlabs/Module/Linkinfo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index f0d62b5e0..534e5697b 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -228,8 +228,10 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - - $body = mb_convert_encoding($body, 'UTF-8', 'UTF-8'); + + $x = preg_match('/ Date: Tue, 23 Oct 2018 19:57:21 +0200 Subject: Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 534e5697b..715cda356 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -228,10 +228,8 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - - $x = preg_match('/ Date: Tue, 23 Oct 2018 20:36:30 +0200 Subject: Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 715cda356..8666976af 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -229,7 +229,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - $body = mb_convert_encoding($body, 'UTF-8', (preg_match('/ Date: Wed, 24 Oct 2018 10:28:18 +0200 Subject: Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 8666976af..a0ad17e68 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -229,7 +229,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - $body = mb_convert_encoding($body, 'UTF-8', (preg_match('/meta\s+http-equiv=.content-type.+;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : '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(); -- cgit v1.2.3