Prevent addons from overwriting important variables with nonsense

This commit is contained in:
Kijin Sung 2016-02-10 16:34:55 +09:00
parent 8f9011a235
commit 82da535ec6
2 changed files with 25 additions and 7 deletions

View file

@ -60,12 +60,17 @@ class DisplayHandler extends Handler
// call a trigger before display
ModuleHandler::triggerCall('display', 'before', $output);
$original_output = $output;
// execute add-on
$called_position = 'before_display_content';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
if(file_exists($addon_file)) include($addon_file);
if($output === false || $output === null)
{
$output = $original_output;
}
if(method_exists($handler, "prepareToPrint"))
{