From 2c0ad47dfc3be0ebda45569aded5e1cd6f4825a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 31 Jul 2018 04:24:32 +0200 Subject: [PATCH] Fixed fatal error: (#5532) * Fixed fatal error: ```` PHP Fatal error: Uncaught TypeError: Argument 1 passed to add_page_info_data() must be of the type array, boolean given, called in /var/www/../include/items.php on line 153 and defined in /var/www/../include/items.php:27 ```` Fix for type-hint array when query_page_info() returned a non-array, this may happen when the instance/node/pod owner decided to shutdown server and replace all URLs with a replacement message. * Fixed parser error, ops. --- include/items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 0d447f2b40..34d6132f01 100644 --- a/include/items.php +++ b/include/items.php @@ -150,7 +150,11 @@ function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, { $data = query_page_info($url, $photo, $keywords, $keyword_blacklist); - $text = add_page_info_data($data, $no_photos); + $text = ''; + + if (is_array($data)) { + $text = add_page_info_data($data, $no_photos); + } return $text; } -- 2.39.5