summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-07-19 03:11:57 -0400
committerMalf Furious <m@lfurio.us>2018-07-19 03:11:57 -0400
commit2664ece9e14e9d4b73125f44611f234345371c0a (patch)
tree94719232a5c51fbff92f3904adbb2c0114c80df5
parent57b9b6afe8f3e7d87b327b68861be2011e0d69ee (diff)
downloadscrott-2664ece9e14e9d4b73125f44611f234345371c0a.tar.gz
scrott-2664ece9e14e9d4b73125f44611f234345371c0a.zip
Fix bug in index.php
Perform minor sanitization on the input $_SERVER['PATH_INFO']. This commit adds logic that strips empty strings from main's $argv array. The pass to array_values() is to discard original $tokens array keys and re-number them starting from zero.
-rw-r--r--app/index.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/index.php b/app/index.php
index e883eff..3fee675 100644
--- a/app/index.php
+++ b/app/index.php
@@ -68,6 +68,7 @@ function main(array $argv) : void
}
}
-main(explode("/", $_SERVER['PATH_INFO']));
+$tokens = explode("/", $_SERVER['PATH_INFO']);
+main(array_values(array_filter($tokens)));
?>