MediaWiki master
MediaWiki\User\LoggedOutEditToken Class Reference

Value object representing a MediaWiki edit token for logged-out users. More...

Inherits MediaWiki\Session\Token.

Collaboration diagram for MediaWiki\User\LoggedOutEditToken:

Public Member Functions

 __construct ()
 
 match ( $userToken, $maxAge=null)
 Test if the token-string matches this token.
Parameters
string | null$userToken
int | null$maxAgeReturn false if $userToken is older than this many seconds
Returns
bool

 
- Public Member Functions inherited from MediaWiki\Session\Token
 __construct ( $secret, $salt, $new=false)
 
 __toString ()
 
 toString ()
 Get the string representation of the token.
 
 wasNew ()
 Indicate whether this token was created during the current request (true) or loaded from existing session data (false)
 

Protected Member Functions

 toStringAtTimestamp ( $timestamp)
 Get the string representation of the token at a timestamp.
Parameters
int$timestamp
Returns
string

 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Session\Token
static getTimestamp ( $token)
 Decode the timestamp from a token string.
 
- Public Attributes inherited from MediaWiki\Session\Token
const SUFFIX = '+\\'
 CSRF token suffix.
 

Detailed Description

Value object representing a MediaWiki edit token for logged-out users.

This exists so that code generically dealing with MediaWiki\Session\Token (i.e. the API) doesn't have to have so many special cases for anon edit tokens.

Stability: newable
Since
1.27

Definition at line 22 of file LoggedOutEditToken.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\User\LoggedOutEditToken::__construct ( )
Stability: stable
to call

Definition at line 27 of file LoggedOutEditToken.php.

Member Function Documentation

◆ match()

MediaWiki\User\LoggedOutEditToken::match ( $userToken,
$maxAge = null )

Test if the token-string matches this token.

Parameters
string | null$userToken
int | null$maxAgeReturn false if $userToken is older than this many seconds
Returns
bool

Reimplemented from MediaWiki\Session\Token.

Definition at line 37 of file LoggedOutEditToken.php.

References MediaWiki\Session\Token\SUFFIX.

◆ toStringAtTimestamp()

MediaWiki\User\LoggedOutEditToken::toStringAtTimestamp ( $timestamp)
protected

Get the string representation of the token at a timestamp.

Parameters
int$timestamp
Returns
string

Reimplemented from MediaWiki\Session\Token.

Definition at line 32 of file LoggedOutEditToken.php.

References MediaWiki\Session\Token\SUFFIX.


The documentation for this class was generated from the following file: