diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-25 13:14:33 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-25 13:14:33 -0700 |
commit | b483a0549f115b2d5f2cfb3d447e6cc5c4f469f3 (patch) | |
tree | f63f4f3e93bad7611f4b5651171fc5122ec65455 /lib/apiaction.php | |
parent | 3b6f738ab73b7f77dd09ac21dd9446876776fc04 (diff) | |
parent | ca489631db840e33757a71a7e4cb56b187c182d3 (diff) |
Merge branch '1.0.x' into schema-x
Conflicts:
plugins/CacheLog/locale/nb/LC_MESSAGES/CacheLog.po
Diffstat (limited to 'lib/apiaction.php')
-rw-r--r-- | lib/apiaction.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/apiaction.php b/lib/apiaction.php index fbc3a1451..82685e62e 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -1400,8 +1400,10 @@ class ApiAction extends Action if (is_numeric($this->arg('id'))) { return Profile::staticGet($this->arg('id')); } else if ($this->arg('id')) { + // Screen names currently can only uniquely identify a local user. $nickname = common_canonical_nickname($this->arg('id')); - return Profile::staticGet('nickname', $nickname); + $user = User::staticGet('nickname', $nickname); + return $user ? $user->getProfile() : null; } 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 @@ -1410,13 +1412,15 @@ class ApiAction extends Action } } else if ($this->arg('screen_name')) { $nickname = common_canonical_nickname($this->arg('screen_name')); - return Profile::staticGet('nickname', $nickname); + $user = User::staticGet('nickname', $nickname); + return $user ? $user->getProfile() : null; } } else if (is_numeric($id)) { return Profile::staticGet($id); } else { $nickname = common_canonical_nickname($id); - return Profile::staticGet('nickname', $nickname); + $user = User::staticGet('nickname', $nickname); + return $user ? $user->getProfile() : null; } } |