getUploadDir uses / = not always correct
Posted: 2024-05-30 11:13
Hi,
I suggest in the function getUploadDir (in incFunctions.php) the following change (untested code)
(changes lines moves to the left)
Why?
This code should produce a correct string for the operating system. PHP takes care of the wrong character (if used) but for our own string handling in own functions it would be easier to have the correct trailing character.
Olaf
I suggest in the function getUploadDir (in incFunctions.php) the following change (untested code)
Code: Select all
function getUploadDir($dir = '') {
if($dir == '') $dir = config('adminConfig')['baseUploadPath'];
$dir = rtrim($dir, '\\/');
$dir = rtrim($dir, '\\');
$dir .= DIRECTORY_SEPARATOR
return $dir;
}
Why?
This code should produce a correct string for the operating system. PHP takes care of the wrong character (if used) but for our own string handling in own functions it would be easier to have the correct trailing character.
Olaf