Merge "(bug 37643) Ensure a session is created when necessary for Captcha"
authorCSteipp <csteipp@wikimedia.org>
Tue, 16 Oct 2012 23:20:13 +0000 (23:20 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 16 Oct 2012 23:20:13 +0000 (23:20 +0000)
CaptchaStore.php

index 3ab00b38991c11acdad99d76b640d336165cb7d8..a54db97f8250593d77c46ac180fca074bb80f833 100644 (file)
@@ -59,6 +59,13 @@ abstract class CaptchaStore {
 
 class CaptchaSessionStore extends CaptchaStore {
 
+       protected function __construct() {
+               // Make sure the session is started
+               if ( session_id() === '' ) {
+                       wfSetupSession();
+               }
+       }
+
        function store( $index, $info ) {
                $_SESSION['captcha' . $info['index']] = $info;
        }