dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ca1563
)
Don't cache replacement patterns in wfEscapeWikitext() during tests
author
Kunal Mehta
<legoktm@member.fsf.org>
Thu, 3 Nov 2016 18:50:44 +0000
(11:50 -0700)
committer
Legoktm
<legoktm.wikipedia@gmail.com>
Fri, 4 Nov 2016 02:27:13 +0000
(
02:27
+0000)
Parser tests depend upon being able to change the value of
$wgEnableMagicLinks at runtime, so skip caching the replacement patterns
while parser tests or phpunit tests are being run.
Change-Id: Ic9fe4fe898aa353bdefa2bf8207b77d2ac14887f
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
bae9c77
..
15a73cf
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-1670,7
+1670,9
@@
function wfClientAcceptsGzip( $force = false ) {
function wfEscapeWikiText( $text ) {
global $wgEnableMagicLinks;
static $repl = null, $repl2 = null;
- if ( $repl === null ) {
+ if ( $repl === null || defined( 'MW_PARSER_TEST' ) || defined( 'MW_PHPUNIT_TEST' ) ) {
+ // Tests depend upon being able to change $wgEnableMagicLinks, so don't cache
+ // in those situations
$repl = [
'"' => '"', '&' => '&', "'" => ''', '<' => '<',
'=' => '=', '>' => '>', '[' => '[', ']' => ']',