From 2c342df5a90dcfa48cd66cdda369f0944787d45a Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 3 Sep 2003 12:05:46 +0000
Subject: [PATCH] - Fix for bug #2691: crash due to locale module.  Patch by
 Bruno.

---
 modules/locale.module        | 2 +-
 modules/locale/locale.module | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/locale.module b/modules/locale.module
index ce7ea86d112b..9fbb3d38bff1 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -314,7 +314,7 @@ function locale($string) {
     $locale_t = unserialize($cache->data);
   }
 
-  if ($locale_t[$string] != "") {
+  if (array_key_exists($string, $locale_t)) {
     $string = $locale_t[$string];
   }
   else {
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index ce7ea86d112b..9fbb3d38bff1 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -314,7 +314,7 @@ function locale($string) {
     $locale_t = unserialize($cache->data);
   }
 
-  if ($locale_t[$string] != "") {
+  if (array_key_exists($string, $locale_t)) {
     $string = $locale_t[$string];
   }
   else {
-- 
GitLab