mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Don't use array_filter flag (PHP 5.6 only)
This commit is contained in:
parent
d237dc84aa
commit
c0e3cb1833
|
@ -312,12 +312,14 @@ abstract class AbstractClientController extends AbstractHtmlController
|
|||
*/
|
||||
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) {
|
||||
if (substr($id, 0, strlen($key)) === $key) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}, ARRAY_FILTER_USE_KEY);
|
||||
});
|
||||
|
||||
return array_only($translations, $filtered);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user