diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php index 8efd7eba2..8a67760c3 100644 --- a/AbuseFilter.hooks.php +++ b/AbuseFilter.hooks.php @@ -155,7 +155,7 @@ class AbuseFilterHooks { array( 'abuse_filter' => array( 'INNER JOIN', 'afa_filter=af_id' ) ) ); - foreach ( $res as $row ) { + while ( $row = $res->fetchObject() ) { $emptyTags = array_filter( array_merge( explode( "\n", $row->afa_parameters ), $emptyTags ) ); diff --git a/AbuseFilterVariableHolder.php b/AbuseFilterVariableHolder.php index c73cf5b69..5182f77e0 100644 --- a/AbuseFilterVariableHolder.php +++ b/AbuseFilterVariableHolder.php @@ -330,7 +330,7 @@ class AFComputedVariable { ); $users = array(); - foreach ( $res as $user ) { + while ( $user = $dbr->fetchRow( $res ) ) { $users[] = $user[0]; } $result = $users; diff --git a/ApiQueryAbuseFilters.php b/ApiQueryAbuseFilters.php index 3696929d7..6c2f1e8f7 100644 --- a/ApiQueryAbuseFilters.php +++ b/ApiQueryAbuseFilters.php @@ -97,7 +97,7 @@ class ApiQueryAbuseFilters extends ApiQueryBase { $showhidden = $wgUser->isAllowed( 'abusefilter-modify' ); $count = 0; - foreach ( $res as $row ) { + while ( $row = $res->fetchObject() ) { if ( ++$count > $params['limit'] ) { // We've had enough $this->setContinueEnumParameter( 'startid', $row->af_id ); diff --git a/ApiQueryAbuseLog.php b/ApiQueryAbuseLog.php index a9333dc96..54d3a3dbc 100644 --- a/ApiQueryAbuseLog.php +++ b/ApiQueryAbuseLog.php @@ -104,7 +104,7 @@ class ApiQueryAbuseLog extends ApiQueryBase { $res = $this->select( __METHOD__ ); $count = 0; - foreach ( $res as $row ) { + while ( $row = $res->fetchObject() ) { if ( ++$count > $params['limit'] ) { // We've had enough $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->afl_timestamp ) );