aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Linkinfo.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
committerMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
commit1aeb05628b6a2a069c46980efbe628362c9e3e74 (patch)
treee9aed15d0cd74e0c23dcb05c7be8fe9541efdf36 /Zotlabs/Module/Linkinfo.php
parent5b7387459cf4de8f7354d81cb0392c4225714d94 (diff)
parentb464fae3bf22585888c5f3def8eded76fd48ed16 (diff)
downloadvolse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.gz
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.bz2
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.zip
Merge branch '9.0RC'9.0
Diffstat (limited to 'Zotlabs/Module/Linkinfo.php')
-rw-r--r--Zotlabs/Module/Linkinfo.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php
index 038c739d5..081966dba 100644
--- a/Zotlabs/Module/Linkinfo.php
+++ b/Zotlabs/Module/Linkinfo.php
@@ -291,11 +291,15 @@ class Linkinfo extends \Zotlabs\Web\Controller {
// 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');
+ if(empty($cp)) {
+ $cp = (preg_match('/meta.+content=["\']text\/html; charset=([^"\']+)/i', $body, $o) ? $o[1] : 'AUTO');
+ }
+
+ $body = mb_convert_encoding($body, 'UTF-8', $cp);
- $body = mb_convert_encoding($body, 'UTF-8', $cp);
- $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8");
+ // Handling HTML entities via mbstring is deprecated
+ //$body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8");
+ $body = mb_encode_numericentity($body, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');
$doc = new \DOMDocument();
@$doc->loadHTML($body);