From e75a38a0076a520166b26bb9fa23be646f3fb144 Mon Sep 17 00:00:00 2001 From: SeregaPru Date: Fri, 12 Sep 2014 09:46:30 +0400 Subject: [PATCH] 1) bug fix: in createDIDL sometimes comes single item, not array. But array is expected. And method crashes. Fix: detect if single item is come and convert it to array 2) fix bug with " 0) && (!is_array($prmItems[0])) ) { + $prmItems = array($prmItems); + } + # Add each item in $prmItems array to $ndDIDL: foreach ($prmItems as $item) { + if (!is_array($item)) { + debug_event('upnp_class', 'item is not array', 2); + debug_event('upnp_class', $item, '5'); + continue; + } + if ($item['upnp:class'] == 'object.container') { $ndItem = $xmlDoc->createElement('container'); } else { diff --git a/upnp/MediaServerServiceDesc.php b/upnp/MediaServerServiceDesc.php index 50e811fa..abd8dde3 100644 --- a/upnp/MediaServerServiceDesc.php +++ b/upnp/MediaServerServiceDesc.php @@ -8,9 +8,10 @@ if (!AmpConfig::get('upnp_backend')) { } header ("Content-Type:text/xml"); -$web_path = AmpConfig::get('raw_web_path'); +$web_path = AmpConfig::get('local_web_path'); + +echo ''; ?> - 1 diff --git a/upnp/index.php b/upnp/index.php index bdc98ffd..19675955 100644 --- a/upnp/index.php +++ b/upnp/index.php @@ -1,7 +1,25 @@ + +'; + } +?> Ampache UPnP