From 54ec6445c6e782732c7b00adcfa82320463c3112 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 9 Apr 2012 12:43:40 -0400 Subject: [PATCH] CC-3606: System->Media Folders-> system seems to search -fixed. Need to check if directory actually exists. --- .../controllers/PreferenceController.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 99d556807..417009b0f 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -260,16 +260,18 @@ class PreferenceController extends Zend_Controller_Action else { $path = $path.'/'; - $handle = opendir($path); - while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != "..") { - //only show directories that aren't private. - if (is_dir($path.$file) && substr($file, 0, 1) != ".") { - $element = array(); - $element["name"] = $file; - $element["isFolder"] = true; - $element["isError"] = false; - $result[$file] = $element; + $handle = opendir($path); + if ($handle !== false){ + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + //only show directories that aren't private. + if (is_dir($path.$file) && substr($file, 0, 1) != ".") { + $element = array(); + $element["name"] = $file; + $element["isFolder"] = true; + $element["isError"] = false; + $result[$file] = $element; + } } } }