Skip to content

Commit 89a1a60

Browse files
committed
Fix pathinfo problem with Persian characters
1 parent a2c390b commit 89a1a60

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
@@ -270,6 +270,7 @@ private function uploadValidator($file)
270270

271271
private function getNewName($file)
272272
{
273+
setlocale(LC_ALL, 'en_US.UTF-8');
273274
$new_file_name = $this->helper
274275
->translateFromUtf8(trim(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)));
275276

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)