don't use uninitialized $valid_code

This commit is contained in:
Mikael Nordfeldth 2015-06-06 21:06:35 +02:00
parent acfed2353c
commit 2a57bbaf84

View File

@ -249,9 +249,9 @@ class QvitterPlugin extends Plugin {
}
// if qvitter is opt-out, disable the default register page (if we don't have a valid invitation code)
if(isset($_POST['code'])) {
$valid_code = Invitation::getKV('code', $_POST['code']);
}
$valid_code = isset($_POST['code'])
? Invitation::getKV('code', $_POST['code'])
: null;
if(self::settings('enabledbydefault') && empty($valid_code)) {
$m->connect('main/register',
array('action' => 'qvitter'));