From a3b265a4777e6cb217fd842e137d1b3028c7f0f8 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 7 Mar 2016 20:13:07 +0100 Subject: [PATCH] Portability for filepath in File --- classes/File.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5