Portability for filepath in File

This commit is contained in:
Mikael Nordfeldth 2016-03-07 20:13:07 +01:00
parent 41b64cb8a3
commit a3b265a477

View File

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