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:
nullzero 2013-12-30 22:30:49 -05:00 committed by Marius Hoch
parent 70da56cd99
commit 6c89ccc2fe

View file

@ -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' )