aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/u.php
blob: 76cd35e958846b6dc04452b754239b8b31e6fc94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

class UController extends AuthenticatedController
{
    public function r_action(string $short_url_alias): void
    {
        $short_url = ShortUrl::findOneBySQL('alias = ?', [$short_url_alias]);

        if (!$short_url) {
            PageLayout::postError(_('Dieser Kurzlink existiert nicht.'));
            $this->redirect($this->url_for('start'));
            return;
        }

        $this->redirect(URLHelper::getURL($short_url->path, ['from_short_url' => $short_url->id]));
    }
}