From 9b8208b2897f6293438da006ffb7013da2469c2f Mon Sep 17 00:00:00 2001 From: j-ed Date: Tue, 16 Oct 2012 16:16:44 +0300 Subject: [PATCH] made sure that all values are properly initialized made sure that the path is splitted into parts and and all values are properly initialized. --- user.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user.php b/user.php index 7017a6c..c6fb48b 100644 --- a/user.php +++ b/user.php @@ -42,7 +42,9 @@ report_problem("No path found", 404); } $path = substr($path, 1); #chop the lead slash - list($preinstr, $version, $username, $function, $collection, $id) = explode('/', $path.'///'); + // split path into parts and make sure that all values are properly initialized + list($preinstr, $version, $username, $function, $collection, $id) = array_pad(explode('/', $path.'///'), 6, ''); + log_error("Pfad:".$path); if( $preinstr != 'user' && $preinstr != 'misc' ) report_problem('Function not found', 404);