aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/u.php
blob: 6cdcefd7cee1573a0852788c2587c2cdccdce82d (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(_('Diese Kurz-URL existiert nicht.'));
            $this->redirect($this->url_for('start'));
            return;
        }
        dd($short_url->path);
        $this->redirect(URLHelper::getURL($short_url->path));
    }
}