mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
- re-add script_path for "strange configurations" to let them force the generated urls correctly
- show rank title if no rank image present in memberlist - other fixes. git-svn-id: file:///svn/phpbb/trunk@6730 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -408,6 +408,35 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
$cfg_array[$config_name] = (int) $cfg_array[$config_name];
|
||||
break;
|
||||
|
||||
// Absolute path
|
||||
case 'script_path':
|
||||
if (!$cfg_array[$config_name])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$destination = str_replace('\\', '/', $cfg_array[$config_name]);
|
||||
|
||||
if ($destination !== '/')
|
||||
{
|
||||
// Adjust destination path (no trailing slash)
|
||||
if (substr($destination, -1, 1) == '/')
|
||||
{
|
||||
$destination = substr($destination, 0, -1);
|
||||
}
|
||||
|
||||
$destination = str_replace(array('../', './'), '', $destination);
|
||||
|
||||
if ($destination[0] != '/')
|
||||
{
|
||||
$destination = '/' . $destination;
|
||||
}
|
||||
}
|
||||
|
||||
$cfg_array[$config_name] = trim($destination);
|
||||
|
||||
break;
|
||||
|
||||
// Relative path (appended $phpbb_root_path)
|
||||
case 'rpath':
|
||||
case 'rwpath':
|
||||
@@ -419,9 +448,9 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
$destination = $cfg_array[$config_name];
|
||||
|
||||
// Adjust destination path (no trailing slash)
|
||||
if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\')
|
||||
if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
|
||||
{
|
||||
$destination = substr($destination, 0, sizeof($destination)-2);
|
||||
$destination = substr($destination, 0, -1);
|
||||
}
|
||||
|
||||
$destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
|
||||
|
Reference in New Issue
Block a user