diff --git a/src/ORM/DataObject.php b/src/ORM/DataObject.php index 96b93e289..e17cbff4a 100644 --- a/src/ORM/DataObject.php +++ b/src/ORM/DataObject.php @@ -2512,7 +2512,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity $list = DataList::create(static::class); $threshold = DBForeignKey::config()->get('dropdown_field_threshold'); $overThreshold = $list->count() > $threshold; - $field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $labelField) + $field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $ownerRecord->{$relationName . 'ID'}, $labelField) ->setIsLazyLoaded($overThreshold) ->setLazyLoadLimit($threshold); return $field; diff --git a/src/View/Parsers/HTMLValue.php b/src/View/Parsers/HTMLValue.php index ee44ec142..76b5ebc17 100644 --- a/src/View/Parsers/HTMLValue.php +++ b/src/View/Parsers/HTMLValue.php @@ -32,7 +32,7 @@ class HTMLValue extends ViewableData */ public function setContent($content) { - $content = preg_replace('#?(html|head|body)[^>]*>#si', '', $content); + $content = preg_replace('#?(html|head(?!er)|body)[^>]*>#si', '', $content); $html5 = new HTML5(['disable_html_ns' => true]); $document = $html5->loadHTML( '
' . diff --git a/tests/php/Forms/HTMLEditor/HTMLEditorFieldTest.php b/tests/php/Forms/HTMLEditor/HTMLEditorFieldTest.php index 1a0196e60..f17b1fe12 100644 --- a/tests/php/Forms/HTMLEditor/HTMLEditorFieldTest.php +++ b/tests/php/Forms/HTMLEditor/HTMLEditorFieldTest.php @@ -182,7 +182,9 @@ class HTMLEditorFieldTest extends FunctionalTest $this->assertEquals( <<blahblah
blahblah
blahblah
blahblah
blahblah
blahblah