]> git.mxchange.org Git - ctracker.git/commitdiff
unsetCtrackerData() introduced
authorRoland Haeder <roland@mxchange.org>
Tue, 26 Feb 2013 21:46:56 +0000 (21:46 +0000)
committerRoland Haeder <roland@mxchange.org>
Tue, 26 Feb 2013 21:46:56 +0000 (21:46 +0000)
libs/lib_connect.php
libs/lib_general.php

index 3a0b4b31974a00ba5bb79cce75fbc33fd32888b1..b981c03be1c466c1a5c87442b60518c2fe412172 100644 (file)
@@ -77,16 +77,16 @@ function crackerTrackerCloseDatabaseLink () {
        if (isCrackerTrackerDatabaseLinkUp()) {
                // Did it work?
                if (!mysql_close($GLOBALS['ctracker_link'])) {
-                       // Remove the link from global array
-                       unset($GLOBALS['ctracker_link']);
+                       // Remove all data from global space
+                       unsetCtrackerData();
 
                        // Attempt has failed
                        crackerTrackerDatabaseError(__FUNCTION__, __LINE__);
                } // END - if
        } // END - if
 
-       // Remove the link from global array
-       unset($GLOBALS['ctracker_link']);
+       // Remove all data from global space
+       unsetCtrackerData();
 }
 
 // Inserts given array, if IP/check_worm combination was not found
index 46ef8386060f46135929bfde89ad531ed6827c06..e2d0005b27679af9d1c9a05bd421455e85785782 100644 (file)
@@ -446,6 +446,9 @@ function crackerTrackerRedirectSameUrl () {
  * @access  private
  */
 function crackerTrackerSendRawRedirect ($url) {
+       // Better remove any data by ctracker
+       unsetCtrackerData();
+
        // always close the session
        session_write_close();
 
@@ -466,5 +469,32 @@ function crackerTrackerSendRawRedirect ($url) {
        exit();
 }
 
+// Removes all ctracker-related data from global space
+function unsetCtrackerData () {
+       // Unset all
+       foreach (array(
+                       'ctracker_host',
+                       'ctracker_dbname',
+                       'ctracker_user',
+                       'ctracker_password',
+                       'ctracker_debug_enabled',
+                       'ctracker_email',
+                       'ctracker_whitelist',
+                       'ctracker_get_blacklist',
+                       'ctracker_post_blacklist',
+                       'ctracker_header',
+                       'ctracker_post_track',
+                       'ctracker_checkworm',
+                       'ctracker_check_post',
+                       'ctracker_last_sql',
+                       'ctracker_last_result',
+                       'ctracker_config',
+                       'ctracker_updates',
+               ) as $key) {
+                       // Unset it
+                       unset($GLOBALS[$key]);
+       } // END - foreach
+}
+
 // [EOF]
 ?>