wiki.techinc.nl/tests/phpunit/includes/api/query
Fomafix eed3121a8f Encode & to & in displaytitle fallback
The value in the attribute displaytitle must contain valid HTML. The
sanitizer of the {{DISPLAYTITLE}} parser ensures that only valid HTML
is accepted.

If there is no {{DISPLAYTITLE}} in the wikitext then displaytitle
falls back to $title->getPrefixedText(). Here an HTML encoding of
special characters is necessary. This affects only the replacement of
& by &amp; because other special characters like < and > are not
allowed in the title.

This change affects the displaytitle fallback on the following places:
* ApiParse
* ApiQueryInfo
* InfoAction
* Parser

The displaytitle fallback in OutputPage is also updated to this
behavior although
Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $html )
also replaces & by &amp;.

Also add test cases with & in the displaytitle to:
* ApiParseTest
* ApiQueryInfoTest
* parserTests

Bug: T291985
Change-Id: I8ee1e2731d9bfa49725d663b34986e7e3073e4ca
2021-10-05 18:09:15 +00:00
..
ApiQueryAllPagesTest.php Use WikiPage::doUserEditContent() instead of ::doEditContent() 2021-06-28 00:11:30 -07:00
ApiQueryAllRevisionsTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
ApiQueryBasicTest.php
ApiQueryBlockInfoTraitTest.php
ApiQueryBlocksTest.php
ApiQueryContinue2Test.php
ApiQueryContinueTest.php
ApiQueryContinueTestBase.php
ApiQueryDisabledTest.php
ApiQueryImageInfoTest.php
ApiQueryInfoTest.php Encode & to &amp; in displaytitle fallback 2021-10-05 18:09:15 +00:00
ApiQueryLanguageinfoTest.php api: Use fake timer to test ApiQueryLanguageinfo 2021-08-04 02:27:04 +00:00
ApiQueryPrefixSearchTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
ApiQueryRecentChangesIntegrationTest.php Use WikiPage::doUserEditContent() instead of ::doEditContent() 2021-06-28 00:11:30 -07:00
ApiQueryRevisionsTest.php Use WikiPage::doUserEditContent() instead of ::doEditContent() 2021-06-28 00:11:30 -07:00
ApiQuerySearchTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
ApiQuerySiteinfoTest.php ApiParse: Support hidden skins 2021-09-20 09:29:24 +01:00
ApiQueryTest.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
ApiQueryTestBase.php
ApiQueryUserContribsTest.php Use WikiPage::doUserEditContent() instead of ::doEditContent() 2021-06-28 00:11:30 -07:00
ApiQueryUserInfoTest.php Tests: remove unneeded tearDown functions 2021-07-27 13:15:40 +00:00
ApiQueryWatchlistIntegrationTest.php Hard deprecate User::setOption() 2021-09-26 17:18:54 +02:00
ApiQueryWatchlistRawIntegrationTest.php Hard deprecate User::setOption() 2021-09-26 17:18:54 +02:00