XML parser introduced, ext-surfbar rewritten, more EL code:
[mailer.git] / inc / functions.php
index ba6ccc37101dcfc574e6145d1cc3728bbadb3811..e2fdb65381aba41d1264c934cfe0079386fd1a23 100644 (file)
@@ -2300,7 +2300,7 @@ function detectMultiBytePrefix ($str) {
 }
 
 // Searches the given array for a sub-string match and returns all found keys in an array
-function getArrayKeysFromSubStrArray ($heystack, array $needles, $offset = 0) {
+function getArrayKeysFromSubStrArray ($heystack, $needles, $offset = 0) {
        // Init array for all found keys
        $keys = array();
 
@@ -2391,6 +2391,21 @@ function translateTaskType ($taskType) {
        return $message;
 }
 
+// "Translates" 'true' to true and 'false' to false
+function convertStringToBoolean ($str) {
+       // Trim it lower-case for validation
+       $str = trim(strtolower($str));
+
+       // Is it valid?
+       if (!in_array($str, array('true', 'false'))) {
+               // Not valid!
+               debug_report_bug(__FUNCTION__, __LINE__, 'str=' . $str . ' is not true/false');
+       } // END - if
+
+       // Return it
+       return (($str == 'true') ? true : false);
+}
+
 //-----------------------------------------------------------------------------
 // Automatically re-created functions, all taken from user comments on www.php.net
 //-----------------------------------------------------------------------------