r86728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86727‎ | r86728 | r86729 >
Date:19:35, 22 April 2011
Author:robin
Status:ok
Tags:
Comment:
(bug 26158) Interwiki extension: deleting a prefix with invalid characters shows an error, so only check for invalid chars when adding a prefix
Modified paths:
  • /trunk/extensions/Interwiki/Interwiki.php (modified) (history)
  • /trunk/extensions/Interwiki/Interwiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Interwiki/Interwiki_body.php
@@ -181,7 +181,8 @@
182182 global $wgRequest, $wgOut;
183183 $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' );
184184 $do = $wgRequest->getVal( 'wpInterwikiAction' );
185 - if( preg_match( '/[\s:&=]/', $prefix ) ) {
 185+ // show an error if the prefix is invalid (only when adding one)
 186+ if( preg_match( '/[\s:&=]/', $prefix ) && $do == 'add' ) {
186187 $this->error( 'interwiki-badprefix', htmlspecialchars( $prefix ) );
187188 $this->showForm( $do );
188189 return;
Index: trunk/extensions/Interwiki/Interwiki.php
@@ -26,7 +26,7 @@
2727 'path' => __FILE__,
2828 'name' => 'SpecialInterwiki',
2929 'author' => array( 'Stephanie Amanda Stevens', 'SPQRobin', '...' ),
30 - 'version' => '1.3.1',
 30+ 'version' => '1.3.2',
3131 'url' => 'http://www.mediawiki.org/wiki/Extension:SpecialInterwiki',
3232 'descriptionmsg' => 'interwiki-desc',
3333 );

Status & tagging log