removed half-assed prefixing of getcwd()

This commit is contained in:
Sarjuuk
2014-09-06 13:02:23 +02:00
parent ba49c55c6b
commit df3eb42ec0
3 changed files with 5 additions and 6 deletions

View File

@@ -660,7 +660,7 @@ class AjaxHandler
$id = $matches[1]; $id = $matches[1];
if (file_exists(CWD.'/uploads/avatars/'.$id.'.jpg')) if (file_exists('/uploads/avatars/'.$id.'.jpg'))
{ {
$offsetX = $offsetY = 0; $offsetX = $offsetY = 0;

View File

@@ -35,7 +35,7 @@ spl_autoload_register(function ($class) {
if (!class_exists('BaseType')) if (!class_exists('BaseType'))
require 'includes/types/basetype.class.php'; 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'; require 'includes/types/'.strtr($class, ['list' => '']).'.class.php';
return; 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('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('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; $e = CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0;
error_reporting($e); error_reporting($e);

View File

@@ -116,7 +116,7 @@ class GenericPage
if (preg_match('/[^\w\-]/i', $file)) if (preg_match('/[^\w\-]/i', $file))
return false; return false;
if (!is_file(CWD.$path.$file.'.tpl.php')) if (!is_file($path.$file.'.tpl.php'))
return false; return false;
return true; return true;
@@ -603,7 +603,7 @@ class GenericPage
if (CFG_DEBUG) if (CFG_DEBUG)
return; return;
$file = CWD.$this->cacheDir.$this->generateCacheKey(); $file = $this->cacheDir.$this->generateCacheKey();
$data = time()." ".AOWOW_REVISION." ".($saveString ? '1' : '0')."\n"; $data = time()." ".AOWOW_REVISION." ".($saveString ? '1' : '0')."\n";
if (!$saveString) if (!$saveString)
{ {
@@ -635,7 +635,7 @@ class GenericPage
if (CFG_DEBUG) if (CFG_DEBUG)
return false; return false;
$file = CWD.$this->cacheDir.$this->generateCacheKey(); $file = $this->cacheDir.$this->generateCacheKey();
if (!file_exists($file)) if (!file_exists($file))
return false; return false;