list_files does not work correctly if not extension is given.
authorstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 30 Sep 2006 09:25:09 +0000 (09:25 +0000)
committerstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 30 Sep 2006 09:25:09 +0000 (09:25 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11782 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/global.php

index dfcc3a8..a5259ce 100644 (file)
@@ -469,10 +469,9 @@ function list_files($directory_path, $extension='', $return_filenames_only=TRUE)
         return $files;
     }
 
-
     // parse through the files
     //
-    $extension = '.' . trim($extension, '.');
+    $extension = empty($extension) ? '' : '.' . trim($extension, '.');
     while (($file = readdir($DIR)) !== false) {
 
         if ($file == '.' || $file == '..') continue;
@@ -487,7 +486,6 @@ function list_files($directory_path, $extension='', $return_filenames_only=TRUE)
     }
     closedir($DIR);
 
-
     return $files;
 
 }