Merge branch '3.1' into 4.0

This commit is contained in:
Robbie Averill 2018-02-21 13:59:15 +13:00
commit 89e8c8be50

View File

@ -370,7 +370,9 @@ class UserDefinedForm_Controller extends Page_Controller {
if($this->Content && $form = $this->Form()) { if($this->Content && $form = $this->Form()) {
$hasLocation = stristr($this->Content, '$UserDefinedForm'); $hasLocation = stristr($this->Content, '$UserDefinedForm');
if($hasLocation) { if($hasLocation) {
$content = preg_replace('/(<p[^>]*>)?\\$UserDefinedForm(<\\/p>)?/i', $form->forTemplate(), $this->Content); /** @see Requirements_Backend::escapeReplacement */
$formEscapedForRegex = addcslashes($form->forTemplate(), '\\$');
$content = preg_replace('/(<p[^>]*>)?\\$UserDefinedForm(<\\/p>)?/i', $formEscapedForRegex, $this->Content);
return array( return array(
'Content' => DBField::create_field('HTMLText', $content), 'Content' => DBField::create_field('HTMLText', $content),
'Form' => "" 'Form' => ""