- list($url, $range, $terms, $page) = explode('/', $_SERVER['PATH_INFO']);
+
+ # explode the path
+ $path_exploded = explode('/', $_SERVER['PATH_INFO']);
+ $url = (count($path_exploded) > 0 ? $path_exploded[0] : NULL);
+ $range = (count($path_exploded) > 1 ? $path_exploded[1] : NULL);
+ $terms = (count($path_exploded) > 2 ? $path_exploded[2] : NULL);
+ $page = (count($path_exploded) > 3 ? $path_exploded[3] : NULL);