From 6540ad122f1ca110543f12326a41d407ac761971 Mon Sep 17 00:00:00 2001 From: X! Date: Mon, 8 Sep 2008 23:33:42 +0000 Subject: [PATCH] Fix action=rollback to now revert IPs too. Patch submitted by ST47. --- RELEASE-NOTES | 1 + includes/api/ApiRollback.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ab555a8473..e0a9bcf4b3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -222,6 +222,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 15466) Added action=purge * (bug 15486) action=block ignores autoblock parameter * (bug 15492) added rcprop=loginfo to list=recentchanges +* (bug 15527) action=rollback can now revert anonymous editors === Languages updated in 1.14 === diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index aa78d85917..816ef8c753 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -55,7 +55,10 @@ class ApiRollback extends ApiBase { if(!$titleObj->exists()) $this->dieUsageMsg(array('notanarticle')); - $username = User::getCanonicalName($params['user']); + #We need to be able to revert IPs, but getCanonicalName rejects them + $username = User::isIP($params['user']) + ? $params['user'] + : User::getCanonicalName($params['user']); if(!$username) $this->dieUsageMsg(array('invaliduser', $params['user'])); -- 2.20.1