浏览代码

Fix sqauth_read_password() for plugins running on the login_verified hook when the 'key' cookie isn't yet set

pdontthink 15 年之前
父节点
当前提交
d31ba01582
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 1 0
      doc/ChangeLog
  2. 3 0
      functions/auth.php

+ 1 - 0
doc/ChangeLog

@@ -352,6 +352,7 @@ Version 1.5.2 - SVN
   - Fixed attachment filename decoding problems (#2994865).
   - Now allow multiple plugins to handle (add links for) a single
     attachment MIME type.
+  - Fixed sqauth_read_password() for plugins on the login_verified hook.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

+ 3 - 0
functions/auth.php

@@ -93,6 +93,9 @@ function sqauth_is_logged_in() {
  * @since 1.5.1
  */
 function sqauth_read_password() {
+    global $currentHookName;
+    if ($currentHookName == 'login_verified') global $key;
+
     sqgetGlobalVar('key',         $key,       SQ_COOKIE);
     sqgetGlobalVar('onetimepad',  $onetimepad,SQ_SESSION);