Fixed: issues caused due to null in strtolower in admin translation controller

This commit is contained in:
vishalsingh.qlo325
2025-06-03 16:45:06 +05:30
parent aca1067b54
commit d007ed202d
2 changed files with 4 additions and 4 deletions

View File

@@ -1734,7 +1734,7 @@ class ToolsCore
public static function strtolower($str)
{
if (is_array($str)) {
if (is_array($str) || is_null($str)) {
return false;
}
if (function_exists('mb_strtolower')) {
@@ -1766,7 +1766,7 @@ class ToolsCore
public static function strtoupper($str)
{
if (is_array($str)) {
if (is_array($str) || is_null($str)) {
return false;
}
if (function_exists('mb_strtoupper')) {
@@ -1777,7 +1777,7 @@ class ToolsCore
public static function substr($str, $start, $length = false, $encoding = 'utf-8')
{
if (is_array($str)) {
if (is_array($str) || is_null($str))
return false;
}
if (function_exists('mb_substr')) {

View File

@@ -1112,7 +1112,7 @@ class AdminTranslationsControllerCore extends AdminController
foreach ($matches as $key) {
$md5_key = md5($key);
$module_key = '<{'.Tools::strtolower($module_name).'}'.strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key;
$module_key = '<{'.Tools::strtolower($module_name).'}'.Tools::strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key;
$default_key = '<{'.Tools::strtolower($module_name).'}prestashop>'.Tools::strtolower($template_name).'_'.$md5_key;
// to avoid duplicate entry
if (!in_array($module_key, $array_check_duplicate)) {