diff --git a/lib/widget/opWidgetFormRichTextarea.class.php b/lib/widget/opWidgetFormRichTextarea.class.php index 8981eee86..a93520721 100644 --- a/lib/widget/opWidgetFormRichTextarea.class.php +++ b/lib/widget/opWidgetFormRichTextarea.class.php @@ -64,6 +64,16 @@ protected function getId($name, $attributes) return $tmpAttributes['id']; } + /** + * not call the fixDoubleEscape() to not convert the HTML special characters that set in the entity reference + * + * @see sfWidget::escapeOnce() + */ + static public function escapeOnce($value) + { + return htmlspecialchars((string) $value, ENT_QUOTES, self::getCharset()); + } + public function render($name, $value = null, $attributes = array(), $errors = array()) { if (sfConfig::get('sf_app') == 'mobile_frontend') @@ -142,7 +152,17 @@ function op_toggle_mce_editor(id) sfContext::getInstance()->getI18N()->__('Preview Mode') ); } - return $toggle.sprintf($this->getOption('textarea_template'), parent::render($name, $value, $attributes, $errors)).$js; + + return $toggle.sprintf($this->getOption('textarea_template'), $this->renderTextarea($name, $value, $attributes, $errors)).$js; + } + + /** + * + * @see sfWidgetFormTextarea::render() + */ + protected function renderTextarea($name, $value = null, $attributes = array(), $errors = array()) + { + return $this->renderContentTag('textarea', self::escapeOnce($value), array_merge(array('name' => $name), $attributes)); } }