Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
made sure that all values are properly initialized
Browse files Browse the repository at this point in the history
made sure that the path is splitted into parts and and all values are properly initialized.
  • Loading branch information
j-ed committed Oct 16, 2012
1 parent c5a6001 commit 9b8208b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion user.php
Expand Up @@ -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);
Expand Down

0 comments on commit 9b8208b

Please sign in to comment.