We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 698a511 commit 5a187beCopy full SHA for 5a187be
src/App/src/Middleware/TranslatorMiddleware.php
@@ -55,9 +55,11 @@ public function __construct(
55
*/
56
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
57
{
58
+ $cookieKey = $this->translatorConfig['cookie']['name'];
59
+
60
// add language key
- if (!empty($_COOKIE[$this->translatorConfig['cookie']['name']])) {
- $languageKey = $_COOKIE[$this->translatorConfig['cookie']['name']];
61
+ if (isset($_COOKIE[$cookieKey]) && array_key_exists($_COOKIE[$cookieKey], $this->translatorConfig['locale'])) {
62
+ $languageKey = $_COOKIE[$cookieKey];
63
} else {
64
$languageKey = $this->translatorConfig['default'];
65
0 commit comments