Skip to content

Commit

Permalink
Merge pull request #5 from simpleauthority/fix-homepage-error
Browse files Browse the repository at this point in the history
Make sure we check if the variables are set
  • Loading branch information
mikecao committed Apr 5, 2018
2 parents 29d1e29 + 235409b commit b6d9454
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions shorty.php
Expand Up @@ -312,8 +312,20 @@ public function allow($ip) {
*/
public function run() {
$q = str_replace('/', '', $_GET['q']);
$url = urldecode($_GET['url']);
$format = strtolower($_GET['format']);
if (empty($q)) {
$this->not_found();
return;
}

$url = '';
if (isset($_GET['url'])) {
$url = urldecode($_GET['url']);
}

$format = '';
if (isset($_GET['format'])) {
$format = strtolower($_GET['format']);
}

// If adding a new URL
if (!empty($url)) {
Expand Down

0 comments on commit b6d9454

Please sign in to comment.