mirror of
https://github.com/flarum/core.git
synced 2025-07-29 20:50:28 +02:00
Don't use array_filter flag (PHP 5.6 only)
This commit is contained in:
@@ -312,12 +312,14 @@ abstract class AbstractClientController extends AbstractHtmlController
|
|||||||
*/
|
*/
|
||||||
protected function filterTranslations(array $translations, array $keys)
|
protected function filterTranslations(array $translations, array $keys)
|
||||||
{
|
{
|
||||||
return array_filter($translations, function ($id) use ($keys) {
|
$filtered = array_filter(array_keys($translations), function ($id) use ($keys) {
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
if (substr($id, 0, strlen($key)) === $key) {
|
if (substr($id, 0, strlen($key)) === $key) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, ARRAY_FILTER_USE_KEY);
|
});
|
||||||
|
|
||||||
|
return array_only($translations, $filtered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user