r16925 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16924‎ | r16925 | r16926 >
Date:05:45, 11 October 2006
Author:nickj
Status:old
Tags:
Comment:
(bug 6835): Removing the includes/Parser.php::getTemplateArgs() function, because it seems to be unused:
* Nobody on #mediawiki seems to definitively know of anything that uses it.
* A "grep -inr getTemplateArgs" shows that there seem to be no calls to it in MediaWiki or the extensions in SVN.
* A google codesearch ( http://www.google.com/codesearch?q=getTemplateArgs&btnG=Search+Code ) seems to show no out-of-tree usage.
* A straight google showed nothing obvious.
* An "svn blame includes/Parser.php" shows that it was added in r4452 (2 years 2 months ago) and has hardly been touched since.
* A "php parserTests.php --quiet --quick --color=no" shows no new regressions when it's removed.
* Using a code coverage tool I simply could not get this function to be invoked.
* Nobody requested this be kept when removing it was first suggested on wikitech-l three months ago (http://mail.wikipedia.org/pipermail/wikitech-l/2006-July/036969.html ).
* A PHPXref output for MW 1.6.3 ( http://mediawiki.openapp.org/mediawiki/nav.html?_functions/index.html ) showed zero references to this function.
In short, it looks like dead code, and seeing as this is the very start of the 1.9 cycle, now is probably the ideal time to remove it, so as to give a maximum window of opportunity for complaints in case it turns out someone somewhere is actually using this.
Also purging the RELEASE-NOTES of stuff from the 1.8 series, since the RELEASE-NOTES need to be updated anyway for this.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -20,315 +20,18 @@
2121
2222 == Configuration changes ==
2323
24 -* $wgUseETag, to enable/disable sending of HTTP ETag headers
25 - (default: disabled)
26 -* $wgLegalTitleChars now includes '+' by default for better compatibility
27 - with importing data dumps from Wikipedia
28 -* $wgDefaultUserOptions now includes all default option settings instead
29 - of only overrides.
3024
31 -
3225 == Major new features ==
3326
34 -* (bug 7098) Add an option to disable/enable sending of HTTP ETag headers,
35 - as it seems to result in broken behaviour in combination with Squid 2.6
36 - (disabled by default).
37 -* (bug 550) Allow blocks on anonymous users only.
38 -* (bug 6420) Render thumbnails for DJVU images, support multipage DJVU display
39 - on image pages. Added new 'page=' thumbnail option to select a page from a
40 - multipage djvu for thumbnail generation.
41 -* Full Postgres support is now enabled. It requires version 8.1 or better, and
42 - needs to have both plpgsql and tsearch2 already installed.
43 -* (bug 6386) fix grammatical errors in danish naming of talk namespaces.
4427
45 -== Changes since 1.7 ==
 28+== Changes since 1.8 ==
4629
47 -* Introduced AjaxResponse object, superceding AjaxCachePolicy
48 -* Changes to sajax_do_call: optionally accept an element to fill instead of a
49 - callback function; take the target function or element as a third parameter;
50 - pass the full XMLHttpRequest object to the handler function, instead of just
51 - the resultText value; use HTTP response codes to report errors.
52 -* (bug 6562) Removed unmaintained ParserXml.php for now
53 -* History paging overlap bug fixed
54 -* (bug 6586) Regression in "unblocked" subtitle
55 -* Don't put empty-page message into view-source when page text is blank
56 -* (bug 6587) Remove redundant "allnonarticles" message
57 -* Block improvements: Allow blocks on anonymous users only. Optionally allow
58 - or disallow account creation from blocked IP addresses. Prevent duplicate
59 - blocks. Fixed the problem of expiry and unblocking erroneously affecting
60 - multiple blocks. Fixed confusing lack of error message when a blocked user
61 - attempts to create an account. Fixed inefficiency of Special:Ipblocklist in
62 - the presence of large numbers of blocks; added indexes and implemented an
63 - indexed pager.
64 -* (bug 6448) Allow filtering of Special:Newpages according to username
65 -* (bug 6618) Improve permissions/error detection in Special:Lockdb
66 -* Quick hack for extension testing: parser test doesn't create new message
67 - cache object.
68 -* (bug 6299) Maintain parser's revision ID across recursive calls to fix
69 - {{REVISIONID}} when Cite extension is used
70 -* (bug 6622) Removed deprecated function Image::newFromTitle
71 -* (bug 6627) Fix regression in Special:Ipblocklist with table prefix
72 -* Removed forced dereferencements (new() returns a reference in PHP5)
73 -* Note about $wgUploadSizeWarning using byte
74 -* (bug 6592) Add most viewed pages summary to Special:Statistics
75 -* Pre-strip characters ignored in IDNs from URLs so they can't be used
76 - to break the blacklists for regular URLs
77 -* Fix regression in blocking of user accounts
78 -* (bug 6635) Fix regression searching for range blocks on Ipblocklist
79 -* Fix regression searching Ipblocklist with ugly URLs
80 -* (bug 6639) Use a consistent default for upload directories
81 -* Preserve entered reason when reporting unconfirmed lock on Special:Lockdb
82 -* (bug 6642) Don't offer to unlock the database when it isn't locked
83 -* cleanupTitles.php changed from --dry-run option to --fix, so default
84 - behavior is now a non-invasive check as with namespaceDupes.php
85 -* (bug 6660) Fix behaviour of EditPage::blockedPage() when the article does
86 - not exist; now doesn't show the source box if the user hasn't provided it
87 - (blocked mid-edit) and the page doesn't exist
88 -* Improve default value of "blockedtext"
89 -* (bug 6680) Added localisation for Dutch bookstore list (nl)
90 -* Renamed maintainace script redundanttrans.php to unusedMessages.php - clearer usage
91 -* Fix regression which allowed some blocked users to create additional accounts
92 -* (bug 6657) Fix Hungarian linktrail
93 -* (bug 6751) Fix preview of blanked section with edit on first preview option
94 -* (bug 5456) Separate MediaWiki:Search into messages for both noun and verb,
95 - introduced 'MediaWiki:Searchbutton'
96 -* Made lines from initialiseMessages() appear as list items during installation
97 -* Moved the bulk of the localisation data from the Language*.php files to the
98 - Messages*.php files. Deleted most of the Languages*.php files.
99 -* Introduced "stub global" framework to provide deferred initialisation of core
100 - modules.
101 -* Removed placeholder values for $wgTitle and $wgArticle, these variables will
102 - now be null during the initialisation process, until they are set by index.php
103 - or another entry point.
104 -* Added DBA cache type, for BDB-style caches.
105 -* Removed custom date format functions, replacing them with a format string in
106 - the style of PHP's date(). Used string identifiers instead of integer
107 - identifiers, in both the language files and user preferences. Migration should
108 - be transparent in most cases.
109 -* Simplified the initialisation API for LoadBalancer objects.
110 -* Removed the broken altencoding feature.
111 -* Moved default user options and toggles from Language to User. Language objects
112 - are still able to define default preference overrides and extra user toggles,
113 - via a slightly different interface.
114 -* Don't include the date option in the parser cache rendering hash unless
115 - $wgUseDynamicDates is enabled.
116 -* Merged LanguageUtf8 with Language. Removed LanguageUtf8.php.
117 -* Removed inclusion of language files from the bottom of Language.php. This is
118 - now consistently done from Language::factory().
119 -* Add the name of the executing maintenance script to the debug log. Start the
120 - profiler during maintenance scripts.
121 -* Added "serialized" directory, for storing precompiled data in serialized form.
122 -* Fix regression in auto-set NS_PROJECT_TALK namespace
123 -* Fix regression in ordering of namespaces
124 -* (bug 6806, 6030) Added several global JS variables for article path, user name,
125 - page title, etc.
126 -* hooks registered with addOnloadHook are now called at the one of the html body
127 - by all skins.
128 -* Split ajax aided search from core ajax framework. Use wgUseAjax to enable the
129 - framework and wgAjaxSearch to enable the suggest feature for the search box.
130 -* Added experimental installer for extensions.
131 - See maintenance/installExtension.php
132 -* Added Tajic (tg) language file.
133 -* (bug 6903) Added Cantonese localisation (zh-yue)
134 -* Fix regression in Korean and Japanese date formatting (day of week)
135 -* (bug 6919) Add English alias magic words for Tatar (tt) language file.
136 -* (bug 6753) Fixed broken Kazakh linktrail (kk)
137 -* (bug 6700) Added Kazakh language variants to Names.php
138 -* (bug 6827) some i18n specific maintenance scripts fails after merge of localisation-work branch
139 -* Throwed an exception for the deprecated functions OutputPage::sysopRequired and
140 - OutputPage::developerRequired - use OutputPage::permissionRequired instead.
141 -* Removed the deprecated functions User::isSysop, User::isBureaucrat and User::isDeveloper -
142 - use User::isAllowed instead.
143 -* (bug 769) OutputPage::permissionRequired() should suggest groups with the needed permission
144 -* (bug 6971) Fix regression in Special:Export history view
145 -* Revamped Special:Imagelist
146 -* (bug 7000) updated MessagesPl.php
147 -* (bug 6946) Fix unexpected behavior change with GET hits to Special:Export
148 -* (bug 1866) Improve navigation on Special:Listusers; user now a starting
149 - point as with Special:Allpages, rather than a pure limit.
150 -* Clean up tab order on Special:Blockip
151 -* (bug 5969) Clean up tab order on Special:Userlogin forms
152 -* (bug 3512) namespaceDupes now handles spaces and initial caps properly
153 -* (bug 7037) Fix regression in login tab order
154 -* (bug 7031) Report missing email on 'email password' instead of false success
155 -* (bug 7010) Don't send email notifications for watched talk pages when user
156 - has selected to receive only updates for their own talk page
157 -* Added {{CURRENTHOUR}}
158 -* Added [[:Image:Foo.png]] style links to the pagelinks table
159 -* Avoid duplicate revision imports with Special:Import
160 -* (bug 7054) Validate email address before sending email confirmation message
161 -* (bug 7061) Format title on "from (page)" links on Special:Allpages
162 -* (bug 7044) Introduce "padleft" and "padright" colon functions
163 -* Pass page title as parameters to "linkshere" and "nolinkshere" and update
164 - default message text
165 -* Allows to upload from publicy accessible URL. Set $wgAllowCopyUploads = true ; in LocalSettings.php
166 - Limited to $wgMaxUploadSize (default:100MB); URL upload is limited to sysops by default, and displayed as a second line if appropriate
167 -* (bug 832) Return to user page after emailing a user
168 -* (bug 366) Add local-system-timezone equivalents for date/time variables
169 -* (bug 7109) Fix Atom feed version number in header links
170 -* (bug 7075) List registered parser function hooks on Special:Version
171 -* (bug 7059) Introduce "anchorencode" colon function
172 -* Include SVN revision number in {{CURRENTVERSION}} output, where applicable
173 -* Fix bug in wfRunHooks which caused corruption of objects in the hook list
174 -* (bug 4979) Use simplified email addresses when running on Windows
175 -* (bug 4434) Show block log fragment on Special:Blockip
176 -* [[MediaWiki:Disambiguationspage]] may optionally contain wiki links to any number
177 - of disambiguation templates.
178 -* [[Special:Disambiguations]] now shows pages in NS:0 that link to any pages that embed
179 - any of the templates listed at [[MediaWiki:Disambiguationspage]].
180 -* Fix formatting of titles on Special:Undelete
181 -* (bug 7026) Fix action=raw&templates=expand
182 -* (bug 6976) Add namespace and direction classes to classic skins
183 -* (bug 7144) Don't "return to main" from OutputPage::loginToUse() if the the user can't
184 - read the main page in the first place
185 -* (bug 7188) Fix minor borkage in HTMLForm
186 -* (bug 6675) Replaced message 'watchthis' with new message 'watchthisupload in Special:Upload
187 -* Add a quickie script dumpSisterSites.php for generating a page list in the
188 - format for WSR-1 SisterSites support
189 -* (bug 7223) Monobook.js is used for site content, should not be localized
190 -* Set default disabled values for DjVu render options
191 -* Added Xml::option() for generating <option>s easily
192 -* Localized page numbers in drop-down for DjVu page selection
193 -* Fixed linktrail for vi
194 -* (bug 6893) "Call to a member function exists() on a non-object" on trackback.php with bad input
195 -* (bug 6886) PHP undefined offset on bad input to Special:Revisiondelete
196 -* (bug 6887) PHP error for call to getId() on bad input to Special:Revisiondelete
197 -* (bug 6888) PHP error for call to getTimestamp() on bad input to Special:Revisiondelete
198 -* (bug 7252) Use dvipng support in texvc math rastrization. dvipng is required if texvc is rebuilt.
199 -* (bug 7279) Use wfBaseName in place of basename() in more places
200 -* Clear newtalk marker on diff links with explicit current revision number
201 -* (bug 7064) Replace hard-coded empty message checks with wfEmptyMsg calls
202 -* (bug 6777) Remove some PHP 4 compat cruft
203 -* Add --user, --comment, and --license options to importImages.php
204 -* (bug 6216) The immobile namespace message does not mention the source page
205 -* (bug 7299) Normalize username filter on Special:Newpages
206 -* (bug 7306) RTL text in an LTR wiki breaks appearance of Special:Recentchanges
207 -* (bug 7312) Don't emit SET NAMES utf8 if connection failed
208 -* (bug 7305) Proper compare for bot check on RC notify, should fix overrides
209 - that force edits by non-bot users to bot mode
210 -* Set Vary: Cookie on action=raw generated CSS and JS, to ensure that user
211 - preferences don't get stuck in proxy caches for other people
212 -* (bug 7324) Fix error message for failure of Database::sourceFile()
213 -* (bug 7309) Plurals: use singular form for zero in French and Brazilian Portuguese
214 -* Add page_no_title_convert field to support language variant conversion
215 - for page titles which shouldn't be converted on display/linking
216 -* Lazy extraction of text chunks in Revision objects, may reduce hits to
217 - external storage when actual text content is not used
218 -* Added experimental $wgRevisionCacheExpiry to cache extracted revision text
219 - in $wgMemc, to further reduce hits to external storage.
220 - Set to 0 (disabled) by default.
221 -* Minor changes to the installer.
222 -* Remove ":" for 'youremail' and 'yourrealname' in includes/templates/Userlogin.php
223 - so that ":" could be used in i18n for Special:Preferences (like 'username' and 'uid').
224 -* Fix layout for Special:Preferences->Date and Time (position for 'timezonetext').
225 -* Updates to language variant code for Serbian et al
226 -* (bug 6756) Enabling RTL direction for kk-cn
227 -* (bug 6701) Kazakh language variants in MessagesEn.php
228 -* (bug 7335) SVN revision check in Special:Version fails on SVN 1.4 working copy
229 -* (bug 6518) Replaced 'lastmodified' with 'lastmodifiedat' and 'lastmodifiedby' with 'lastmodifiedatby'
230 - with seperated parameters for date and time to allow better localisation. Updated all message files
231 - to display the old format for compatibility.
232 -* (bug 7357) Make supposedly static methods of Skin actually static
233 -* Added info text to Special:Deadendpages and Special:Lonelypages
234 -* Fix regression in cachability of generated CSS and JS for MonoBook skin,
235 - while avoiding clobbering of different users' cached data
236 -* (bug 6849) Block @ from usernames; interferes with multi-database tools and
237 - was meant to be banned years ago... For now existing accounts will not be
238 - prevented fromm login.
239 -* (bug 6092) Introduce magic words {{REVISIONDAY}}, {{REVISIONDAY2}, {{REVISIONMONTH}},
240 - {{REVISIONYEAR}} and {{REVISIONTIMESTAMP}}
241 -* (bug 7425) Preceeding whitespace in [[...]] breaks subpages
242 -* Try to reconnect after transitory database errors in dumpTextPass.php
243 -* (bug 6023) Fixed mismatch of 0/NULL for wl_notificationtimestamp; now notification
244 - mails are working after 'Mark all pages visited' button on Special:Watchlist is clicked
245 -* Made {{INT:}} a core parser function instead of a special case. The syntax
246 - and behaviour is largely unchanged.
247 -* (bug 7448) Fixing the native name for Ewe (ee)
248 -* (bug 6864) Replace message 'editing' with new message 'editinguser' in Special:Userrights
249 - to allow better localisation
250 -* Add '*-summary' for special pages to MessagesEn.php to allow customizing/translation
251 - directly through Special:Allmessages
252 -* (bug 6130, bug 5818) Replaced message 'go' with the new message 'searcharticle' in skins
253 - to allow better localisation
254 -* Add + to $wgLegalTitleChars by default. Some sites may have occasional
255 - problems with hard-to-reach pages, but it should be less trouble than
256 - "I can't import dumps from Wikipedia" complaints
257 -* (bug 7460) Revert broken patch for bug 7226 which slows down
258 - Special:Allmessages by a factor of 16
259 -* Committed a bunch of live hacks from Wikimedia servers
260 -* (bug 6889) PHP notices in thumb.php with missing params
261 -* Cleaner error behavior on thumb.php with invalid page selection
262 -* (bug 6617) Validate timestamps on Special:Undelete
263 -* Do fewer unnecessary full writes of user rows; only update user_touched
264 - for watch/unwatch, group membership change, and login operations
265 -* Restructured the languages directory, to avoid problems when people
266 - untar MW 1.8 over the top of a 1.7 installation.
267 -* (bug 6890) SQL query error on bad input to Pager lists
268 - due to negative LIMIT clause, caused by integer wraparound.
269 -* Fixed various bugs related to table prefixes, especially the interaction
270 - between table prefixes and memcached, which was formerly completely broken.
271 -* (bug 7004) PHP iconv() notice on bad password input to Special:Userlogin.
272 -* (bug 6826) Extend pre-save transform context link ("pipe trick")
273 - syntax to pages with commas in title
274 -* Use ImageMagick -thumbnail option instead of -resize to avoid including
275 - excessive metadata in thumbs (requires ImageMagick 6.0.0 or newer).
276 -* (bug 7499) Corrections to Swedish talk namespace names
277 -* (bug 7508) Added option to compress HTML pages by dumpHTML.php
278 -* (bug 7519) Add plural in SpecialWatchlist
279 -* (bug 7459) Magic word variables are always case sensitive
280 -* Replaced {{SERVER}}{{localurl:xxx}} with {{fullurl:xxx}} in localisation files
281 -* Fix regression in Special:Watchlist text header
282 -* (bug 7510) Update article counts etc on undelete
283 -* (bug 7520) Update article counts on XML import
284 -* (bug 7526) Make $wgDefaultUserOptions work again
285 -* (bug 7472) Localize Help namespace for Basque
286 -* (bug 7529) Including a non-existent category in an article places that article in the category
287 -* (bug 4528) Lack of important LaTeX functions stackrel, rightleftharpoon
288 -* (bug 6721) missing symbols ulcorner, urcorner, llcorner, lrcorner, twoheadrightarrow, twoheadleftarrow
289 -* (bug 7367) Hyphens sometimes erroneously appended to equations when not converted to PNG
290 -* Add "title" to the opensearch link to allow automatic adding of the search engine in Firefox 2
291 -* (bug 7537) Add php5 to $wgFileBlacklist
292 -* (bug 6929) Restore AutoAuthenticate hook
 30+* (bug 6835) Removing the includes/Parser.php::getTemplateArgs() function,
 31+ because it seems to be unused.
29332
29433
29534 == Languages updated ==
29635
297 -* Albanian (sq)
298 -* Bashkir (ba)
299 -* Bavarian (bar) stub file
300 -* Belarusian (be)
301 -* Bishnupriya (bpy) stub file
302 -* Brazilian Portuguese (pt-br)
303 -* Cantonese (zh-yue)
304 -* Catalan (ca)
305 -* Czech (cs)
306 -* Dutch (nl)
307 -* English (en)
308 -* Finnish (fi)
309 -* French (fr)
310 -* Georgian (ka)
311 -* German (de)
312 -* Hebrew (he)
313 -* Hungarian (hu)
314 -* Indonesian (id)
315 -* Japanese (ja)
316 -* Korean (ko)
317 -* Latin (la)
318 -* Lojban (jbo)
319 -* Macedonian (mk)
320 -* Mazandarani (mzn)
321 -* Polish (pl)
322 -* Portuguese (pt)
323 -* Ripuarian (ksh)
324 -* Romani (rmy)
325 -* Russian (ru)
326 -* Slovak (sk)
327 -* Spanish (es)
328 -* Tajic (tg)
329 -* Tatar (tt)
330 -* Telugu (te)
331 -* Uzbek (uz)
332 -* Yiddish (yi)
33336
33437 == Compatibility ==
33538
Index: trunk/phase3/includes/Parser.php
@@ -2789,31 +2789,6 @@
27902790 return $text;
27912791 }
27922792
2793 - # Split template arguments
2794 - function getTemplateArgs( $argsString ) {
2795 - if ( $argsString === '' ) {
2796 - return array();
2797 - }
2798 -
2799 - $args = explode( '|', substr( $argsString, 1 ) );
2800 -
2801 - # If any of the arguments contains a '[[' but no ']]', it needs to be
2802 - # merged with the next arg because the '|' character between belongs
2803 - # to the link syntax and not the template parameter syntax.
2804 - $argc = count($args);
2805 -
2806 - for ( $i = 0; $i < $argc-1; $i++ ) {
2807 - if ( substr_count ( $args[$i], '[[' ) != substr_count ( $args[$i], ']]' ) ) {
2808 - $args[$i] .= '|'.$args[$i+1];
2809 - array_splice($args, $i+1, 1);
2810 - $i--;
2811 - $argc--;
2812 - }
2813 - }
2814 -
2815 - return $args;
2816 - }
2817 -
28182793 /**
28192794 * Return the text of a template, after recursively
28202795 * replacing any variables or templates within the template.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r4452Allowing for piped links inside template variables; by Emmanuel Engelhart...timwi14:13, 31 July 2004