Skip to content

Commit

Permalink
Make the error page more robust in the case where there's a failure
Browse files Browse the repository at this point in the history
early on in the framework code before we can load Gallery_I18n.php
  • Loading branch information
bharat committed Jan 30, 2010
1 parent dcba664 commit 43cb6d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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">
Expand Down Expand Up @@ -131,7 +132,7 @@ function koggle(elem) {
</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!") ?>
Expand Down

0 comments on commit 43cb6d9

Please sign in to comment.