Commit graph

5 commits

Author SHA1 Message Date
James D. Forrester
846f4f58f5 Remove $wgExperimentalHtmlIds and related code, deprecated in 1.30
Bug: T139744
Change-Id: Ia15d5ab6e7637fd40d5c3399822a3dbeb7b383b5
2018-05-01 14:34:02 -07:00
Kunal Mehta
2ab7ae9d24 Add @covers for RemexStripTagHandler
This internal class is only used by Sanitizer::stripAllTags().

Change-Id: Ib913ee14524539216305da7e3183c07ab7d72cb5
2018-02-05 21:15:52 -08:00
Kunal Mehta
546980e537 Add @covers tags to parser tests
Change-Id: I7bce04bef5e981fd203ad819882482e72ca3f61b
2017-12-24 23:29:00 -08:00
Roan Kattouw
ddb4913f53 Use Remex in Sanitizer::stripAllTags()
Using a real HTML tokenizer fixes bugs when < or > appear in attribute
values. The old implementation used delimiterReplace(), which didn't
handle this case:

    > print Sanitizer::stripAllTags( '<p data-foo="a&lt;b>c">Hello</p>' );
    c">Hello

We also can't use PHP's built-in strip_tags() because it doesn't handle
<?php and <? correctly:

    > print strip_tags('1<span class="<?php">2</span>3');
    1
    > print strip_tags('1<span class="<?">2</span>3');
    1

Bug: T179978
Change-Id: I53b98e6c877c00c03ff110914168b398559c9c3e
2017-11-15 17:31:31 -08:00
Roan Kattouw
7980e38a84 Move Sanitizer.php to includes/parser/
Change-Id: Id08d91c747ec77d715459b89b03eee247ccd4e1b
2017-11-15 15:16:41 -08:00
Renamed from tests/phpunit/includes/SanitizerTest.php (Browse further)