r97247 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97246‎ | r97247 | r97248 >
Date:08:02, 16 September 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Check for empty arrays to prevent fatal errors
Modified paths:
  • /trunk/extensions/Translate/utils/MessageGroupStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/MessageGroupStats.php
@@ -107,12 +107,14 @@
108108 }
109109
110110 public static function clearGroup( $id ) {
 111+ if ( !count( $id ) ) return;
111112 $dbw = wfGetDB( DB_MASTER );
112113 $conds = array( 'tgs_group' => $id );
113114 $dbw->delete( self::TABLE, $conds, __METHOD__ );
114115 }
115116
116117 public static function clearLanguage( $code ) {
 118+ if ( !count( $code ) ) return;
117119 $dbw = wfGetDB( DB_MASTER );
118120 $conds = array( 'tgs_lang' => $code );
119121 $dbw->delete( self::TABLE, $conds, __METHOD__ );

Status & tagging log