From: X! Date: Mon, 8 Sep 2008 23:33:42 +0000 (+0000) Subject: Fix action=rollback to now revert IPs too. Patch submitted by ST47. X-Git-Tag: 1.31.0-rc.0~45401 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=6540ad122f1ca110543f12326a41d407ac761971;p=lhc%2Fweb%2Fwiklou.git Fix action=rollback to now revert IPs too. Patch submitted by ST47. --- 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']));