From 4c2b098c57ee956de524a83c091d2d5ef7b3916c Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 6 Aug 2016 21:28:43 +0200 Subject: [PATCH] Fix error message in the logs due to include When include is not passed to `artists` or `albums` API function, it will default to `NULL`. Make it default to `[]` to avoid a message in the error log. --- lib/class/xml_data.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/class/xml_data.class.php b/lib/class/xml_data.class.php index 7c31f807..b35e09ee 100644 --- a/lib/class/xml_data.class.php +++ b/lib/class/xml_data.class.php @@ -300,6 +300,9 @@ class XML_Data */ public static function artists($artists, $include=[], $full_xml=true) { + if (null == $include) { + $include = array(); + } $string = '' . count($artists) . '\n'; if (count($artists) > self::$limit or self::$offset > 0) { @@ -365,6 +368,9 @@ class XML_Data */ public static function albums($albums, $include=[], $full_xml=true) { + if (null == $include) { + $include = array(); + } $string = '' . count($albums) . '\n'; if (count($albums) > self::$limit or self::$offset > 0) {