From: Mikael Nordfeldth Date: Mon, 7 Mar 2016 19:13:07 +0000 (+0100) Subject: Portability for filepath in File X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a3b265a4777e6cb217fd842e137d1b3028c7f0f8;p=quix0rs-gnu-social.git Portability for filepath in File --- diff --git a/classes/File.php b/classes/File.php index d6dd78cbef..20e1bc8344 100644 --- a/classes/File.php +++ b/classes/File.php @@ -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;