diff options
author | Mario <mario@mariovavti.com> | 2022-02-13 19:31:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-02-13 19:31:51 +0000 |
commit | c0350861ef0da66209e6b08c75af2c16e3673e25 (patch) | |
tree | 458473253ee91d92c7326b60567de301d272f4ea /include/oembed.php | |
parent | a7ec1805e3f5836641503d1f8cb6ccc1d8c885fa (diff) | |
download | volse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.tar.gz volse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.tar.bz2 volse-hubzilla-c0350861ef0da66209e6b08c75af2c16e3673e25.zip |
php8 warnings
Diffstat (limited to 'include/oembed.php')
-rw-r--r-- | include/oembed.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/oembed.php b/include/oembed.php index 9a25686fa..36938c577 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -134,6 +134,7 @@ function oembed_fetch_url($embedurl){ } $txt = null; + $j = null; // we should try to cache this and avoid a lookup on each render $is_matrix = is_matrix_url($embedurl); @@ -160,7 +161,7 @@ function oembed_fetch_url($embedurl){ if(is_null($txt)) { - $txt = ""; + $txt = EMPTY_STR; if ($action !== 'block') { // try oembed autodiscovery @@ -168,7 +169,7 @@ function oembed_fetch_url($embedurl){ $result = z_fetch_url($furl, false, $redirects, [ 'timeout' => 30, - 'accept_content' => "text/*", + 'accept_content' => 'text/*', 'novalidate' => true, 'session' => ((local_channel() && $zrl) ? true : false) ] @@ -227,9 +228,10 @@ function oembed_fetch_url($embedurl){ $txt = $x['embed']; } - $txt=trim($txt); + $txt = trim($txt); - if ($txt[0]!="{") $txt='{"type":"error"}'; + if (substr($txt, 0, 1) !== '{') + $txt = '{"type":"error"}'; // save in cache @@ -247,7 +249,7 @@ function oembed_fetch_url($embedurl){ } if($action === 'filter') { - if($j['html']) { + if(isset($j['html']) && $j['html']) { $orig = $j['html']; $allow_position = (($is_matrix) ? true : false); |