X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/6b106efb4f8497f1bd9dc334683751508caa176e..b35c59521deae7405997a24cefd523d9e3592665:/search.php diff --git a/search.php b/search.php index 1932c28..7420dd2 100644 --- a/search.php +++ b/search.php @@ -27,12 +27,19 @@ if (isset($_POST['terms'])) { // GET } else { - $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); - $templateservice =& ServiceFactory::getServiceInstance('TemplateService'); - $userservice =& ServiceFactory::getServiceInstance('UserService'); + $sf = new ServiceFactory(); + $bookmarkservice =& $sf->getServiceInstance('BookmarkService'); + $templateservice =& $sf->getServiceInstance('TemplateService'); + $userservice =& $sf->getServiceInstance('UserService'); $logged_on_userid = $userservice->getCurrentUserId(); - 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); $tplvars = array(); $tplVars['loadjs'] = true;