From 2664ece9e14e9d4b73125f44611f234345371c0a Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 19 Jul 2018 03:11:57 -0400 Subject: 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. --- app/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/index.php') 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))); ?> -- cgit v1.2.3