Fix for cron uploader issue with root paths ending in a slash
This commit is contained in:
parent
12c331cbd2
commit
e1aefb78ab
1 changed files with 7 additions and 1 deletions
|
@ -364,7 +364,13 @@ class CronUploader extends Extension
|
||||||
|
|
||||||
private function move_uploaded(string $path, string $filename, string $output_subdir, bool $corrupt = false)
|
private function move_uploaded(string $path, string $filename, string $output_subdir, bool $corrupt = false)
|
||||||
{
|
{
|
||||||
$relativeDir = dirname(substr($path, strlen(CronUploaderConfig::get_dir()) + 7));
|
$rootDir = CronUploaderConfig::get_dir();
|
||||||
|
$rootLength = strlen($rootDir);
|
||||||
|
if ($rootDir[$rootLength-1]=="/"||$rootDir[$rootLength-1]=="\\") {
|
||||||
|
$rootLength--;
|
||||||
|
}
|
||||||
|
|
||||||
|
$relativeDir = dirname(substr($path, $rootLength + 7));
|
||||||
|
|
||||||
if ($relativeDir==".") {
|
if ($relativeDir==".") {
|
||||||
$relativeDir = "";
|
$relativeDir = "";
|
||||||
|
|
Reference in a new issue