r67324 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67323‎ | r67324 | r67325 >
Date:03:10, 4 June 2010
Author:ariel
Status:ok (Comments)
Tags:
Comment:
XML snapshots: check length of revision text from prefetched content against length in db before using, partial fix for bugs 23264, 18694
Modified paths:
  • /trunk/phase3/maintenance/dumpTextPass.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dumpTextPass.php
@@ -188,8 +188,15 @@
189189 // Blank entries may indicate that the prior dump was broken.
190190 // To be safe, reload it.
191191 } else {
192 - $this->prefetchCount++;
193 - return $text;
 192+ $dbr = wfGetDB( DB_SLAVE );
 193+ $revID = intval($this->thisRev);
 194+ $revLength = $dbr->selectField( 'revision', 'rev_len', array('rev_id' => $revID ) );
 195+ // if length of rev text in file doesn't match length in db, we reload
 196+ // this avoids carrying forward broken data from previous xml dumps
 197+ if( strlen($text) == $revLength ) {
 198+ $this->prefetchCount++;
 199+ return $text;
 200+ }
194201 }
195202 }
196203 return $this->doGetText( $id );

Follow-up revisions

RevisionCommit summaryAuthorDate
r77737Follow-up r67324: removed check for empty text since the length is checked ex...ialex19:30, 4 December 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   16:44, 16 July 2010

Its a bit unintuitive, but using "Bug 18694 and Bug 23264" in the commit message would have linked to the bugs directly.

Status & tagging log