Commit f509face authored by Chenu Denis's avatar Chenu Denis

[feature] Auto fix message (disable broken html, don't disable script)

parent 03b15251
......@@ -6,7 +6,7 @@
* @copyright 2017-2019 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 1.3.0
* @version 1.3.1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
......@@ -267,6 +267,9 @@ class maintenanceMode extends PluginBase {
} elseif(date($settings['timeForDelay'])) {
$settings['timeForDelay']=$settings['timeForDelay'];
$settings['timeForDelayInMinute']= 0;
} else {
Yii::app()->setFlashMessage($this->gT("Bad delay, you must review the time for delay."),'error');
$settings['timeForDelay']="";
}
}
if(!empty($settings['urlRedirect'])){
......@@ -275,6 +278,14 @@ class maintenanceMode extends PluginBase {
Yii::app()->setFlashMessage($this->gT("Bad url, you must review the redirect url."),'error');
}
}
if(!empty($settings['warningToShow'])) {
$oPurifier = new CHtmlPurifier();
$settings['warningToShow'] = $oPurifier->purify($settings['warningToShow']);
}
if(!empty($settings['messageToShow'])) {
$oPurifier = new CHtmlPurifier();
$settings['messageToShow'] = $oPurifier->purify($settings['messageToShow']);
}
parent::saveSettings($settings);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment