From 9727abd22bb06533e0c589e95023893d4d850e11 Mon Sep 17 00:00:00 2001 From: Emre Kara Date: Tue, 23 Feb 2021 09:13:54 +0300 Subject: [PATCH] Update Lfm.php Fix Error file moving file: mb_detect_encoding() expects parameter 1 to be string, array given --- src/Lfm.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Lfm.php b/src/Lfm.php index 457b68f2..857ca6a1 100644 --- a/src/Lfm.php +++ b/src/Lfm.php @@ -206,11 +206,24 @@ public function allowShareFolder() */ public function translateFromUtf8($input) { + $rInput = []; + if ($this->isRunningOnWindows()) { - $input = iconv('UTF-8', mb_detect_encoding($input), $input); + // $input = iconv('UTF-8', mb_detect_encoding($input), $input); + + if (is_array($input)) { + foreach ($input as $k => $i) { + $rInput[] = iconv('UTF-8', mb_detect_encoding($i), $i); + } + } else { + $rInput = $input; + } + } else { + $rInput = $input; } - return $input; + return $rInput; + // return $input; } /**