r79722 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79721‎ | r79722 | r79723 >
Date:15:13, 6 January 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
(bug 26535) Variable naming collision in MessageBlobStore::updateMessage() caused exception ('Non-string key given' in MessageCache) when conflicted updates were retried.
Modified paths:
  • /trunk/phase3/includes/MessageBlobStore.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageBlobStore.php
@@ -210,7 +210,7 @@
211211 do {
212212 $updates = self::getUpdatesForMessage( $key, $updates );
213213
214 - foreach ( $updates as $key => $update ) {
 214+ foreach ( $updates as $k => $update ) {
215215 // Update the row on the condition that it
216216 // didn't change since we fetched it by putting
217217 // the timestamp in the WHERE clause.
@@ -230,7 +230,7 @@
231231 // fear of getting into an infinite loop
232232 if ( !( $success && $dbw->affectedRows() == 0 ) ) {
233233 // Not conflicted
234 - unset( $updates[$key] );
 234+ unset( $updates[$k] );
235235 }
236236 }
237237 } while ( count( $updates ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r805261.17: MFT r78232, r78253, r79722, r79732, r79785, r79817, r79864, r79891, r79...catrope22:19, 18 January 2011

Comments

#Comment by Trevor Parscal (WMF) (talk | contribs)   00:24, 13 January 2011

Beware of evil shadowed variables! Ooooohhhh....

Status & tagging log