Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #N
Problem/Motivation
After #2099741: Protect WYSIWYG Editors from XSS Without Destroying User Data was committed it seems the Drupal\editor\Tests\EditorXssFilter\StandardTest unit test class does not run, and therefore does not expose the failing test assertion from the data provider.
Steps to reproduce: `cd path/to/site/core`, `phpunit` - You should see one failure.
Also, try to run this test from either the UI or run-tests.sh - Class not found.
Proposed resolution
Fix the broken namespace in the file, fix the test failure.
Remaining tasks
Fix the failure
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#1 | 2192895.patch | 730 bytes | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedThis should expose the test failure by running the test.
Comment #2
damiankloip CreditAttribution: damiankloip commentedSo based on info I have just heard from Wim.
Comment #3
Wim LeersGreat catch! Manually tested the patch, this indeed fixes not being able to run the test from the UI.
The test failure you're mentioning only happens on PHP 5.4, so let's fix that in another issue: #2192997: Drupal\editor\Tests\EditorXssFilter\StandardTest has one failure on PHP 5.4.
Comment #4
dawehnerNote: we should comment out the php 5.4 failure for now, see #2193023: EditorXssFilter/StandardTest::dataset #25 fails on php 5.4 ...
Comment #5
Wim Leers#4: Thanks!
Comment #6
damiankloip CreditAttribution: damiankloip commentedOK, so let's fix it so we get the test here and worry about that there. So do we know what the actual source of the failure is?
Comment #7
Wim Leers#6 Yes: #1210798: In PHP 5.4+, html_entity_decode() doesn't decode invalid numeric entities (via #2193023-2: EditorXssFilter/StandardTest::dataset #25 fails on php 5.4).
Comment #8
damiankloip CreditAttribution: damiankloip commentedOk, great. Now we just need this so it actually runs properly :)
Comment #9
catchCommitted/pushed to 8.x, thanks!