|
@@ -3,16 +3,17 @@
|
|
|
|
|
|
/** import supporting libraries */
|
|
|
require_once('IRouter.php');
|
|
|
+require_once('verysimple/HTTP/RequestUtil.php');
|
|
|
|
|
|
-/**
|
|
|
+/**
|
|
|
* Generic Router is an implementation of IRouter that uses patterns to connect
|
|
|
- * routes to a Controller/Method
|
|
|
- *
|
|
|
- * @package verysimple::Phreeze
|
|
|
- * @author VerySimple Inc.
|
|
|
- * @copyright 1997-2012 VerySimple, Inc.
|
|
|
- * @license http://www.gnu.org/licenses/lgpl.html LGPL
|
|
|
- * @version 1.0
|
|
|
+ * routes to a Controller/Method
|
|
|
+ *
|
|
|
+ * @package verysimple::Phreeze
|
|
|
+ * @author VerySimple Inc.
|
|
|
+ * @copyright 1997-2012 VerySimple, Inc.
|
|
|
+ * @license http://www.gnu.org/licenses/lgpl.html LGPL
|
|
|
+ * @version 1.0
|
|
|
*/
|
|
|
class GenericRouter implements IRouter
|
|
|
{
|
|
@@ -132,8 +133,8 @@ class GenericRouter implements IRouter
|
|
|
// if a root folder was provided, then we need to strip that out as well
|
|
|
if ($this->appRootUrl)
|
|
|
{
|
|
|
- $prefix = $this->appRootUrl.'/';
|
|
|
- while (substr($this->uri,0,strlen($prefix)) == $prefix)
|
|
|
+ $prefix = str_replace(RequestUtil::GetServerRootUrl(),'/',$this->appRootUrl);
|
|
|
+ if (substr($this->uri,0,strlen($prefix)) == $prefix)
|
|
|
{
|
|
|
$this->uri = substr($this->uri,strlen($prefix));
|
|
|
}
|