From 19907b188ac7fbe79f75e7197f8384a281be34c3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 1 Aug 2018 11:11:16 +0200 Subject: [PATCH] Some more basename replacing with Vfs::basename to avoid setlocale issue. --- api/src/Image.php | 2 +- api/src/Link.php | 2 +- api/src/Mail.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/Image.php b/api/src/Image.php index ae53a1f4b6..8bfa9593ea 100644 --- a/api/src/Image.php +++ b/api/src/Image.php @@ -100,7 +100,7 @@ class Image */ protected static function get_extension($path, &$name=null) { - $parts = explode('.', basename($path)); + $parts = explode('.', Vfs::basename($path)); $ext = array_pop($parts); $name = implode('.', $parts); return $ext; diff --git a/api/src/Link.php b/api/src/Link.php index c191762b7e..8f5b3cfcfb 100644 --- a/api/src/Link.php +++ b/api/src/Link.php @@ -1287,7 +1287,7 @@ class Link extends Link\Storage $link = self::get_link(-$app); if($link['app2'] && $link['id2']) { - Storage\History::static_add($link['app2'],$link['id2'],$GLOBALS['egw_info']['user']['account_id'],'~file~','', basename($url)); + Storage\History::static_add($link['app2'],$link['id2'],$GLOBALS['egw_info']['user']['account_id'],'~file~','', Vfs::basename($url)); } } if (($Ok = !file_exists($url) || Vfs::remove($url,true)) && ((int)$app > 0 || $fname)) diff --git a/api/src/Mail.php b/api/src/Mail.php index 98cb04b41c..d8e181cbe1 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -6760,7 +6760,7 @@ class Mail // do not change urls for absolute images (thanks to corvuscorax) if (substr($url, 0, 5) !== 'data:') { - $filename = basename($url); + $filename = Vfs::basename($url); if (($directory = dirname($url)) == '.') $directory = ''; $ext = pathinfo($filename, PATHINFO_EXTENSION); $mimeType = MimeMagic::ext2mime($ext);