]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Admin area 'Referral levels' refactured:
[mailer.git] / inc / wrapper-functions.php
index 708b2c4b1af27fc5dffc48feb2f1e92dcfe3733a..2e500b1617efa3bfb7f4a79d87fb0319d5fb6bb0 100644 (file)
@@ -343,9 +343,9 @@ function isInstalled () {
                        // First is config
                        (
                                (
-                                       isConfigEntrySet('MXCHANGE_INSTALLED')
+                                       isConfigEntrySet('MAILER_INSTALLED')
                                ) && (
-                                       getConfig('MXCHANGE_INSTALLED') == 'Y'
+                                       getConfig('MAILER_INSTALLED') == 'Y'
                                )
                        )
                ) || (
@@ -707,7 +707,7 @@ function getScriptOutputMode () {
 }
 
 // Setter for 'output_mode' value
-function setOutputMode ($newOutputMode) {
+function setScriptOutputMode ($newOutputMode) {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'output_mode=' . $newOutputMode);
        $GLOBALS['__output_mode'] = (int) $newOutputMode;
 }
@@ -1176,7 +1176,7 @@ function sendRawRedirect ($url) {
        $GLOBALS['__output'] = '';
 
        // To make redirects working (no content type), output mode must be raw
-       setOutputMode(-1);
+       setScriptOutputMode(-1);
 
        // Send helping header
        setHttpStatus('302 Found');
@@ -2865,18 +2865,20 @@ function search_array ($array, $key, $value, $parentIndex = NULL) {
        if (is_array($array)) {
                // Search for whole array
                foreach ($array as $idx => $dummy) {
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',idx=' . $idx);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',value=' . $value . ',idx=' . $idx . ',parentIndex[' . gettype($parentIndex) . ']=' . $parentIndex);
+                       //* DEBUG: */ print 'idx=' . $idx . ',parentIndex[' . gettype($parentIndex) . ']=' . $parentIndex . ',key=' . $key . ',value=' . $value . ',array=<pre>'.print_r($array, TRUE).'</pre>';
                        // Is dummy an array?
-                       if (is_array($dummy)) {
+                       if ((is_array($dummy)) && ((is_null($parentIndex)) || ($parentIndex === $value))) {
                                // Then search again
                                $subResult = search_array($dummy, $key, $value, $idx);
                                //* DEBUG: */ print 'subResult=<pre>' . print_r($subResult, TRUE).'</pre>';
 
                                // And merge both
                                $results = merge_array($results, $subResult, TRUE);
-                       } elseif ((isset($array[$key])) && ($array[$key] == $value)) {
+                       } elseif (($key == $idx) && (isset($array[$key])) && ($array[$key] === $value)) {
                                // Is found, so add it
                                $results[$parentIndex] = $array;
+                               //* DEBUG: */ print 'ARRAY: key=' . $key . ',idx=' . $idx . ',value=' . $value . ',parentIndex[' . gettype($parentIndex) . ']=' . $parentIndex . ',array=<pre>' . print_r($array, TRUE).'</pre>';
                        }
                } // END - foreach
        } // END - if