X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateRevisionLength.php;h=dcb89d193ff4e933d0f8211e866d36845d152a50;hb=c99e9beff7d7c1a5a48f8d6f869a42425021c62b;hp=8895c9f4f7724a47ad78bee59fbbc30528e7935e;hpb=6b97d969c3a1c4f7c3565c980383ce977062c0e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateRevisionLength.php b/maintenance/populateRevisionLength.php index 8895c9f4f7..dcb89d193f 100644 --- a/maintenance/populateRevisionLength.php +++ b/maintenance/populateRevisionLength.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use Wikimedia\Rdbms\IDatabase; + require_once __DIR__ . '/Maintenance.php'; /** @@ -97,7 +99,13 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance { [ "$idCol >= $blockStart", "$idCol <= $blockEnd", - "{$prefix}_len IS NULL" + $dbr->makeList( [ + "{$prefix}_len IS NULL", + $dbr->makeList( [ + "{$prefix}_len = 0", + "{$prefix}_sha1 != " . $dbr->addQuotes( 'phoiac9h4m842xq45sp7s6u21eteeq1' ), // sha1( "" ) + ], IDatabase::LIST_AND ) + ], IDatabase::LIST_OR ) ], __METHOD__, [], @@ -136,7 +144,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance { ? Revision::newFromArchiveRow( $row ) : new Revision( $row ); - $content = $rev->getContent(); + $content = $rev->getContent( Revision::RAW ); if ( !$content ) { # This should not happen, but sometimes does (T22757) $id = $row->$idCol;