1
0
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:
Toby Zerner
2015-10-20 22:25:20 +10:30
parent d237dc84aa
commit c0e3cb1833

View File

@@ -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);
} }
} }