Script rewritten to setConfigEntry(), getConfig() and incrementConfigEntry()
[mailer.git] / inc / functions.php
index 6f668fc188a1775352b19ec101e1b93074eb1597..492bd3e90c4e59d0f2ea4f9c3b9ea2ced0ff7274 100644 (file)
@@ -583,10 +583,8 @@ function MAKE_DATETIME ($time, $mode="0")
 
 // Translates the american decimal dot into a german comma
 function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
-       global $_CONFIG;
-
        // Default is 3 you can change this in admin area "Misc -> Misc Options"
-       if (getConfig('max_comma') == null) $_CONFIG['max_comma'] = "3";
+       if (getConfig('max_comma') == null) setConfigEntry('max_comma', "3");
 
        // Use from config is default
        $maxComma = getConfig('max_comma');
@@ -2867,6 +2865,17 @@ function getConfig ($entry) {
        return $value;
 }
 
+// Setter for $_CONFIG entries
+function setConfigEntry ($entry, $value) {
+       global $_CONFIG;
+
+       // Secure the entry name
+       $entry = SQL_ESCAPE($entry);
+
+       // And set it
+       $_CONFIG[$entry] = $value;
+}
+
 // @TODO Rewrite all language constants to this function.
 // "Getter" for language strings
 function getMessage ($messageId) {