Continued with ext-wernis:
[mailer.git] / inc / functions.php
index 3ee3d3b1ae1cb86fc6b745d4c96b40b5460094dd..4f37ac1a92079a5d9ae6a39ed39301fc4d8391a9 100644 (file)
@@ -2192,6 +2192,18 @@ function convertZeroToNull ($number) {
        return $number;
 }
 
+// Converts an empty string to NULL, else leaves it untouched
+function convertEmptyToNull ($str) {
+       // Is the string empty?
+       if (strlen($str) == 0) {
+               // Is really empty
+               $str = NULL;
+       } // END - if
+
+       // Return it
+       return $str;
+}
+
 // Converts a NULL|empty string|< 1 to zero
 function convertNullToZero ($number) {
        // Is it a valid username?