Merge pull request #1184 from creative-commoners/pulls/5/htmlvalue

FIX Use HTMLValue::class
This commit is contained in:
Maxime Rainville 2023-01-18 11:32:11 +13:00 committed by GitHub
commit db55d68248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\CompositeField;
use SilverStripe\Forms\LiteralField;
use SilverStripe\UserForms\Model\EditableFormField;
use SilverStripe\View\Parsers\HTMLValue;
/**
* Editable Literal Field. A literal field is just a blank slate where
@ -83,7 +84,7 @@ class EditableLiteralField extends EditableFormField
}
// Perform sanitisation
$htmlValue = Injector::inst()->create('HTMLValue', $content);
$htmlValue = Injector::inst()->create(HTMLValue::class, $content);
$santiser = Injector::inst()->create(HTMLEditorSanitiser::class, $this->getEditorConfig());
$santiser->sanitise($htmlValue);
return $htmlValue->getContent();