check if we deal with an array before sizeof()

(cherry picked from commit 339c9cceec)
This commit is contained in:
Mario Vavti 2018-12-19 09:05:18 +00:00 committed by Mario
parent 0bfda6d4c8
commit 1b5175d018

View File

@ -138,8 +138,8 @@ class Linkinfo extends \Zotlabs\Web\Controller {
}
$image = "";
if(sizeof($siteinfo["images"]) > 0){
if(is_array($siteinfo["images"]) && (sizeof($siteinfo["images"]) > 0)){
/* Execute below code only if image is present in siteinfo */
$total_images = 0;
@ -161,7 +161,7 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$total_images ++;
if($max_images && $max_images >= $total_images)
break;
}
}
}
if(strlen($text)) {