diff --git a/libraries/file_listing.php b/libraries/file_listing.php index 46028f5ae..017aed6b8 100644 --- a/libraries/file_listing.php +++ b/libraries/file_listing.php @@ -11,7 +11,7 @@ * Returns array of filtered file names * * @param string directory to list - * @param string regullar expression to match files + * @param string regular expression to match files * @returns array sorted file list on success, FALSE on failure */ function PMA_getDirContent($dir, $expression = '') @@ -23,8 +23,8 @@ function PMA_getDirContent($dir, $expression = '') } while ($file = @readdir($handle)) { // for PHP < 5.2.4, is_file() gives a warning when using open_basedir - // and opening '..' - if ('..' != $file && is_file($dir . $file) && ($expression == '' || preg_match($expression, $file))) { + // and verifying '..' or '.' + if ('.' != $file && '..' != $file && is_file($dir . $file) && ($expression == '' || preg_match($expression, $file))) { $result[] = $file; } }