aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/unit/includes/parser/MagicWordArrayTest.php
diff options
context:
space:
mode:
authorthiemowmde <thiemo.kreuz@wikimedia.de>2023-10-27 11:02:16 +0200
committerThiemo Kreuz (WMDE) <thiemo.kreuz@wikimedia.de>2023-10-27 16:45:10 +0000
commit6f32dc8a8db8beac6e45478cac81716b9c86d8a8 (patch)
tree893bfd8257a0b110cb85e1510a7c78018df19f9e /tests/phpunit/unit/includes/parser/MagicWordArrayTest.php
parentdb36598eed1479b2680d120a35239f01e55f235e (diff)
downloadmediawikicore-6f32dc8a8db8beac6e45478cac81716b9c86d8a8.tar.gz
mediawikicore-6f32dc8a8db8beac6e45478cac81716b9c86d8a8.zip
Make MagicWordArray not fail on old revs with broken UTF-8
Garbage in, garbage out. When the wikitext is broken, it's still helpful if the user can see the broken wikitext. Even if it's not fully parsed. It's not the job of this class to fix broken UTF-8. The worst thing that can happen is that the wikitext contains some unparsed magic words. However, this is really only relevant for very old revisions (20 years old, see T321234). It's very normal that old revisions can't be 100% parsed any more, most notably because of deleted templates. This here is not much different. Bug: T321234 Change-Id: I0ce40f6575668847ef309599ee32de52190ab212
Diffstat (limited to 'tests/phpunit/unit/includes/parser/MagicWordArrayTest.php')
-rw-r--r--tests/phpunit/unit/includes/parser/MagicWordArrayTest.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/phpunit/unit/includes/parser/MagicWordArrayTest.php b/tests/phpunit/unit/includes/parser/MagicWordArrayTest.php
index 398751196170..68059b398c64 100644
--- a/tests/phpunit/unit/includes/parser/MagicWordArrayTest.php
+++ b/tests/phpunit/unit/includes/parser/MagicWordArrayTest.php
@@ -148,6 +148,7 @@ class MagicWordArrayTest extends MediaWikiUnitTestCase {
'two matches' => [ 'xSyNoNyMxSyNoNyMx', [ 'ID' => false ], 'xxx' ],
'this method does not support parameters' => [ 'xalt=x' ],
'unexpected behavior when used with parameters' => [ 'xalt=$1x', [ 'ID' => false ], 'xx' ],
+ 'T321234' => [ "\x83", [] ],
];
}