Merge branch 'master' of mx:/var/cache/git/repos/ctracker
[ctracker.git] / libs / lib_general.php
index 9d518b4345d3e69d025a3f6d9743fd9c8d9308b0..fa4643de30088e24b74c1d3721fe76b79a18265b 100644 (file)
 if (!function_exists('implode_r')) {
        // Implode recursive a multi-dimension array, taken from www.php.net
        function implode_r ($glue, $array, $array_name = NULL) {
-               $return = array();
-               while(list($key,$value) = @each($array)) {
-                       if(is_array($value)) {
+               $return = [];
+               while (list($key,$value) = @each($array)) {
+                       if (is_array($value)) {
                                // Is an array again, so call recursive
                                $return[] = implode_r($glue, $value, (string) $key);
                        } else {
-                               if($array_name != NULL) {
+                               if ($array_name != NULL) {
                                        $return[] = $array_name . '[' . (string) $key . ']=' . $value . "\n";
                                } else {
                                        $return[] = $key . '=' . $value."\n";
@@ -40,13 +40,13 @@ if (!function_exists('implode_r')) {
                } // END - while
 
                // Return resulting array
-               return(implode($glue, $return));
+               return implode($glue, $return);
        } // END - function
 } // END - if
 
 if (!function_exists('implode_secure')) {
        // Implode a simple array with a 'call-back' to our escaper function
-       function implode_secure ($array) {
+       function implode_secure (array $array) {
                // Return string
                $return = '';
 
@@ -85,7 +85,7 @@ function crackerTrackerLoadConfiguration () {
        } // END - if
 
        // Load it
-       require($fqfn);
+       require $fqfn;
 
        // Load email header
        $GLOBALS['ctracker_header'] = crackerTrackerLoadEmailTemplate('header');
@@ -383,7 +383,7 @@ function crackerTrackerLanguage () {
 }
 
 // Loads a given email template and passes through $content
-function crackerTrackerLoadEmailTemplate ($template, array $content = array(), $language = NULL) {
+function crackerTrackerLoadEmailTemplate ($template, array $content = [], $language = NULL) {
        // Init language
        crackerTrackerLanguage();
 
@@ -581,7 +581,7 @@ function unsetCtrackerData () {
                        'ctracker_language',
                        'ctracker_localized',
                        'ctracker_link',
-                       'ctracker_blocked_requests',
+                       'ctracker_blocked_methods',
                ) as $key) {
                        // Unset it
                        unset($GLOBALS[$key]);