wiki.techinc.nl/tests/phpunit/unit/includes/GlobalFunctions
C. Scott Ananian 3fc635dcb2 wfEscapeWikiText: protect string against wikitext tokens formed at edges
The result of wfEscapeWikiText() did not consider inclusion of a string
within table context, and so `!!` and `!` at start of line were not
previously escaped.

Additionally, if you are inserting the result of wfEscapeWikiText()
into a wikitext string, the result can inadventently form new tokens
at the left and right edges.  For example:

   {|
   |<escaped string>

When the escaped string starts with a `-` or `+` it forms the `|-` or `|+`
token and changes the parse.

On the right side:

  <escaped string>_FORCETOC__

is not a magic word unless the escaped string ends with a `_`.

Token-gluing can also occur with the double newline token denoting
a paragraph separator.

This patch adds additional cases to wfEscapeWikiText to armor
its output against all contexts in which the output may be
inserted.

Depends-On: I56147520620d56a4b98c2f22d1f469b49aed761f
Change-Id: I34f2fa8c329e6f6771453b2f94dc4afbec31dac8
2024-01-26 17:48:46 -05:00
..
WfAppendQueryTest.php
WfArrayPlus2dTest.php
WfAssembleUrlTest.php
WfBaseNameTest.php
WfEscapeShellArgTest.php
WfEscapeWikiTextTest.php
WfGetCallerTest.php
WfRemoveDotSegmentsTest.php
WfShorthandToIntegerTest.php
WfStringToBoolTest.php
WfTimestampTest.php
WfUrlencodeTest.php