From 88f6f618ecbe146746c174660942131badc5aa39 Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Sat, 30 Sep 2006 09:25:09 +0000 Subject: [PATCH] list_files does not work correctly if not extension is given. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11782 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/functions/global.php b/functions/global.php index dfcc3a83..a5259ce7 100644 --- a/functions/global.php +++ b/functions/global.php @@ -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; } -- 2.25.1