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

Public Member Functions

 __construct (ServiceOptions $options, UserIdentity $user, ?MessageLocalizer $localizer, ParserOptions $popts, Parser $parser, SpecialPageFactory $specialPageFactory, TitleFactory $titleFactory)
 
 validateSignature (string $signature)
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

MessageLocalizer null $localizer
 
Parser $parser
 
ParserOptions $popts
 
ServiceOptions $serviceOptions
 
SpecialPageFactory $specialPageFactory
 
TitleFactory $titleFactory
 
UserIdentity $user
 

Detailed Description

Since
1.35

Definition at line 41 of file SignatureValidator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Preferences\SignatureValidator::__construct ( ServiceOptions  $options,
UserIdentity  $user,
?MessageLocalizer  $localizer,
ParserOptions  $popts,
Parser  $parser,
SpecialPageFactory  $specialPageFactory,
TitleFactory  $titleFactory 
)

Member Function Documentation

◆ applyPreSaveTransform()

MediaWiki\Preferences\SignatureValidator::applyPreSaveTransform ( string  $signature)
protected
Parameters
string$signatureSignature before PST
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 211 of file SignatureValidator.php.

References MediaWiki\Preferences\SignatureValidator\$parser, Parser\getFreshParser(), Parser\getOutput(), SpecialPage\getTitleFor(), and Parser\preSaveTransform().

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

◆ checkLineBreaks()

MediaWiki\Preferences\SignatureValidator::checkLineBreaks ( string  $signature)
protected
Parameters
string$signatureSignature after PST
Returns
bool Whether signature contains no line breaks

Definition at line 335 of file SignatureValidator.php.

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

◆ checkLintErrors()

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

Definition at line 245 of file SignatureValidator.php.

References MW_VERSION.

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

◆ checkUserLinks()

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

Definition at line 294 of file SignatureValidator.php.

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

◆ $parser

Parser MediaWiki\Preferences\SignatureValidator::$parser
private

◆ $popts

ParserOptions MediaWiki\Preferences\SignatureValidator::$popts
private

◆ $serviceOptions

ServiceOptions MediaWiki\Preferences\SignatureValidator::$serviceOptions
private

Definition at line 58 of file SignatureValidator.php.

◆ $specialPageFactory

SpecialPageFactory MediaWiki\Preferences\SignatureValidator::$specialPageFactory
private

◆ $titleFactory

TitleFactory MediaWiki\Preferences\SignatureValidator::$titleFactory
private

◆ $user

UserIdentity MediaWiki\Preferences\SignatureValidator::$user
private
Initial value:
=[,,]
public const CONSTRUCTOR_OPTIONS
const SignatureAllowedLintErrors
Name constant for the SignatureAllowedLintErrors setting, for use with Config::get()
const VirtualRestConfig
Name constant for the VirtualRestConfig setting, for use with Config::get()

Definition at line 50 of file SignatureValidator.php.

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


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