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; }