1
1
Fork 0

Change fallback logic

This commit is contained in:
Philipp Holzer 2019-05-30 13:45:39 +02:00
parent 0115329dc6
commit 03ca26f0c4
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
2 changed files with 4 additions and 3 deletions

View file

@ -33,7 +33,8 @@ function parse_url_content(App $a)
$url = trim($_GET['url']); $url = trim($_GET['url']);
// fallback in case no url is valid // fallback in case no url is valid
} else { } else {
$a->internalRedirect(); Logger::info('No url given');
exit();
} }
if (!empty($_GET['title'])) { if (!empty($_GET['title'])) {

View file

@ -189,7 +189,7 @@ function photos_post(App $a)
if ($a->argc > 3 && $a->argv[2] === 'album') { if ($a->argc > 3 && $a->argv[2] === 'album') {
if (!Strings::isHex($a->argv[3])) { if (!Strings::isHex($a->argv[3])) {
$a->internalRedirect(); $a->internalRedirect('photos/' . $a->data['user']['nickname'] . '/album');
} }
$album = hex2bin($a->argv[3]); $album = hex2bin($a->argv[3]);
@ -1032,7 +1032,7 @@ function photos_content(App $a)
if ($datatype === 'album') { if ($datatype === 'album') {
// if $datum is not a valid hex, redirect to the default page // if $datum is not a valid hex, redirect to the default page
if (!Strings::isHex($datum)) { if (!Strings::isHex($datum)) {
$a->internalRedirect(); $a->internalRedirect('photos/' . $a->data['user']['nickname']. '/album');
} }
$album = hex2bin($datum); $album = hex2bin($datum);