diff --git a/lib/template.php b/lib/template.php
index 9ad1a330d4fcef269c1b7d8516a3a3ffec120e3b..9b16ed94661080eedec398b3be7c6883226f7f74 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -181,7 +181,7 @@ class OC_Template{
 		$this->renderas = $renderas;
 		$this->application = $app;
 		$this->vars = array();
-		$this->vars['requesttoken'] = OC::$session && OC_Util::callRegister();
+		$this->vars['requesttoken'] = OC::$session ? OC_Util::callRegister() : '';
 		$parts = explode('/', $app); // fix translation when app is something like core/lostpassword
 		$this->l10n = OC_L10N::get($parts[0]);