summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-30 11:38:40 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-30 11:38:40 -0800
commit43cb6d9b56f802a5952d16b8412f8407dd8cf3c4 (patch)
tree97302e6c465e24fd47879cf81e0da171723d0563
parentdcba664f74439e37cc269df0cf549a2fee552aeb (diff)
Make the error page more robust in the case where there's a failure
early on in the framework code before we can load Gallery_I18n.php
-rw-r--r--modules/gallery/views/kohana/error.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gallery/views/kohana/error.php b/modules/gallery/views/kohana/error.php
index 7271db14..26628cf2 100644
--- a/modules/gallery/views/kohana/error.php
+++ b/modules/gallery/views/kohana/error.php
@@ -1,5 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? $error_id = uniqid("error") ?>
+<? if (!function_exists("t")) { function t($msg) { return $msg; } } ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">
@@ -131,7 +132,7 @@
</head>
<body>
<? try { $user = identity::active_user(); } catch (Exception $e) { } ?>
- <? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?>
+ <? $admin = php_sapi_name() == "cli" || (class_exists("User_Model") && isset($user) && $user->admin) ?>
<div class="big_box" id="framework_error">
<h1>
<?= t("Dang... Something went wrong!") ?>