bug #2022182 [import, export] Import/Export fails because of Mac files

This commit is contained in:
Marc Delisle
2008-07-23 16:55:33 +00:00
parent aa199885cf
commit 37b3fbb8e3
2 changed files with 6 additions and 1 deletions

View File

@@ -27,7 +27,11 @@ function PMA_getPlugins($plugins_dir, $plugin_param)
if ($handle = @opendir($plugins_dir)) {
$is_first = 0;
while ($file = @readdir($handle)) {
if (is_file($plugins_dir . $file) && eregi('\.php$', $file)) {
// In some situations, Mac OS creates a new file for each file
// (for example ._csv.php) so the following regexp
// matches a file which does not start with a dot but ends
// with ".php"
if (is_file($plugins_dir . $file) && preg_match('@^[^\.](.)*\.php$@i', $file)) {
include $plugins_dir . $file;
}
}