X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FContent%2FText%2FBBCode.php;h=7d1c429765337e48d374f07c223eff9c18e7d0ed;hb=bfc2bda9b606b424e4dfc1053af1ecea116fb1e2;hp=ebaef2b29d1accf43625b1e56c9cdcafc7fb61e1;hpb=9665f4ed415d34cbcf09df8c6ca04882303e9544;p=friendica.git diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index ebaef2b29d..7d1c429765 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -76,10 +76,12 @@ class BBCode extends BaseObject $picturedata = Image::getInfoFromURL($matches[1]); - if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1])) { - $post["image"] = $matches[1]; - } else { - $post["preview"] = $matches[1]; + if ($picturedata) { + if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1])) { + $post["image"] = $matches[1]; + } else { + $post["preview"] = $matches[1]; + } } } @@ -266,7 +268,7 @@ class BBCode extends BaseObject $post["text"] = str_replace($pictures[0][0], "", $body); } else { $imgdata = Image::getInfoFromURL($pictures[0][1]); - if (substr($imgdata["mime"], 0, 6) == "image/") { + if ($imgdata && substr($imgdata["mime"], 0, 6) == "image/") { $post["type"] = "photo"; $post["image"] = $pictures[0][1]; $post["preview"] = $pictures[0][2];