Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function handle() {
$lang_keep = $u_langs;
}

$lang_keep = array_values(array_filter(array_unique($lang_keep)));
$lang_keep = array_values(array_filter((array)array_unique($lang_keep)));
$d->lang_keep =& $lang_keep;

/* Does the language we want to keep actually exist ? */
Expand Down Expand Up @@ -352,7 +352,7 @@ private function list_languages () {
/* Returns the subfolders of $dir as an array */
$dir_subfolders = function ($dir) {
$sub = scandir($dir);
$sub = array_filter ($sub, function ($e) use ($dir) {
$sub = array_filter ((array)$sub, function ($e) use ($dir) {
return is_dir ("$dir/$e")
&& !in_array ($e, array('.', '..'));
} );
Expand Down Expand Up @@ -394,14 +394,14 @@ private function list_languages () {
* Signature: ^Lang, Array => ^Lang */
private function _filter_out_lang ($e, $lang_keep) {
// Recursive function with cases being an array of arrays, or an array
if (count ($e) > 0 && is_array (array_values($e)[0])) {
if (count ((array)$e) > 0 && is_array (array_values($e)[0])) {
foreach ($e as $k => $elt) {
$out[$k] = $this->_filter_out_lang ($elt, $lang_keep);
}
return $out;

} else {
return array_filter ($e, function ($v) use ($lang_keep) {
return array_filter ((array)$e, function ($v) use ($lang_keep) {
return !in_array ($v, $lang_keep);
});
}
Expand Down