getUploadDir uses / = not always correct

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1231
Joined: 2019-05-21 22:42
Location: Germany
Contact:

getUploadDir uses / = not always correct

Post by onoehring » 2024-05-30 11:13

Hi,

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;

	}
(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

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: getUploadDir uses / = not always correct

Post by a.gneady » 2024-06-01 11:38

Sounds reasonable, Olaf. Will test it and include it in the next release. Thank you!
:idea: AppGini plugins to add more power to your apps:


Post Reply