diff --git a/application/commands/PluginCommand.php b/application/commands/PluginCommand.php index 276a3f987e7..50109d0c41e 100644 --- a/application/commands/PluginCommand.php +++ b/application/commands/PluginCommand.php @@ -17,14 +17,11 @@ class PluginCommand extends CConsoleCommand public function actionCron($interval) { - $pm = \Yii::app()->pluginManager; $event = new PluginEvent('cron'); $event->set('interval', $interval); $pm->dispatchEvent($event); - - } } -?> \ No newline at end of file +?> diff --git a/application/commands/console.php b/application/commands/console.php index b26a05367ad..a07f65e2fdc 100644 --- a/application/commands/console.php +++ b/application/commands/console.php @@ -36,7 +36,12 @@ } unset ($config['defaultController']); unset ($config['config']); - $config['runtimePath']=$settings['tempdir'].'/runtime'; + /* fix runtime path, unsure you can lauch function anywhere (if you use php /var/www/limesurvey/... : can be /root/ for config */ + $runtimePath=$settings['tempdir'].'/runtime'; + if(!is_dir($runtimePath) || !is_writable($runtimePath)){ + $runtimePath=str_replace($settings['rootdir'],dirname(dirname(dirname(__FILE__))),$runtimePath); + } + $config['runtimePath']=$runtimePath; // fix for fcgi defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); diff --git a/application/controllers/admin/templates.php b/application/controllers/admin/templates.php index 6611fc8b8fb..4a31697372c 100644 --- a/application/controllers/admin/templates.php +++ b/application/controllers/admin/templates.php @@ -79,12 +79,9 @@ public function templatezip($templatename) */ public function tmp($id) { - $id = (int) $id; - $iTime= preg_replace("/[^0-9]$/", '', $id); + $iTime = $id = CHtml::encode($id); $sFile = Yii::app()->getConfig("tempdir").DIRECTORY_SEPARATOR."template_temp_{$iTime}.html"; - $id = CHtml::encode($id); - if(!is_file($sFile) || !file_exists($sFile)) { die("Found no file with id " . $id); }