r62695 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62694‎ | r62695 | r62696 >
Date:07:32, 19 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
Revert r62436 and associated parser test. If you really want to make {{#ifexist:foo}} work the same way as [[File:foo]], which is presumably what bug 14779 is getting at, then you should do a proper job of it, and not introduce your own special #ifexist-specific syntax for specifying files.
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions_body.php (modified) (history)
  • /trunk/extensions/ParserFunctions/funcsParserTests.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php
@@ -321,9 +321,6 @@
322322 function ifexistCommon( &$parser, $frame, $titletext = '', $then = '', $else = '' ) {
323323 global $wgContLang;
324324 $title = Title::newFromText( $titletext );
325 - if( is_null( $title ) ) # It may be urlencoded (bug 14779)
326 - $title = Title::newFromURL( urldecode( $titletext ) );
327 -
328325 $wgContLang->findVariantLink( $titletext, $title, true );
329326 if ( $title ) {
330327 if( $title->getNamespace() == NS_MEDIA ) {
Index: trunk/extensions/ParserFunctions/funcsParserTests.txt
@@ -82,24 +82,6 @@
8383 !! end
8484
8585 !! test
86 -Bug 14779 - {{#ifexist}} does not recognise URL encoded filenames
87 -Based on http://test.wikipedia.org/wiki/User:Raymond/ifexist
88 -!! input
89 -{{#ifexist:Media:F%6fobar.jpg|found|not found}}
90 -[[:File:Dionysos-Brunnen am Kölner Dom.jpg]]
91 -{{#ifexist:File:Dionysos-Brunnen am Kölner Dom.jpg|found|not found}}
92 -[[:File:Dionysos-Brunnen_am_K%C3%B6lner_Dom.jpg]]
93 -{{#ifexist:File:Dionysos-Brunnen_am_K%C3%B6lner_Dom.jpg|found|not found}}
94 -!! result
95 -<p>found
96 -<a href="https://www.mediawiki.org/wiki/File:Dionysos-Brunnen_am_K%C3%B6lner_Dom.jpg" title="File:Dionysos-Brunnen am Kölner Dom.jpg">File:Dionysos-Brunnen am Kölner Dom.jpg</a>
97 -found
98 -<a href="https://www.mediawiki.org/wiki/File:Dionysos-Brunnen_am_K%C3%B6lner_Dom.jpg" title="File:Dionysos-Brunnen am Kölner Dom.jpg">File:Dionysos-Brunnen_am_Kölner_Dom.jpg</a>
99 -found
100 -</p>
101 -!! end
102 -
103 -!! test
10486 #if
10587 !! input
10688 {{#if: | yes | no}}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62436(Bug 14779) {{#ifexist}} does not recognise URL encoded filenames...platonides15:08, 13 February 2010

Status & tagging log