Resolve #3571237 "Refactor drupaleditorelementfilterxss"

Closes #3571237

  1. Made EditorXssFilterInterface::filterXss() non-static - The interface method is now an instance method, allowing the filter to be used as a proper service.
  2. Registered EditorXssFilter\Standard as a service (editor.xss_filter) - Modules can now swap the XSS filter by overriding this service in their services.yml instead of using the alter hook.
  3. Moved filtering logic from editor_filter_xss() to Element::filterXss() - The Element service now handles the XSS filtering decision logic and delegates to the injected EditorXssFilterInterface service.
  4. Removed editor_filter_xss() function - The procedural function is no longer needed.
  5. Removed hook_editor_xss_filter_alter - The hook is replaced by service decoration/overriding.
  6. Updated EditorController - Now injects the Element service instead of calling the removed function.
  7. Updated tests - StandardTest and FilterKernelTest now instantiate the filter class instead of calling static methods.
Edited by Ben Ling

Merge request reports

Loading