mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 19:41:55 +02:00
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 "<?xml..." parse error when php option - short tags - is set 3) upnp broadcast sending page added button for automatically periodical page refresh for sending broadcast packets without cron, for development purposes 4) Plugins class optimization, method get_plugins make static cache for optimization when multiple call
This commit is contained in:
parent
fd1d06d055
commit
e75a38a007
4 changed files with 43 additions and 17 deletions
|
@ -172,8 +172,19 @@ class Upnp_Api
|
|||
return $xmlDoc;
|
||||
}
|
||||
|
||||
# sometimes here comes only one single item, not an array. Convert it to array. (TODO - UGLY)
|
||||
if ( (count($prmItems) > 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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue