tableName calls moved inside fieldInfoMulti and removed call that existed only for...
[lhc/web/wiklou.git] / maintenance / updateRestrictions.php
index 5ae0684..80e98fd 100644 (file)
@@ -23,7 +23,7 @@
  * @ingroup Maintenance
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
 
 class UpdateRestrictions extends Maintenance {
        public function __construct() {
@@ -54,7 +54,7 @@ class UpdateRestrictions extends Maintenance {
                        $cond = "page_id BETWEEN $blockStart AND $blockEnd AND page_restrictions !=''";
                        $res = $db->select( 'page', array('page_id','page_namespace','page_restrictions'), $cond, __METHOD__ );
                        $batch = array();
-                       while( $row = $db->fetchObject( $res ) ) {
+                       foreach( $res as $row ) {
                                $oldRestrictions = array();
                                foreach( explode( ':', trim( $row->page_restrictions ) ) as $restrict ) {
                                        $temp = explode( '=', trim( $restrict ) );