mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
addSepDir() doesn't add dir separator to empty string
also remove space from string
This commit is contained in:
parent
2bf7bd0a4e
commit
c1b28071df
|
@ -552,9 +552,11 @@ function get_extension($mimetype) { /* {{{ */
|
|||
* trailing directory separator
|
||||
*/
|
||||
function addDirSep($str) { /* {{{ */
|
||||
if(substr($str, -1, 1) != DIRECTORY_SEPARATOR)
|
||||
return $str.DIRECTORY_SEPARATOR;
|
||||
if(trim($str) == '')
|
||||
return '';
|
||||
if(substr(trim($str), -1, 1) != DIRECTORY_SEPARATOR)
|
||||
return trim($str).DIRECTORY_SEPARATOR;
|
||||
else
|
||||
return $str;
|
||||
return trim($str);
|
||||
} /* }}} */
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user