Require router in url builder function
Require router in url builder function

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -537,13 +537,6 @@
 			$requesturl = substr($requesturl, 0, $querypos);
 		$this->tpl->assign('requesturl', $requesturl);
 		
-		if ($this->config->GetValue('abbreviateurl')) {
-			$this->tpl->assign('abbreviateurl', true);
-		}
-
-		if ($this->config->GetValue('cleanurl')) {
-			$this->tpl->assign('cleanurl', true);
-		}
 		if ($this->router) {
 			$this->router->SetCleanUrl($this->config->GetValue('cleanurl') ? true : false);
 			$this->router->SetAbbreviate($this->config->GetValue('abbreviateurl') ? true : false);

--- a/include/smartyplugins/function.geturl.php
+++ b/include/smartyplugins/function.geturl.php
@@ -38,9 +38,8 @@
 
 	$router = $template->getTemplateVars('router');
 	if (!$router) {
-		$clean = $template->getTemplateVars('cleanurl');
-		$abbreviate = $template->getTemplateVars('abbreviateurl');
-		$router = new GitPHP_Router($clean, $abbreviate);
+		trigger_error("geturl: missing router");
+		return;
 	}
 	$fullurl = $router->GetUrl($url, $params);
 	if ($escape)

comments