mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Make MOVED_TO* var generating from RecentChanges working
This patch fixes the generation of MOVED_TO vars from recentchanges rows. Change-Id: I6c5471620a0fb5cb78b946fc162ff3d6a30b0e0e
This commit is contained in:
parent
70da56cd99
commit
6c89ccc2fe
|
@ -1965,8 +1965,6 @@ class AbuseFilter {
|
|||
* @return AbuseFilterVariableHolder
|
||||
*/
|
||||
public static function getMoveVarsFromRCRow( $row ) {
|
||||
$vars = new AbuseFilterVariableHolder;
|
||||
|
||||
if ( $row->rc_user ) {
|
||||
$user = User::newFromId( $row->rc_user );
|
||||
} else {
|
||||
|
@ -1974,13 +1972,12 @@ class AbuseFilter {
|
|||
$user->setName( $row->rc_user_text );
|
||||
}
|
||||
|
||||
$params = explode( "\n", trim( $row->rc_params ) );
|
||||
$params = array_values( DatabaseLogEntry::newFromRow( $row )->getParameters() );
|
||||
|
||||
$oldTitle = Title::makeTitle( $row->rc_namespace, $row->rc_title );
|
||||
$newTitle = Title::newFromText( $params[0] );
|
||||
$newTitle = Title::makeTitle( $params[1], $params[0] );
|
||||
|
||||
$vars = AbuseFilterVariableHolder::merge(
|
||||
$vars,
|
||||
AbuseFilter::generateUserVars( $user ),
|
||||
AbuseFilter::generateTitleVars( $oldTitle, 'MOVED_FROM' ),
|
||||
AbuseFilter::generateTitleVars( $newTitle, 'MOVED_TO' )
|
||||
|
|
Loading…
Reference in a new issue