|
@@ -410,21 +410,21 @@ function copyDirTo($origDirPath, $destination, $move=true)
|
|
|
|
|
|
function index_dir($path)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
$save_dir = getcwd();
|
|
|
- chdir($path);
|
|
|
- $handle = opendir($path);
|
|
|
+ if(is_dir($path)){
|
|
|
+ chdir($path);
|
|
|
+ $handle = opendir($path);
|
|
|
+ }
|
|
|
|
|
|
- while ($element = readdir($handle) )
|
|
|
- {
|
|
|
- if ( $element == "." || $element == "..") continue;
|
|
|
- if ( is_dir($element) ) $dirArray[] = $path."/".$element;
|
|
|
+ if (file_exists($handle)) {
|
|
|
+ while ($element = readdir($handle) )
|
|
|
+ {
|
|
|
+ if ( $element == "." || $element == "..") continue;
|
|
|
+ if ( is_dir($element) ) $dirArray[] = $path."/".$element;
|
|
|
+ }
|
|
|
+ closedir($handle) ;
|
|
|
}
|
|
|
|
|
|
- closedir($handle) ;
|
|
|
-
|
|
|
|
|
|
$dirNumber = sizeof($dirArray);
|
|
|
if ( $dirNumber > 0 )
|