addSepDir() doesn't add dir separator to empty string

also remove space from string
This commit is contained in:
Uwe Steinmann 2015-07-28 07:32:29 +02:00
parent 2bf7bd0a4e
commit c1b28071df

View File

@ -552,9 +552,11 @@ function get_extension($mimetype) { /* {{{ */
* trailing directory separator * trailing directory separator
*/ */
function addDirSep($str) { /* {{{ */ function addDirSep($str) { /* {{{ */
if(substr($str, -1, 1) != DIRECTORY_SEPARATOR) if(trim($str) == '')
return $str.DIRECTORY_SEPARATOR; return '';
if(substr(trim($str), -1, 1) != DIRECTORY_SEPARATOR)
return trim($str).DIRECTORY_SEPARATOR;
else else
return $str; return trim($str);
} /* }}} */ } /* }}} */
?> ?>