r68278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68277‎ | r68278 | r68279 >
Date:18:40, 19 June 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Don't throw an exception if invalid page title is passed for page translation group
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -884,6 +884,12 @@
885885 }
886886 } elseif ( strpos( $id, 'page|' ) === 0 ) {
887887 list( , $title ) = explode( '|', $id, 2 );
 888+
 889+ // Check first if it valid page title at all
 890+ if ( !Title::newFromText( $title ) ) {
 891+ return null;
 892+ }
 893+
888894 return new WikiPageMessageGroup( $id, $title );
889895 } else {
890896 return null;

Status & tagging log