another case for bug 1759194

This commit is contained in:
Marc Delisle
2007-11-21 13:58:40 +00:00
parent 498fb10cd5
commit cbbb4acf85

View File

@@ -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;
}
}