diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-02-17 16:26:48 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-02-17 16:26:48 +0000 |
commit | c93bcff8b85a24fe200fe27bd4c8f860f7d01b9c (patch) | |
tree | 907b6ba0ca2453fe108c9e8750840ff525cc5998 | |
parent | 33930b56b779e4e48aef05506fce28a76debd572 (diff) | |
download | brdo-c93bcff8b85a24fe200fe27bd4c8f860f7d01b9c.tar.gz brdo-c93bcff8b85a24fe200fe27bd4c8f860f7d01b9c.tar.bz2 |
*** empty log message ***
-rw-r--r-- | modules/locale.module | 8 | ||||
-rw-r--r-- | modules/locale/locale.module | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/locale.module b/modules/locale.module index 8a1c3e1ac..43fd06587 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -83,9 +83,11 @@ function locale_admin() { function locale($string) { global $locale; - $result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0"); - if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string; - else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')"); + if ($locale) { + $result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0"); + if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string; + else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')"); + } return $string; } diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 8a1c3e1ac..43fd06587 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -83,9 +83,11 @@ function locale_admin() { function locale($string) { global $locale; - $result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0"); - if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string; - else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')"); + if ($locale) { + $result = db_query("SELECT id, $locale FROM locales WHERE STRCMP(string, '". addslashes($string) ."') = 0"); + if ($translation = db_fetch_object($result)) $string = ($translation->$locale) ? check_output($translation->$locale) : $string; + else db_query("INSERT INTO locales (string, location) VALUES ('". addslashes($string) ."', '". check_input(getenv("REQUEST_URI")) ."')"); + } return $string; } |