Fix action=rollback to now revert IPs too. Patch submitted by ST47.
authorX! <soxred93@users.mediawiki.org>
Mon, 8 Sep 2008 23:33:42 +0000 (23:33 +0000)
committerX! <soxred93@users.mediawiki.org>
Mon, 8 Sep 2008 23:33:42 +0000 (23:33 +0000)
RELEASE-NOTES
includes/api/ApiRollback.php

index ab555a8..e0a9bcf 100644 (file)
@@ -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 ===
 
index aa78d85..816ef8c 100644 (file)
@@ -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']));