BUG 6778 Validation of the plugins when need the Plugin Enterprise
This commit is contained in:
@@ -80,7 +80,13 @@ try {
|
|||||||
unset($oClass);
|
unset($oClass);
|
||||||
}
|
}
|
||||||
$res = $tar->extract ( $path );
|
$res = $tar->extract ( $path );
|
||||||
|
|
||||||
|
|
||||||
$sContent = file_get_contents($path . $pluginFile);
|
$sContent = file_get_contents($path . $pluginFile);
|
||||||
|
$chain = preg_quote('extends enterprisePlugin');
|
||||||
|
if(strpos($sContent,$chain)){
|
||||||
|
throw ( new Exception ('The plugin '.$filename.' is a Enterprise Edition Plugin, please install the Enterprise Plugins Manager to use this plugin.'));
|
||||||
|
}
|
||||||
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
|
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
|
||||||
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent);
|
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent);
|
||||||
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\(\);/i", null, $sContent);
|
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\(\);/i", null, $sContent);
|
||||||
@@ -88,6 +94,7 @@ try {
|
|||||||
|
|
||||||
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
|
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
|
||||||
file_put_contents($path . $pluginFile, $sContent);
|
file_put_contents($path . $pluginFile, $sContent);
|
||||||
|
|
||||||
$sAux = $sAux . '_';
|
$sAux = $sAux . '_';
|
||||||
|
|
||||||
include ($path . $pluginFile);
|
include ($path . $pluginFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user