mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Use IDatabase::buildComparison in MigrateActorsAF
Avoid IDatabase::addQuotes Change-Id: I68712c407cec15eb7fac0303ad7fa94651f4e0be
This commit is contained in:
parent
6b326ff2e0
commit
73a15cdcbf
|
@ -76,19 +76,14 @@ class MigrateActorsAF extends LoggedUpdateMaintenance {
|
|||
* @return array [ string $next, string $display ]
|
||||
*/
|
||||
private function makeNextCond( $dbw, $primaryKey, $row ) {
|
||||
$next = '';
|
||||
$conditions = [];
|
||||
$display = [];
|
||||
for ( $i = count( $primaryKey ) - 1; $i >= 0; $i-- ) {
|
||||
$field = $primaryKey[$i];
|
||||
foreach ( $primaryKey as $field ) {
|
||||
$display[] = $field . '=' . $row->$field;
|
||||
$value = $dbw->addQuotes( $row->$field );
|
||||
if ( $next === '' ) {
|
||||
$next = "$field > $value";
|
||||
} else {
|
||||
$next = "$field > $value OR $field = $value AND ($next)";
|
||||
}
|
||||
$conditions[$field] = $row->$field;
|
||||
}
|
||||
$display = implode( ' ', array_reverse( $display ) );
|
||||
$next = $dbw->buildComparison( '>', $conditions );
|
||||
$display = implode( ' ', $display );
|
||||
return [ $next, $display ];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue