Fix error TypeError: mb_detect_encoding(): Argument #1 ($string) must be of type string, array given in file Lfm.php with change method translateFromUtf8 #1234
TypeError: mb_detect_encoding(): Argument #1 ($string) must be of type string, array given in file C:\laragon\www\laravel\glagalinggah-cms\vendor\unisharp\laravel-filemanager\src\Lfm.php on line 237
I replace method translateFromUtf8($input) from
public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
}
return $input;
}
To
public function translateFromUtf8($input)
{
if ($this->isRunningOnWindows()) {
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 $rInput;
}
I hove this fix cant be merge, i get error message in my server, thanks
Summary of the change:
Fix error in windows os for feature File Moving
I replace method
translateFromUtf8($input)
fromTo
I hove this fix cant be merge, i get error message in my server, thanks