r50157 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50156‎ | r50157 | r50158 >
Date:12:38, 3 May 2009
Author:ialex
Status:ok
Tags:
Comment:
Cleanup in MagicWord::$mVariableIDs, removed IDs that aren't handled in Parser::getVariableValue().

Side effect: Removed "Pages in namespace (Magic word disabled currently)" parser test added in r17687 by nickj (was passing; I know). The problem is that the expected result is an empty string, but since it's disabled by default with $wgAllowSlowParserFunctions = false (i.e. not added to parser's list of magic words IDs) it should return a red link to [[Template:PAGESINNAMESPACE:]] (the empty string is produced because "{{PAGESINNAMESPACE:}}" is handled as variable and not as parser function).
Modified paths:
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -1,4 +1,4 @@
2 -# MediaWiki Parser test cases
 2+# MediaWiki Parser test cases
33 # Some taken from http://meta.wikimedia.org/wiki/Parser_testing
44 # All (C) their respective authors and released under the GPL
55 #
@@ -6662,15 +6662,6 @@
66636663
66646664
66656665 !! test
6666 -Pages in namespace (Magic word disabled currently)
6667 -!! input
6668 -{{PAGESINNAMESPACE:}}
6669 -!! result
6670 -
6671 -!! end
6672 -
6673 -
6674 -!! test
66756666 anchorencode
66766667 !! input
66776668 {{anchorencode:foo bar©#%n}}
Index: trunk/phase3/includes/MagicWord.php
@@ -81,7 +81,6 @@
8282 'revisionuser',
8383 'subpagename',
8484 'subpagenamee',
85 - 'displaytitle',
8685 'talkspace',
8786 'talkspacee',
8887 'subjectspace',
@@ -92,26 +91,16 @@
9392 'subjectpagenamee',
9493 'numberofusers',
9594 'numberofactiveusers',
96 - 'newsectionlink',
97 - 'nonewsectionlink',
9895 'numberofpages',
9996 'currentversion',
10097 'basepagename',
10198 'basepagenamee',
102 - 'urlencode',
10399 'currenttimestamp',
104100 'localtimestamp',
105101 'directionmark',
106 - 'language',
107102 'contentlanguage',
108 - 'pagesinnamespace',
109103 'numberofadmins',
110104 'numberofviews',
111 - 'defaultsort',
112 - 'pagesincategory',
113 - 'index',
114 - 'noindex',
115 - 'numberingroup',
116105 );
117106
118107 /* Array of caching hints for ParserCache */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r17687* Add printing the names of tests whose status has just changed when using "-...nickj04:06, 15 November 2006

Status & tagging log