diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php index 6876c478da..d382d301f1 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php +++ b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php @@ -214,7 +214,7 @@ class FtpJob extends AbstractJob } } - $current_folder = \p4string::delEndSlash(str_replace('//', '/', $basefolder . $exportElement->getFolder())); + $current_folder = rtrim(str_replace('//', '/', $basefolder . $exportElement->getFolder()), '/'); if ($ftp_client->pwd() != $current_folder) { try { diff --git a/lib/classes/p4string.php b/lib/classes/p4string.php index 8c88326e1d..8f5f6680be 100644 --- a/lib/classes/p4string.php +++ b/lib/classes/p4string.php @@ -11,47 +11,6 @@ class p4string { - - public static function addFirstSlash($path) - { - if ($path == "") { - return("./"); - } - - $c = substr($path, 0, 1); - - if ($c != "/" && $c != "\\") { - return "/" . $path; - } - - return($path); - } - - public static function delFirstSlash($path) - { - if ($path == "/" || $path == "\\") { - return(""); - } - - $c = substr($path, 0, 1); - - if ($c == "/" || $c == "\\") { - return substr($path, 1, strlen($path)); - } - - $c = substr($path, 0, 2); - - if ($c == "\\") { - return substr($path, 2, strlen($path) - 1); - } - - if ($path == "") { - return "./"; - } - - return($path); - } - public static function addEndSlash($path) { if ($path == "") { @@ -67,30 +26,6 @@ class p4string return $path; } - public static function delEndSlash($path) - { - if ($path == "/" || $path == "\\") { - return(""); - } - - $c = substr($path, -1, 1); - - if ($c == "/" || $c == "\\") { - $path = substr($path, 0, strlen($path) - 1); - } - - if ($path == "") { - $path = "."; - } - - return($path); - } - - public static function cleanTags($string) - { - return strip_tags($string); //, '