Portability for filepath in File

This commit is contained in:
Mikael Nordfeldth 2016-03-07 20:13:07 +01:00
parent 41b64cb8a3
commit a3b265a477
1 changed files with 2 additions and 2 deletions

View File

@ -347,8 +347,8 @@ class File extends Managed_DataObject
}
$dir = common_config('attachments', 'dir');
if ($dir[strlen($dir)-1] != '/') {
$dir .= '/';
if (!in_array($dir[mb_strlen($dir)-1], ['/', '\\'])) {
$dir .= DIRECTORY_SEPARATOR;
}
return $dir . $filename;