Fixed CSRF protection for new password form
authorAlexander Ebert <ebert@woltlab.com>
Thu, 12 Dec 2013 12:49:10 +0000 (13:49 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 12 Dec 2013 12:49:10 +0000 (13:49 +0100)
wcfsetup/install/files/lib/form/NewPasswordForm.class.php

index ec5fd7289ff33a02e748491db3fac516d8837857..47fb3b2683adac977ef851f7dbdf47ff5a3379d2 100644 (file)
@@ -61,6 +61,11 @@ class NewPasswordForm extends AbstractForm {
                
                if (isset($_REQUEST['u'])) $this->userID = intval($_REQUEST['u']);
                if (isset($_REQUEST['k'])) $this->lostPasswordKey = StringUtil::trim($_REQUEST['k']);
+               
+               // disable check for security token for GET requests
+               if ($this->userID || $this->lostPasswordKey) {
+                       $_POST['t'] = WCF::getSession()->getSecurityToken();
+               }
        }
        
        /**