r74269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74268‎ | r74269 | r74270 >
Date:19:53, 4 October 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Suppress PHP notices but add tracking code
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/MessageGroups.php
@@ -769,7 +769,10 @@
770770 public function getMessage( $key, $code ) {
771771 if ( $code === 'en' ) {
772772 $stuff = $this->load( 'en' );
773 - return $stuff[$key];
 773+ if ( !isset( $stuff[$key] ) ) {
 774+ wfWarn( __METHOD__ . " called for unknown key $key from " . wfGetAllCallers( 6 ) );
 775+ }
 776+ return isset( $stuff[$key] ) ? $stuff[$key] : null;
774777 }
775778
776779 $title = Title::makeTitleSafe( $this->namespaces[0], "$key/$code" );

Status & tagging log