diff --git a/application/controllers/admin/database.php b/application/controllers/admin/database.php index eff10a14dd4..25a9a959f98 100644 --- a/application/controllers/admin/database.php +++ b/application/controllers/admin/database.php @@ -910,29 +910,12 @@ function index($sa = null) $url = Yii::app()->request->getPost('url_'.$langname); if ($url == 'http://') {$url="";} - // Clean XSS attacks - if ($xssfilter) - { - $purifier = new CHtmlPurifier(); - $purifier->options = array( - 'HTML.Allowed' => 'p,a[href],b,i' - ); - $short_title=$purifier->purify(Yii::app()->request->getPost('short_title_'.$langname)); - $description=$purifier->purify(Yii::app()->request->getPost('description_'.$langname)); - $welcome=$purifier->purify(Yii::app()->request->getPost('welcome_'.$langname)); - $endtext=$purifier->purify(Yii::app()->request->getPost('endtext_'.$langname)); - $sURLDescription=$purifier->purify(Yii::app()->request->getPost('urldescrip_'.$langname)); - $sURL = html_entity_decode($purifier->purify(Yii::app()->request->getPost('url_'.$langname)),null,'UTF-8'); - } - else - { - $short_title = html_entity_decode(Yii::app()->request->getPost('short_title_'.$langname), ENT_QUOTES, "UTF-8"); - $description = html_entity_decode(Yii::app()->request->getPost('description_'.$langname), ENT_QUOTES, "UTF-8"); - $welcome = html_entity_decode(Yii::app()->request->getPost('welcome_'.$langname), ENT_QUOTES, "UTF-8"); - $endtext = html_entity_decode(Yii::app()->request->getPost('endtext_'.$langname), ENT_QUOTES, "UTF-8"); - $sURLDescription = html_entity_decode(Yii::app()->request->getPost('urldescrip_'.$langname), ENT_QUOTES, "UTF-8"); - $sURL = html_entity_decode(Yii::app()->request->getPost('url_'.$langname), ENT_QUOTES, "UTF-8"); - } + $short_title = html_entity_decode(Yii::app()->request->getPost('short_title_'.$langname), ENT_QUOTES, "UTF-8"); + $description = html_entity_decode(Yii::app()->request->getPost('description_'.$langname), ENT_QUOTES, "UTF-8"); + $welcome = html_entity_decode(Yii::app()->request->getPost('welcome_'.$langname), ENT_QUOTES, "UTF-8"); + $endtext = html_entity_decode(Yii::app()->request->getPost('endtext_'.$langname), ENT_QUOTES, "UTF-8"); + $sURLDescription = html_entity_decode(Yii::app()->request->getPost('urldescrip_'.$langname), ENT_QUOTES, "UTF-8"); + $sURL = html_entity_decode(Yii::app()->request->getPost('url_'.$langname), ENT_QUOTES, "UTF-8"); // Fix bug with FCKEditor saving strange BR types $short_title = Yii::app()->request->getPost('short_title_'.$langname); diff --git a/application/core/LSYii_Validators.php b/application/core/LSYii_Validators.php index deb2161e05d..bbce0896f9a 100644 --- a/application/core/LSYii_Validators.php +++ b/application/core/LSYii_Validators.php @@ -39,6 +39,7 @@ protected function validateAttribute($object,$attribute) if($this->isUrl) { if ($object->$attribute== 'http://' || $object->$attribute=='https://') {$object->$attribute="";} + $object->$attribute=html_entity_decode($object->$attribute, ENT_QUOTES, "UTF-8"); } } @@ -53,7 +54,8 @@ public function xssFilter($value) $filter->options = array('URI.AllowedSchemes'=>array( 'http' => true, 'https' => true, - )); + ), + 'HTML.Allowed' => 'p,a[href],b,i'); return $filter->purify($value); } }