From 2aca19a15dcb8523959e55fed6be5dddda833411 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 15 Mar 2004 19:57:20 +0000 Subject: [PATCH] Move $sqimap_session_id from global to static scope. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6801 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index d2687a3b..640de0a8 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -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 { -- 2.25.1