MediaWiki  master
MediaWiki\Preferences\SignatureValidator Class Reference
Collaboration diagram for MediaWiki\Preferences\SignatureValidator:

Public Member Functions

 __construct (User $user, ?MessageLocalizer $localizer, ParserOptions $popts)
 
 validateSignature (string $signature)
 

Protected Member Functions

 applyPreSaveTransform (string $signature)
 
 checkLintErrors (string $signature)
 
 checkUserLinks (string $signature)
 

Private Member Functions

 getLintErrorDetails (array $lintError)
 
 getLintErrorLocation (array $lintError)
 

Private Attributes

MessageLocalizer null $localizer
 
ParserOptions $popts
 
User $user
 

Detailed Description

Since
1.35

Definition at line 37 of file SignatureValidator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Preferences\SignatureValidator::__construct ( User  $user,
?MessageLocalizer  $localizer,
ParserOptions  $popts 
)

Member Function Documentation

◆ applyPreSaveTransform()

MediaWiki\Preferences\SignatureValidator::applyPreSaveTransform ( string  $signature)
protected
Parameters
string$signature
Returns
string|bool Signature with PST applied, or false if applying PST yields wikitext that would change if PST was applied again

Definition at line 160 of file SignatureValidator.php.

References MediaWiki\MediaWikiServices\getInstance(), and SpecialPage\getTitleFor().

Referenced by MediaWiki\Preferences\SignatureValidator\validateSignature().

◆ checkLintErrors()

MediaWiki\Preferences\SignatureValidator::checkLintErrors ( string  $signature)
protected
Parameters
string$signature
Returns
array Array of error objects returned by Parsoid's lint API (empty array for no errors)

Definition at line 194 of file SignatureValidator.php.

References MediaWiki\$config, Config\get(), MediaWiki\MediaWikiServices\getInstance(), and MW_VERSION.

Referenced by MediaWiki\Preferences\SignatureValidator\validateSignature().

◆ checkUserLinks()

MediaWiki\Preferences\SignatureValidator::checkUserLinks ( string  $signature)
protected
Parameters
string$signature
Returns
bool Whether signature contains required links

Definition at line 244 of file SignatureValidator.php.

References MediaWiki\MediaWikiServices\getInstance(), SpecialPage\getTitleFor(), Title\makeTitleSafe(), NS_USER, and NS_USER_TALK.

Referenced by MediaWiki\Preferences\SignatureValidator\validateSignature().

◆ getLintErrorDetails()

MediaWiki\Preferences\SignatureValidator::getLintErrorDetails ( array  $lintError)
private

◆ getLintErrorLocation()

MediaWiki\Preferences\SignatureValidator::getLintErrorLocation ( array  $lintError)
private

◆ validateSignature()

MediaWiki\Preferences\SignatureValidator::validateSignature ( string  $signature)

Member Data Documentation

◆ $localizer

MessageLocalizer null MediaWiki\Preferences\SignatureValidator::$localizer
private

◆ $popts

ParserOptions MediaWiki\Preferences\SignatureValidator::$popts
private

◆ $user

User MediaWiki\Preferences\SignatureValidator::$user
private

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