]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Fixed handling of float values, ext-surfbar continued:
[mailer.git] / inc / modules / admin / admin-inc.php
index 8e3bd823adae8b7b4f1937b30d7d6d4f9603d80e..860301125b7522138f9a0cc3320a303c37177bf2 100644 (file)
@@ -559,6 +559,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
        $skip = FALSE;
 
        // Now, walk through all entries and prepare them for saving
+       //* BUG: */ reportBug(__FUNCTION__, __LINE__, '<pre>'.print_r(postRequestArray(),true).'</pre>');
        foreach ($postData as $id => $val) {
                // Process only formular field but not submit buttons ;)
                if ($id == 'ok') {
@@ -577,8 +578,13 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                                $val = convertCommaToDot($val);
                        } // END - if
 
-                       // Shall we add numbers or strings?
+                       // Test value on float
                        $test = (float) $val;
+
+                       // Debug message
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'test=' . $test . ',val=' . $val . ',id=' . $id);
+
+                       // Shall we add numbers or strings?
                        if ('' . $val . '' == '' . $test . '') {
                                // Add numbers
                                array_push($tableData, sprintf("`%s`=%s", $id, $test));
@@ -630,7 +636,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
 
                // Add both in one line
                $keys   = implode('`, `', $keys);
-               $values = implode(', ' , $values);
+               $values = implode(', '  , $values);
 
                // Generate SQL string
                $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)",
@@ -653,7 +659,10 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
        rebuildCache('config', 'config');
 
        // Settings saved, so display message?
-       if ($displayMessage === TRUE) displayMessage('{--SETTINGS_SAVED--}');
+       if ($displayMessage === TRUE) {
+               // Display a message
+               displayMessage('{--SETTINGS_SAVED--}');
+       } // END - if
 
        // Return affected rows
        return $affected;