diff --git a/3rdparty/getid3/module.audio.mp3.php b/3rdparty/getid3/module.audio.mp3.php index cba36193..6dc0f45b 100755 --- a/3rdparty/getid3/module.audio.mp3.php +++ b/3rdparty/getid3/module.audio.mp3.php @@ -923,6 +923,7 @@ public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $S // $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'; // } } else { + if (! is_array($info['warning'])) $info['warning'] = array(); $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'; } } diff --git a/controller/categorycontroller.php b/controller/categorycontroller.php index d0b830c9..707991ad 100644 --- a/controller/categorycontroller.php +++ b/controller/categorycontroller.php @@ -61,7 +61,7 @@ public function getCategory(){ $playlists= $this->getCategoryforUser($category); if(is_array($playlists)){ - $aPlayLists=''; + $aPlayLists= array(); foreach($playlists as $playinfo){ $aPlayLists[]=['info' => $playinfo, 'songids' => $this->getSongIdsForCategory($category,$playinfo['id'])]; } @@ -127,7 +127,7 @@ private function getCategoryforUser($category){ $stmt =$this->db->prepareQuery($SQL); $result = $stmt->execute(array($this->userId)); - $aPlaylists=''; + $aPlaylists=array(); while( $row = $result->fetchRow()) { $bg = $this->genColorCodeFromText(trim($row['name']),40,8); $row['backgroundColor']=$bg; @@ -135,10 +135,10 @@ private function getCategoryforUser($category){ $aPlaylists[]=$row; } - if(is_array($aPlaylists)){ - return $aPlaylists; - }else{ + if(empty($aPlaylists)){ return false; + }else{ + return $aPlaylists; } } diff --git a/controller/musiccontroller.php b/controller/musiccontroller.php index b9ed9084..701eecdd 100755 --- a/controller/musiccontroller.php +++ b/controller/musiccontroller.php @@ -253,7 +253,7 @@ public function loadSongs(){ $stmt = $this->db->prepareQuery($SQL); $result = $stmt->execute(array($this->userId)); - $aSongs=''; + $aSongs=array(); while( $row = $result->fetchRow()) { $file_not_found = false; @@ -275,10 +275,10 @@ public function loadSongs(){ $this->deleteFromDB($row['id'],$row['album_id'],$row['artist_id'],$row['file_id']); } } - if(is_array($aSongs)){ - return $aSongs; - }else{ + if(empty($aSongs)){ return false; + }else{ + return $aSongs; } }