This commit is contained in:
Hannes Mannerheim 2017-04-11 08:07:12 +02:00
parent 6afc6a16be
commit bc5f327a86

View File

@ -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;