mirror of
https://github.com/flarum/core.git
synced 2025-07-20 16:21:18 +02:00
Use more precise regex to prevent some translations being compiled unnecessarily
This commit is contained in:
@@ -32,7 +32,7 @@ class ClientController extends BaseClientController
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $translations = '/[^\.]\.(admin|lib)\.*+/';
|
protected $translations = '/^[^\.]+\.(?:admin|lib)\./';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ExtensionManager
|
* @var ExtensionManager
|
||||||
|
@@ -29,7 +29,7 @@ class ClientController extends AbstractClientController
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
protected $translations = '/[^\.]\.(forum|lib)\.*+/';
|
protected $translations = '/^[^\.]+\.(?:forum|lib)\./';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Formatter
|
* @var Formatter
|
||||||
|
@@ -308,9 +308,7 @@ abstract class AbstractClientController extends AbstractHtmlController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filtered = array_filter(array_keys($translations), function ($id) {
|
$filtered = array_filter(array_keys($translations), function ($id) {
|
||||||
if (preg_match($this->translations, $id)) {
|
return preg_match($this->translations, $id);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return array_only($translations, $filtered);
|
return array_only($translations, $filtered);
|
||||||
|
Reference in New Issue
Block a user