N°954: don't use the same (re)naming scheme, or risk a "cannot redeclare class" error.

SVN:trunk[4842]
This commit is contained in:
Denis Flaven
2017-07-20 13:32:46 +00:00
parent 03661158f1
commit 6f499dd36e

View File

@@ -322,7 +322,8 @@ class iTopExtensionsMap
{
// rename any class declaration inside the code to prevent a "duplicate class" declaration
// and change its parent class as well so that nobody will find it and try to execute it
$sModuleFileContents = str_replace($sClassName.' extends '.$aMatches[2][$idx], $sClassName.'_'.($iDummyClassIndex++).' extends DummyHandler', $sModuleFileContents);
// Note: don't use the same naming scheme as ModuleDiscovery otherwise you 'll have the duplicate class error again !!
$sModuleFileContents = str_replace($sClassName.' extends '.$aMatches[2][$idx], $sClassName.'_Ext_'.($iDummyClassIndex++).' extends DummyHandler', $sModuleFileContents);
}
$idx++;
}