Ver Fonte

PAGE_NAME might not be defined in all plugins, which might cause a "not defined" error on session timeouts.

pdontthink há 17 anos atrás
pai
commit
f20a363f8e
2 ficheiros alterados com 19 adições e 12 exclusões
  1. 2 0
      ChangeLog
  2. 17 12
      functions/auth.php

+ 2 - 0
ChangeLog

@@ -225,6 +225,8 @@ Version 1.5.2 - SVN
   - Added a "short_open_tag" configuration test.
   - Fixed outgoing messages to allow addresses such as "0@..." or "000@...", 
     etc. (#1818398).
+  - PAGE_NAME might not be defined in all plugins, which might cause a
+    "not defined" error on session timeouts.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

+ 17 - 12
functions/auth.php

@@ -34,19 +34,24 @@ function sqauth_is_logged_in() {
         return true;
     }
 
-	//  First we store some information in the new session to prevent
-	//  information-loss.
-	$session_expired_post = $_POST;
-	$session_expired_location = PAGE_NAME;
-	if (!sqsession_is_registered('session_expired_post')) {
-	    sqsession_register($session_expired_post,'session_expired_post');
-	}
-	if (!sqsession_is_registered('session_expired_location')) {
-	    sqsession_register($session_expired_location,'session_expired_location');
-	}
-	session_write_close();
+    //  First we store some information in the new session to prevent
+    //  information-loss.
+    $session_expired_post = $_POST;
+    if (defined('PAGE_NAME'))
+        $session_expired_location = PAGE_NAME;
+    else
+        $session_expired_location = '';
 
-	return false;
+    if (!sqsession_is_registered('session_expired_post')) {
+        sqsession_register($session_expired_post,'session_expired_post');
+    }
+    if (!sqsession_is_registered('session_expired_location')) {
+        sqsession_register($session_expired_location,'session_expired_location');
+    }
+
+    session_write_close();
+
+    return false;
 }
 
 /**