Permalink
Browse files

Merge pull request #143 from D4nte/master

annoying warning
  • Loading branch information...
2 parents 77fa3df + c75594d commit b624c14822f5f3e8cf8eff08a835ac3cf1db0f37 @thibaud-rohmer committed Apr 13, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/classes/Menu.php
View
@@ -156,6 +156,11 @@ public static function list_dirs($dir,$rec=false, $hidden=false){
/// Directory content
$dir_content = scandir($dir);
+
+ if (empty($dir_content)){
+ // Directory is empty or no right to read
+ return $list;
+ }
/// Check each content
foreach ($dir_content as $content){
@@ -195,6 +200,11 @@ public static function list_files($dir,$rec = false, $hidden = false, $stopatfir
/// Directory content
$dir_content = scandir($dir);
+
+ if (empty($dir_content)){
+ // Directory is empty or no right to read
+ return $list;
+ }
/// Check each content
foreach ($dir_content as $content){

0 comments on commit b624c14

Please sign in to comment.