From bae1e1757d4774e414bef2609433fa186448ae6c Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 9 Aug 2007 22:06:39 +0000 Subject: [PATCH] Hide errors in safe mode git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39799 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Core.php | 4 ++-- core/Session.php | 5 +++++ main.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/Core.php b/core/Core.php index 02956db90..966f08539 100755 --- a/core/Core.php +++ b/core/Core.php @@ -15,13 +15,13 @@ function getTempFolder() { } $ssTmp = "$sysTmp/silverstripe-cache"; - if(!file_exists($ssTmp)) { + if(!@file_exists($ssTmp)) { @$worked = mkdir($ssTmp); } if(!$worked) { $ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . "/silverstripe-cache"; $worked = true; - if(!file_exists($ssTmp)) { + if(!@file_exists($ssTmp)) { @$worked = mkdir($ssTmp); } } diff --git a/core/Session.php b/core/Session.php index 0c141f051..16b99dbbc 100644 --- a/core/Session.php +++ b/core/Session.php @@ -42,6 +42,11 @@ class Session { public static function get($name) { $names = explode('.', $name); + + if(!isset($_SESSION)) { + return null; + } + $var = $_SESSION; foreach($names as $n) { diff --git a/main.php b/main.php index d108f2908..283d9efb8 100644 --- a/main.php +++ b/main.php @@ -37,7 +37,7 @@ Session::start(); $envFiles = array('../_ss_environment.php', '../../_ss_environment.php', '../../../_ss_environment.php'); foreach($envFiles as $envFile) { - if(file_exists($envFile)) { + if(@file_exists($envFile)) { include($envFile); break; }