Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lib/widget/opWidgetFormRichTextarea.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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));
}
}