1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 01:39:28 +02:00

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.
This commit is contained in:
Phyks (Lucas Verney) 2016-08-06 21:28:43 +02:00
parent 2053264888
commit 4c2b098c57

View file

@ -300,6 +300,9 @@ class XML_Data
*/ */
public static function artists($artists, $include=[], $full_xml=true) public static function artists($artists, $include=[], $full_xml=true)
{ {
if (null == $include) {
$include = array();
}
$string = '<total_count>' . count($artists) . '</total_count>\n'; $string = '<total_count>' . count($artists) . '</total_count>\n';
if (count($artists) > self::$limit or self::$offset > 0) { 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) public static function albums($albums, $include=[], $full_xml=true)
{ {
if (null == $include) {
$include = array();
}
$string = '<total_count>' . count($albums) . '</total_count>\n'; $string = '<total_count>' . count($albums) . '</total_count>\n';
if (count($albums) > self::$limit or self::$offset > 0) { if (count($albums) > self::$limit or self::$offset > 0) {