Skip to content

EspoCRM – Open Source CRM Application

Language read fix

Yuriib3523823f612
diff --git a/application/Espo/Core/Utils/Language.php b/application/Espo/Core/Utils/Language.php
index 17752e8ff5..c748e45288 100644
--- a/application/Espo/Core/Utils/Language.php
+++ b/application/Espo/Core/Utils/Language.php
@@ -431,6 +431,10 @@ class Language
$cacheKey = $this->getCacheKey($language);
if (!$this->useCache || !$this->dataCache->has($cacheKey) || $reload) {
+ if ($language !== basename($language)) {
+ throw new RuntimeException("Bad language value.");
+ }
+
$readerParams = ResourceReaderParams
::create()
->withNoCustom($this->noCustom);