Browse Source

Update index.php

made sure that the path is splitted into parts and and all values are properly initialized.
j-ed 12 years ago
parent
commit
7273e1c6f9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      index.php

+ 3 - 1
index.php

@@ -88,7 +88,9 @@
     // ensure that we got a valid request
     if ( !$path ) 
         report_problem("Invalid request, this was not a firefox sync request!", 400);
-    list($version, $username, $function, $collection, $id) = explode('/', $path.'///');
+
+    // split path into parts and make sure that all values are properly initialized
+    list($version, $username, $function, $collection, $id) = array_pad(explode('/', $path.'///'), 5, '');
     
     if($version == 'user' || $version == 'misc')
     {