<div class="formSubmit">
<input type="submit" value="{lang}wcf.user.notification.mail.unsubscribe.confirm{/lang}" accesskey="s">
- {* The tag technically is not required, but the POST data is empty otherwise. *}
+ {* The tag is not technically required, but the POST data would be empty otherwise. *}
{@SECURITY_TOKEN_INPUT_TAG}
</div>
</form>
*/
class NotificationUnsubscribeForm extends AbstractForm {
/**
- * user to unsubscribe
* @var User
*/
public $user;
public $token = '';
/**
- * whether this is a one-click request
* @var boolean
*/
public $isOneClick = false;
* notification event to unsubscribe
* @var UserNotificationEvent
*/
- public $event = null;
+ public $event;
/**
* Disable security token validation.
}
}
- if (!$this->user || !hash_equals($this->user->notificationMailToken, $this->token)) {
+ if (!hash_equals($this->user->notificationMailToken, $this->token)) {
throw new IllegalLinkException();
}
$this->saved();
if ($this->isOneClick) {
+ // One-Click unsubscriptions are sent by the recipient's MUA upon clicking a button.
+ // No additional information except the URI are available and specifically no user interaction can happen.
+ // Just send a lightweight 204 No Content response, instead of kilobytes of HTML to save on resources.
header('HTTP/1.0 204 No Content');
exit;
}
* @var string
* @since 5.3
*/
- protected $listId = null;
+ protected $listId;
/**
* Human readable part of the List-Id header
* @var string
* @since 5.3
*/
- protected $listIdHuman = null;
+ protected $listIdHuman;
/**
* List-Unsubscribe URI
* @var string
* @since 5.3
*/
- protected $listUnsubscribe = null;
+ protected $listUnsubscribe;
/**
* Whether the listUnsubscribe URI has One-Click support