wiki.techinc.nl/tests/parser
C. Scott Ananian 94f193a894 SECURITY: Ensure emitted HTML is safe against Unicode NFC normalization
CVE-2025-32699

Ensure that Unicode NFC normalization can be applied to our HTML
output safely.  Even though the W3C officially recommends against
normalizing HTML

https://www.w3.org/International/questions/qa-html-css-normalization#converting

this is still easily done inadvertently, especially when using the
MediaWiki action API which normalizes parameters and results by
default.

See also I671648603c4635a35585c860b4857f5ea085e47f in Parsoid, and
T266140 / I2e78e660ba1867744e34eda7d00ea527ec016b71 for another similar
issue.

The following changes are made:

* The various HTML serializers (Remex/Tidy-derived, as well as the
  Html::* helpers) are tweaked to entity-escape U+0338 wherever it
  appears.

* Similarly, Message::escaped() is tweaked to entity-escape U+0338.

* Finally, a post-processing pass is added to the OutputTransform
  pipeline to catch any remaining U+0338 and entity-escape them.
  This catches U+0338 added during any of the previous OutputTransform
  stages (like TOC insertion, section edit links, etc).
  *When backporting* this code will likely need to be moved to
  ParserOutput::getText(), as the OutputTransform pipeline wasn't added
  until MW 1.42.

Bug: T387130
Change-Id: I66564e14e730f5393f4fa5780b80f24de6075af5
2025-04-10 15:56:06 +01:00
..
AnsiTermColorer.php
badCharacters.txt SECURITY: Ensure emitted HTML is safe against Unicode NFC normalization 2025-04-10 15:56:06 +01:00
comments.txt
DbTestPreviewer.php Use expression builder to avoid IDatabase::addQuotes 2024-07-18 18:44:34 +00:00
DbTestRecorder.php Pass function name to IDatabase functions 2024-09-19 21:02:52 +02:00
definitionLists.txt
DjVuSupport.php
DummyTermColorer.php
editTests.php Add namespace to maintenance/includes classes 2024-10-09 11:02:09 -04:00
extLinks.txt Parser tests: add additional options to test ParserOutput metadata 2024-09-13 14:42:27 -04:00
fuzzTest.php tests: Use namespaced ParserOptions 2024-10-16 01:35:06 +01:00
headings.txt Sync up core repo with Parsoid 2024-09-12 18:58:43 +03:00
indentPre.txt
indicators.txt Sync up core repo with Parsoid 2024-09-12 18:58:43 +03:00
interlanguageLinks.txt Sync up core repo with Parsoid 2024-09-24 12:36:03 -04:00
interwikiLinks.txt Parser tests: add additional options to test ParserOutput metadata 2024-09-13 14:42:27 -04:00
langParserTests.txt Sync up core repo with Parsoid 2024-09-12 18:58:43 +03:00
legacyHeadings.txt Sync up core repo with Parsoid 2024-09-12 18:58:43 +03:00
legacyMedia.txt Merge "Allow localized gallery widths; avoid spurious "double px" tracking category" 2024-10-02 21:39:40 +00:00
magicLinks.txt Sync up core repo with Parsoid 2024-09-26 13:04:36 -04:00
magicWords.txt parser: Add a new {{USERLANGUAGE}} magic word for use in wikitext 2024-09-07 19:16:32 +00:00
media.txt Merge "Allow localized gallery widths; avoid spurious "double px" tracking category" 2024-10-02 21:39:40 +00:00
MultiTestRecorder.php
ParserTestMockParser.php tests: Use namespaced ParserOptions 2024-10-16 01:35:06 +01:00
ParserTestParserHook.php
ParserTestPrinter.php
ParserTestResult.php
ParserTestResultNormalizer.php
ParserTestRunner.php PaserTestRunner: Avoid json_decode deprecation warning 2024-12-26 23:49:11 +00:00
parserTests.php Add namespace to maintenance/includes classes 2024-10-09 11:02:09 -04:00
parserTests.txt Use a better bidi aware markup in CommentParser 2024-10-04 10:50:02 +03:30
pfeqParserTests.txt
PhpunitTestRecorder.php
preprocessor.txt Move section edit links outside headings (new heading HTML) 2024-05-06 12:25:33 -04:00
preTags.txt
pst.txt
pWrapping.txt
quotes.txt
README
redirects.txt
tables.txt Sync up core repo with Parsoid 2024-09-12 18:58:43 +03:00
TestFileEditor.php
TestRecorder.php
wtEscaping.txt Update expected test output after i18n change 2024-07-10 11:38:39 +02:00

Parser tests can be run either via PHPUnit or by using the standalone
parserTests.php in this directory. The standalone version provides more
options.

To run parser tests via PHPUnit:

 $ composer phpunit -- --testsuite parsertests

You can optionally filter by title using --filter, e.g.

 composer phpunit -- --testsuite parsertests --filter="T6400"