X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateRestrictions.php;h=cb40af34c56b6c281c9aaf48ff9e4cc43a51a323;hb=1797b20c8e675d92594be2a6b0c2f319f11026b0;hp=334ed279f65d1400f63a9fb724716114ff6f8d73;hpb=fbb86f07d222ba6c31386472c5b792348b1c89e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index 334ed279f6..cb40af34c5 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -43,12 +43,12 @@ class UpdateRestrictions extends Maintenance { $db = $this->getDB( DB_MASTER ); $batchSize = $this->getBatchSize(); if ( !$db->tableExists( 'page_restrictions' ) ) { - $this->error( "page_restrictions table does not exist", true ); + $this->fatalError( "page_restrictions table does not exist" ); } $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); if ( !$start ) { - $this->error( "Nothing to do.", true ); + $this->fatalError( "Nothing to do." ); } $end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); @@ -59,7 +59,8 @@ class UpdateRestrictions extends Maintenance { $encodedExpiry = 'infinity'; while ( $blockEnd <= $end ) { $this->output( "...doing page_id from $blockStart to $blockEnd out of $end\n" ); - $cond = "page_id BETWEEN $blockStart AND $blockEnd AND page_restrictions !=''"; + $cond = "page_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd . + " AND page_restrictions !=''"; $res = $db->select( 'page', [ 'page_id', 'page_namespace', 'page_restrictions' ], @@ -125,5 +126,5 @@ class UpdateRestrictions extends Maintenance { } } -$maintClass = "UpdateRestrictions"; +$maintClass = UpdateRestrictions::class; require_once RUN_MAINTENANCE_IF_MAIN;