fix for #94
This commit is contained in:
parent
6afc6a16be
commit
bc5f327a86
|
@ -45,6 +45,20 @@ class QvitterAction extends ApiAction
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
// redirect user/:id for local users to their nickname url
|
||||
if(substr($_SERVER['REQUEST_URI'],0,6) == '/user/') {
|
||||
$user_id = substr($_SERVER['REQUEST_URI'],6);
|
||||
try {
|
||||
$user = User::getKV('id', $user_id);
|
||||
if($user instanceof User) {
|
||||
$nickname = $user->nickname;
|
||||
common_redirect(common_local_url('showstream',array('nickname'=>$nickname)), 303);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
$user = common_current_user();
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user