Fix for bad check on $grav_basedir

This commit is contained in:
Andy Miller 2019-08-15 14:24:40 -06:00
parent 9ed3da3df2
commit 182970eb78
No known key found for this signature in database
GPG Key ID: E82B8D0EAB94EFB9

View File

@ -20,9 +20,7 @@ if (is_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_N
$grav_index = 'index.php';
/* Check the GRAV_BASEDIR environment variable and use if set */
$grav_basedir = getenv('GRAV_BASEDIR') ?: '';
if (isset($grav_basedir)) {
if ($grav_basedir = getenv('GRAV_BASEDIR') ?: '') {
$grav_index = ltrim($grav_basedir, '/') . DIRECTORY_SEPARATOR . $grav_index;
$grav_basedir = DIRECTORY_SEPARATOR . trim($grav_basedir, DIRECTORY_SEPARATOR);
define('GRAV_ROOT', str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . $grav_basedir);