summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-21 11:20:30 -0700
committerBart Visscher <bartv@thisnet.nl>2013-07-21 11:20:30 -0700
commit639097db5945f0631f69441abfa9eaec610d4d8e (patch)
tree98d7c1df5dcc29f130ad90c87749be12e5da6aa0 /lib/template.php
parent9bf12da7504a04a05edf02286d9777d2235e7274 (diff)
parent11f28d78805674ea06ef9227cf922140bff4a4ae (diff)
downloadnextcloud-server-639097db5945f0631f69441abfa9eaec610d4d8e.tar.gz
nextcloud-server-639097db5945f0631f69441abfa9eaec610d4d8e.zip
Merge pull request #4092 from owncloud/base-better-errors
Generate better errors in base.php
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/template.php b/lib/template.php
index 08df168afc6..d48e3b36821 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -163,7 +163,7 @@ class OC_Template{
$this->renderas = $renderas;
$this->application = $app;
$this->vars = array();
- $this->vars['requesttoken'] = 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]);
@@ -225,6 +225,9 @@ class OC_Template{
*/
static public function getFormFactorExtension()
{
+ if (!\OC::$session) {
+ return '';
+ }
// if the formfactor is not yet autodetected do the
// autodetection now. For possible formfactors check the
// detectFormfactor documentation
@@ -529,6 +532,9 @@ class OC_Template{
$error_msg = '['.$exception->getCode().'] '.$error_msg;
}
$hint = $exception->getTraceAsString();
+ if (!empty($hint)) {
+ $hint = '<pre>'.$hint.'</pre>';
+ }
while (method_exists($exception,'previous') && $exception = $exception->previous()) {
$error_msg .= '<br/>Caused by: ';
if ($exception->getCode()) {