From df3eb42ec0e130960d86f979e28a00c701c0ba1d Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 6 Sep 2014 13:02:23 +0200 Subject: [PATCH] removed half-assed prefixing of getcwd() --- includes/ajaxHandler.class.php | 2 +- includes/kernel.php | 3 +-- pages/genericPage.class.php | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/includes/ajaxHandler.class.php b/includes/ajaxHandler.class.php index c97233d7..80b5657c 100644 --- a/includes/ajaxHandler.class.php +++ b/includes/ajaxHandler.class.php @@ -660,7 +660,7 @@ class AjaxHandler $id = $matches[1]; - if (file_exists(CWD.'/uploads/avatars/'.$id.'.jpg')) + if (file_exists('/uploads/avatars/'.$id.'.jpg')) { $offsetX = $offsetY = 0; diff --git a/includes/kernel.php b/includes/kernel.php index 11794e38..ab940dac 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -35,7 +35,7 @@ spl_autoload_register(function ($class) { if (!class_exists('BaseType')) require 'includes/types/basetype.class.php'; - if (file_exists(CWD.'includes/types/'.strtr($class, ['list' => '']).'.class.php')) + if (file_exists('includes/types/'.strtr($class, ['list' => '']).'.class.php')) require 'includes/types/'.strtr($class, ['list' => '']).'.class.php'; return; @@ -72,7 +72,6 @@ foreach ($sets as $k => $v) define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1).'/static'); // points js to images & scripts (change here if you want to use a separate subdomain) define('HOST_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1)); // points js to executable files -define('CWD', strtr(getcwd(), ['\\' => '/']).'/'); $e = CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0; error_reporting($e); diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index cc0a01c6..42676310 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -116,7 +116,7 @@ class GenericPage if (preg_match('/[^\w\-]/i', $file)) return false; - if (!is_file(CWD.$path.$file.'.tpl.php')) + if (!is_file($path.$file.'.tpl.php')) return false; return true; @@ -603,7 +603,7 @@ class GenericPage if (CFG_DEBUG) return; - $file = CWD.$this->cacheDir.$this->generateCacheKey(); + $file = $this->cacheDir.$this->generateCacheKey(); $data = time()." ".AOWOW_REVISION." ".($saveString ? '1' : '0')."\n"; if (!$saveString) { @@ -635,7 +635,7 @@ class GenericPage if (CFG_DEBUG) return false; - $file = CWD.$this->cacheDir.$this->generateCacheKey(); + $file = $this->cacheDir.$this->generateCacheKey(); if (!file_exists($file)) return false;