From d58417ac900c3abaa4fcb9a8b443a72bc2c1287b Mon Sep 17 00:00:00 2001 From: Daniele Rosario Date: Wed, 13 Mar 2019 10:44:51 +0100 Subject: [PATCH] Deal with possible wrong translation keys being used --- src/Manager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Manager.php b/src/Manager.php index 4ff5824..5296ceb 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -371,7 +371,14 @@ public function getKeysExistingInALanguageButNotTheOther($values) // other languages. Those keys combined with ones with values = '' // will be sent to the console user to fill and save in disk. foreach ($values as $key => $value) { - list($fileName, $languageKey, $key) = explode('.', $key, 3); + $parts = explode('.', $key, 3); + + // Some wrong translation key being used? + if (count($parts) < 3) { + continue; + } + + list($fileName, $languageKey, $key) = $parts; if (in_array("{$fileName}.{$key}", $searched)) { continue;