Skip to content

Commit

Permalink
inc/functions: check if $_GET value is empty before executing preg_match
Browse files Browse the repository at this point in the history
When using "canvas" mode, a lot of these errors were thrown:
> Invalid type instance in $_GET["ti"]: ""
> Invalid type instance in $_GET["pi"]: ""

Closes: #132
  • Loading branch information
pommi committed Dec 9, 2016
1 parent 6ff9188 commit 4aef0f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function GET($index = NULL, $value = NULL) {
return $arr;
}

if (!isset($_GET[$index]))
if (!isset($_GET[$index]) or strlen($_GET[$index]) == 0)
return NULL;

if ($value === NULL)
Expand Down

0 comments on commit 4aef0f7

Please sign in to comment.