diff options
author | Zach Copley <zach@status.net> | 2009-12-01 09:57:47 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-12-01 12:42:39 -0800 |
commit | 4a4d8bd2710fca1ffa4fdbfd7f45fb28be42313d (patch) | |
tree | 7dc10c761593cb626b9db63d2ef1ebaf2f04a962 /lib/api.php | |
parent | bb5ef9a5dbad2009ea7c5024cd10140dbf9db1d5 (diff) |
Revert "Fix problem where screen_name and user_id parameters are being"
The problem this was trying to fix is actually caused by a missing
routing rule. Silly me.
This reverts commit 2451192415ae93a329b412761cfbb26df8185474.
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/api.php b/lib/api.php index 539aac4af..e2ea87b43 100644 --- a/lib/api.php +++ b/lib/api.php @@ -1142,10 +1142,15 @@ class ApiAction extends Action function getTargetUser($id) { - if (!preg_match('/^[a-zA-Z0-9]+$/', $id)) { + if (empty($id)) { // Twitter supports these other ways of passing the user ID - if ($this->arg('user_id')) { + if (is_numeric($this->arg('id'))) { + return User::staticGet($this->arg('id')); + } else if ($this->arg('id')) { + $nickname = common_canonical_nickname($this->arg('id')); + return User::staticGet('nickname', $nickname); + } else if ($this->arg('user_id')) { // This is to ensure that a non-numeric user_id still // overrides screen_name even if it doesn't get used if (is_numeric($this->arg('user_id'))) { @@ -1154,12 +1159,6 @@ class ApiAction extends Action } else if ($this->arg('screen_name')) { $nickname = common_canonical_nickname($this->arg('screen_name')); return User::staticGet('nickname', $nickname); - - } else if (is_numeric($this->arg('id'))) { - return User::staticGet($this->arg('id')); - } else if ($this->arg('id')) { - $nickname = common_canonical_nickname($this->arg('id')); - return User::staticGet('nickname', $nickname); } else { // Fall back to trying the currently authenticated user return $this->auth_user; |