From b8b542e45c59a585d8af4b66c51fbd69cdf4ba7b Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 18 Nov 2007 14:18:00 +0000 Subject: [PATCH] bug #1759194 [import] open_basedir warning --- ChangeLog | 1 + libraries/file_listing.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 32eb0ec588..b2020a3ae6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA keys and AUTO_INCREMENT - [display] Division by zero when showing all records (page selector) - bug #1828265 [privileges] No weird characters in generated password +- bug #1759194 [import] open_basedir warning 2.11.2.1 (2007-11-11) - fixed possible SQL injection using database name diff --git a/libraries/file_listing.php b/libraries/file_listing.php index 5a71dd0c42..94ad113216 100644 --- a/libraries/file_listing.php +++ b/libraries/file_listing.php @@ -21,7 +21,9 @@ function PMA_getDirContent($dir, $expression = '') $dir .= '/'; } while ($file = @readdir($handle)) { - if (is_file($dir . $file) && ($expression == '' || preg_match($expression, $file))) { + // 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))) { $result[] = $file; } } -- 2.11.4.GIT