Skip to content

Commit

Permalink
Merge pull request #8316 from sbulen/30_eval_fix
Browse files Browse the repository at this point in the history
[3.0] Fix eval return; set dir consistently throughnout
  • Loading branch information
Sesquipedalian authored Oct 8, 2024
2 parents b035a4a + 7ba18f9 commit fea936e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions Sources/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class Config
* Path to the cache directory for the file-based cache system.
*/
END,
'default' => 'dirname(__FILE__) . \'/cache\'',
'default' => '__DIR__ . \'/cache\'',
'raw_default' => true,
'type' => 'string',
],
Expand Down Expand Up @@ -745,7 +745,7 @@ class Config
* The absolute path to the forum's folder. (not just '.'!)
*/
END,
'default' => 'dirname(__FILE__)',
'default' => '__DIR__',
'raw_default' => true,
'type' => 'string',
],
Expand All @@ -757,7 +757,7 @@ class Config
* Path to the Sources directory.
*/
END,
'default' => 'dirname(__FILE__) . \'/Sources\'',
'default' => '__DIR__ . \'/Sources\'',
'raw_default' => true,
'type' => 'string',
],
Expand All @@ -769,7 +769,7 @@ class Config
* Path to the Packages directory.
*/
END,
'default' => 'dirname(__FILE__) . \'/Packages\'',
'default' => '__DIR__ . \'/Packages\'',
'raw_default' => true,
'type' => 'string',
],
Expand Down Expand Up @@ -920,7 +920,7 @@ public static function set(array $settings): void
'__DIR__' => var_export(dirname(SMF_SETTINGS_FILE), true),
]);

self::${$var} = eval($default . ';');
self::${$var} = eval('return ' . $default . ';');
} else {
self::${$var} = $def['default'];
}
Expand Down
12 changes: 6 additions & 6 deletions other/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
*
* Path to the cache directory for the file-based cache system.
*/
$cachedir = dirname(__FILE__) . '/cache';
$cachedir = __DIR__ . '/cache';

########## Image Proxy ##########
/**
Expand Down Expand Up @@ -202,25 +202,25 @@
*
* The absolute path to the forum's folder. (not just '.'!)
*/
$boarddir = dirname(__FILE__);
$boarddir = __DIR__;
/**
* @var string
*
* Path to the Sources directory.
*/
$sourcedir = dirname(__FILE__) . '/Sources';
$sourcedir = __DIR__ . '/Sources';
/**
* @var string
*
* Path to the Packages directory.
*/
$packagesdir = dirname(__FILE__) . '/Packages';
$packagesdir = __DIR__ . '/Packages';
/**
* @var string
*
* Path to the language directory.
*/
$languagesdir = dirname(__FILE__) . '/Languages';
$languagesdir = __DIR__ . '/Languages';

######### Modification Support #########
/**
Expand All @@ -242,7 +242,7 @@
*/
$db_character_set = 'utf8';

if (file_exists(dirname(__FILE__) . '/install.php'))
if (file_exists(__DIR__ . '/install.php'))
{
$secure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
Expand Down
12 changes: 6 additions & 6 deletions other/Settings_bak.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
*
* Path to the cache directory for the file-based cache system.
*/
$cachedir = dirname(__FILE__) . '/cache';
$cachedir = __DIR__ . '/cache';

########## Image Proxy ##########
/**
Expand Down Expand Up @@ -202,25 +202,25 @@
*
* The absolute path to the forum's folder. (not just '.'!)
*/
$boarddir = dirname(__FILE__);
$boarddir = __DIR__;
/**
* @var string
*
* Path to the Sources directory.
*/
$sourcedir = dirname(__FILE__) . '/Sources';
$sourcedir = __DIR__ . '/Sources';
/**
* @var string
*
* Path to the Packages directory.
*/
$packagesdir = dirname(__FILE__) . '/Packages';
$packagesdir = __DIR__ . '/Packages';
/**
* @var string
*
* Path to the language directory.
*/
$languagesdir = dirname(__FILE__) . '/Languages';
$languagesdir = __DIR__ . '/Languages';

######### Modification Support #########
/**
Expand All @@ -242,7 +242,7 @@
*/
$db_character_set = 'utf8';

if (file_exists(dirname(__FILE__) . '/install.php'))
if (file_exists(__DIR__ . '/install.php'))
{
$secure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
Expand Down

0 comments on commit fea936e

Please sign in to comment.