- empty() is maybe superflous here, still I would prefer a code style that is
  written explicitly and not rely on "magic casting"
This commit is contained in:
Roland Häder 2022-06-22 18:56:08 +02:00
parent 15d8341d9a
commit 7eefb9aed8
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
4 changed files with 7 additions and 7 deletions

View file

@ -111,7 +111,7 @@ class BBCode
$picturedata = Images::getInfoFromURLCached($matches[1]);
if (!empty($picturedata)) {
if ($picturedata) {
if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1])) {
$post['image'] = $matches[1];
} else {
@ -320,7 +320,7 @@ class BBCode
$post['text'] = trim(str_replace($pictures[0][0], '', $body));
} else {
$imgdata = Images::getInfoFromURLCached($pictures[0][1]);
if (!empty($imgdata) && 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];