Updated: Comment #0
Problem/Motivation
- First and foremost: this is necessary to make PHPUnit tests not fragile, because all procedural functions have to be mocked.
- Also: Drupal generally wants to move functionality related to objects onto the objects and not keep them in procedural wrappers in .module files.
Proposed resolution
Move filter_get_filter_types_by_format()
and filter_get_html_restrictions_by_format()
onto FilterFormatInterface
. This blocks the critical #2099741: Protect WYSIWYG Editors from XSS Without Destroying User Data issue (hence this is major), whose latest patch is adding unit tests that would otherwise need these functions to be mocked.
Remaining tasks
None.
User interface changes
None.
API changes
Moving around of these two public API functions, they were added in D8, and are only useful for highly specialized code, so this won't affect anybody. Also: apparently a change notice for these two additions was never written (probably because they were added as part of much larger patches), so there aren't change notices to be updated, only one to be written.
Comment | File | Size | Author |
---|---|---|---|
#3 | filter_functions_to_filterformatinterface-2184315-2.patch | 25.25 KB | Wim Leers |
Comments
Comment #1
Wim LeersComment #3
Wim LeersComment #4
Gábor HojtsyMakes total sense to not have the code in global functions but on the domain object. Looks good :)
Comment #5
Wim LeersBumping to critical because this is blocking a critical: #2099741: Protect WYSIWYG Editors from XSS Without Destroying User Data.
Comment #6
alexpottCommitted 81e3e03 and pushed to 8.x. Thanks!
Comment #7
Wim LeersBecause didn't have the change notice issue tag, I didn't notice this one needed a change notice still — sorry :(
Existing change notice updated: https://drupal.org/node/1817474.
Comment #9
Wim Leers