diff --git a/class2.php b/class2.php index 653d08b5c2..48cdc68d3c 100755 --- a/class2.php +++ b/class2.php @@ -698,7 +698,7 @@ define('SITEADMIN', $pref['siteadmin']); define('SITEADMINEMAIL', $pref['siteadminemail']); define('SITEDISCLAIMER', $tp->toHTML($pref['sitedisclaimer'], '', 'emotes_off,defs')); -define('SITECONTACTINFO', $tp->toHTML($pref['sitecontactinfo'], true, 'emotes_off,defs')); +define('SITECONTACTINFO', (!empty($pref['sitecontactinfo']) ? $tp->toHTML($pref['sitecontactinfo'], true, 'emotes_off,defs') : '')); define('SITEEMAIL', vartrue($pref['replyto_email'],$pref['siteadminemail'])); define('USER_REGISTRATION', vartrue($pref['user_reg'],false)); // User Registration System Active or Not. define('e_DEVELOPER', $developerMode); diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index 881fb71508..f8bfe84182 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -1080,10 +1080,18 @@ public function run() if(!$valid) { + if($this->debug) + { + error_log('e107: Invalid token used for cron class'); + } return false; } - @file_put_contents(e_CACHE . 'cronLastLoad.php', time()); + if(!@file_put_contents(e_CACHE . 'cronLastLoad.php', time())) + { + error_log('e107: Unable to write to: '.e_CACHE . 'cronLastLoad.php. Permissions issue?'); + } + // Get active cron jobs. $cron_jobs = $this->getCronJobs(true); @@ -1260,6 +1268,11 @@ public function validateToken() $pwd = str_replace('token=', '', $pwd); } + if($this->debug) + { + error_log("Cron Token: ".$pwd, E_NOTICE); + } + if(empty($this->pref['e_cron_pwd']) || (varset($this->pref['e_cron_pwd']) != $pwd)) { if(!empty($pwd)) diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 4dfb390fd2..8ce423c4bd 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -5027,7 +5027,14 @@ public function set_paths() $path = dirname(self::getRelativePath(getcwd(), $target_path)) . "/"; - $http_path = dirname($_SERVER['SCRIPT_NAME']); + $SCRIPT_NAME = !empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : ''; + + if(empty($SCRIPT_NAME) && !empty($_SERVER['_'])) + { + $SCRIPT_NAME = $_SERVER['_']; + } + + $http_path = dirname($SCRIPT_NAME); $http_path = explode("/", $http_path); for ($i = 0; $i < substr_count($path, "../"); $i ++) {