F diff --git a/php/node.php b/php/node.php --- a/php/node.php +++ b/php/node.phpfunction get_directory(string $abstract_path,User $user){global $database;- if($abstract_path[0]!="/")- {+ if($abstract_path[0] != "/") {return NULL;}- if($component=strtok($abstract_path,"/")==false)- {- return $user->home_directory;- }- $current_dir=$database->get_node_id($component,$user->home_directory);- if($current_dir==NULL)- return NULL;- /*traverse path*/- while($component=strtok("/"))- {- $current_dir=$database->get_node_id($component,$current_dir);- if($current_dir==NULL)- return NULL;- }++ $component = strtok($abstract_path,"/");+ $current_dir = $user->home_directory;++ while ($component) {+ $current_dir = $database->get_node_id($component, $current_dir);+ $component = strtok("/");+ };+return $current_dir;}