aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.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 /include/oembed.php
parent5b7387459cf4de8f7354d81cb0392c4225714d94 (diff)
parentb464fae3bf22585888c5f3def8eded76fd48ed16 (diff)
downloadvolse-hubzilla-9.0.tar.gz
volse-hubzilla-9.0.tar.bz2
volse-hubzilla-9.0.zip
Merge branch '9.0RC'9.0
Diffstat (limited to 'include/oembed.php')
-rw-r--r--include/oembed.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/oembed.php b/include/oembed.php
index fbe6a573b..a90c91641 100644
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -395,7 +395,11 @@ function oembed_format_object($j){
$ret .= "<br /><a href='$embedurl' rel='oembed'>$embedurl</a>";
}
$ret.="<br style='clear:left'></span>";
- return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
+
+ // mb_convert_encoding() is deprecated
+ // return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
+ return mb_encode_numericentity($ret, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');
+
}
function oembed_iframe($src,$width,$height) {
@@ -456,7 +460,10 @@ function oembed_html2bbcode($text) {
if (strpos($text, "oembed")){
// convert non ascii chars to html entities
- $html_text = mb_convert_encoding($text, 'HTML-ENTITIES', mb_detect_encoding($text));
+
+ // mb_convert_encoding() is deprecated
+ // $html_text = mb_convert_encoding($text, 'HTML-ENTITIES', mb_detect_encoding($text));
+ $html_text = mb_encode_numericentity($text, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');
// If it doesn't parse at all, just return the text.