From f3b4f7e2f92a8a9604344253e8bbfb38f4b05326 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 21 Nov 2011 09:52:14 +0000 Subject: [PATCH] only check for class.$classname.inc.php files, when scanning for plugins, as backupfiles postfixing the filename with an other extension stall EGroupware completly (Fatal Error: Can not redeclar class) --- .../inc/class.importexport_helper_functions.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/importexport/inc/class.importexport_helper_functions.inc.php b/importexport/inc/class.importexport_helper_functions.inc.php index 72788218ff..7af2a48d05 100755 --- a/importexport/inc/class.importexport_helper_functions.inc.php +++ b/importexport/inc/class.importexport_helper_functions.inc.php @@ -339,12 +339,12 @@ class importexport_helper_functions { while (false !== ($entry = $d->read())) { // Blacklisted? if(is_array(self::$blacklist_files[$appname]) && in_array($entry, self::$blacklist_files[$appname])) continue; - - list( ,$classname, ,$extension) = explode('.',$entry); + if (!preg_match('/^class\.([^.]+)\.inc\.php$/', $entry, $matches)) continue; + $classname = $matches[1]; $file = $appdir. '/'. $entry; foreach ($types as $type) { - if( !is_file($file) || strpos($entry, $type) === false || $extension != 'php' ) continue; + if( !is_file($file) || strpos($entry, $type) === false) continue; require_once($file); $reflectionClass = new ReflectionClass($classname); if($reflectionClass->IsInstantiable() &&