Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Fix eval return; set dir consistently throughnout #8316

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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\'',
sbulen marked this conversation as resolved.
Show resolved Hide resolved
'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__',
sbulen marked this conversation as resolved.
Show resolved Hide resolved
'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\'',
sbulen marked this conversation as resolved.
Show resolved Hide resolved
'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\'',
sbulen marked this conversation as resolved.
Show resolved Hide resolved
'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 . ';');
sbulen marked this conversation as resolved.
Show resolved Hide resolved
} 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
Loading