(bug 37643) Ensure a session is created when necessary for Captcha

If the captcha data is going to be stored in the session, make sure the
session has actually been started.

Change-Id: Ia5eefdf738fad3fdbd305f1b3ce80dc86c66efe4
This commit is contained in:
Brad Jorsch 2012-06-15 22:24:36 -04:00 committed by Gerrit Code Review
parent f8a270393f
commit cf78b84807

View 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;
}