Resolve #3571237 "Refactor drupaleditorelementfilterxss"
Closes #3571237
-
Made
EditorXssFilterInterface::filterXss()non-static - The interface method is now an instance method, allowing the filter to be used as a proper service. -
Registered
EditorXssFilter\Standardas a service (editor.xss_filter) - Modules can now swap the XSS filter by overriding this service in theirservices.ymlinstead of using the alter hook. -
Moved filtering logic from
editor_filter_xss()toElement::filterXss()- TheElementservice now handles the XSS filtering decision logic and delegates to the injectedEditorXssFilterInterfaceservice. -
Removed
editor_filter_xss()function - The procedural function is no longer needed. -
Removed
hook_editor_xss_filter_alter- The hook is replaced by service decoration/overriding. -
Updated
EditorController- Now injects theElementservice instead of calling the removed function. -
Updated tests -
StandardTestandFilterKernelTestnow instantiate the filter class instead of calling static methods.
Edited by Ben Ling