* Fixes:
- stdClass is clearly an object of `\stdClass`, so let's import it and set it
as type-hint here
- if $o->type is not found, don't continue
Signed-off-by: Roland Häder <roland@mxchange.org>
* Fix for a fix due to 02:51 a.m. (!) edits ...
Signed-off-by: Roland Häder <roland@mxchange.org>
use DOMText;
use DOMXPath;
use Exception;
+use stdClass;
require_once 'include/dba.php';
require_once 'mod/proxy.php';
return $j;
}
- private static function formatObject($j)
+ private static function formatObject(stdClass $j)
{
$embedurl = $j->embedurl;
$jhtml = $j->html;
$ret = '<div class="oembed ' . $j->type . '">';
+
switch ($j->type) {
case "video":
if (isset($j->thumbnail_url)) {
$o = self::fetchURL($url, !self::isAllowedURL($url));
- if (!is_object($o) || $o->type == 'error') {
+ if (!is_object($o) || property_exists($o, 'type') && $o->type == 'error') {
throw new Exception('OEmbed failed for URL: ' . $url);
}