Move $sqimap_session_id from global to static scope.
[squirrelmail.git] / functions / imap_general.php
index d2687a3b4ebddb7712cf71c58657635a8f5a181c..640de0a85d0ec3e0df86e2514960b2cc7bc1502c 100755 (executable)
@@ -17,17 +17,15 @@ require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/auth.php');
 
 
-global $sqimap_session_id;
-$sqimap_session_id = 1;
-
 /**
  * Generates a new session ID by incrementing the last one used;
  * this ensures that each command has a unique ID.
  * @param bool unique_id
  * @return string IMAP session id of the form 'A000'.
  */
-function sqimap_session_id($unique_id = false) {
-    global $data_dir, $username, $sqimap_session_id;
+function sqimap_session_id($unique_id = FALSE) {
+    static $sqimap_session_id = 1;
+
     if (!$unique_id) {
         return( sprintf("A%03d", $sqimap_session_id++) );
     } else {