Skip to content

Commit 29304dd

Browse files
authored
Merge pull request #967 from menkaff/master
Fix pathinfo problem with Persian characters
2 parents d3bac1f + 89a1a60 commit 29304dd

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/Lfm.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function config($key)
4646
*/
4747
public function getNameFromPath($path)
4848
{
49+
setlocale(LC_ALL, 'en_US.UTF-8');
4950
return pathinfo($path, PATHINFO_BASENAME);
5051
}
5152

src/LfmPath.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ private function uploadValidator($file)
277277

278278
private function getNewName($file)
279279
{
280+
setlocale(LC_ALL, 'en_US.UTF-8');
280281
$new_file_name = $this->helper
281282
->translateFromUtf8(trim(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)));
282283

src/LfmStorageRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function makeDirectory()
6666

6767
public function extension()
6868
{
69+
setlocale(LC_ALL, 'en_US.UTF-8');
6970
return pathinfo($this->path, PATHINFO_EXTENSION);
7071
}
7172
}

0 commit comments

Comments
 (0)