mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Conditionals in loops to foreachs
This commit is contained in:
parent
df1aa3a228
commit
272013d0f2
|
@ -155,7 +155,7 @@ class AbuseFilterHooks {
|
|||
array( 'abuse_filter' => array( 'INNER JOIN', 'afa_filter=af_id' ) )
|
||||
);
|
||||
|
||||
while ( $row = $res->fetchObject() ) {
|
||||
foreach ( $res as $row ) {
|
||||
$emptyTags = array_filter(
|
||||
array_merge( explode( "\n", $row->afa_parameters ), $emptyTags )
|
||||
);
|
||||
|
|
|
@ -330,7 +330,7 @@ class AFComputedVariable {
|
|||
);
|
||||
|
||||
$users = array();
|
||||
while ( $user = $dbr->fetchRow( $res ) ) {
|
||||
foreach ( $res as $user ) {
|
||||
$users[] = $user[0];
|
||||
}
|
||||
$result = $users;
|
||||
|
|
|
@ -97,7 +97,7 @@ class ApiQueryAbuseFilters extends ApiQueryBase {
|
|||
$showhidden = $wgUser->isAllowed( 'abusefilter-modify' );
|
||||
|
||||
$count = 0;
|
||||
while ( $row = $res->fetchObject() ) {
|
||||
foreach ( $res as $row ) {
|
||||
if ( ++$count > $params['limit'] ) {
|
||||
// We've had enough
|
||||
$this->setContinueEnumParameter( 'startid', $row->af_id );
|
||||
|
|
|
@ -104,7 +104,7 @@ class ApiQueryAbuseLog extends ApiQueryBase {
|
|||
$res = $this->select( __METHOD__ );
|
||||
|
||||
$count = 0;
|
||||
while ( $row = $res->fetchObject() ) {
|
||||
foreach ( $res as $row ) {
|
||||
if ( ++$count > $params['limit'] ) {
|
||||
// We've had enough
|
||||
$this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->afl_timestamp ) );
|
||||
|
|
Loading…
Reference in a new issue