MediaWiki master
MediaWiki\Preferences\SignatureValidator Class Reference

Public Member Functions

 __construct (ServiceOptions $options, UserIdentity $user, ?MessageLocalizer $localizer, ParserOptions $popts, ParserFactory $parserFactory, Parsoid $parsoid, PageConfigFactory $pageConfigFactory, SpecialPageFactory $specialPageFactory, TitleFactory $titleFactory)
 
 validateSignature (string $signature)
 

Protected Member Functions

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

Detailed Description

Since
1.35

Definition at line 45 of file SignatureValidator.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Preferences\SignatureValidator::__construct ( ServiceOptions  $options,
UserIdentity  $user,
?MessageLocalizer  $localizer,
ParserOptions  $popts,
ParserFactory  $parserFactory,
Parsoid  $parsoid,
PageConfigFactory  $pageConfigFactory,
SpecialPageFactory  $specialPageFactory,
TitleFactory  $titleFactory 
)
Parameters
ServiceOptions$options
UserIdentity$user
?MessageLocalizer$localizer
ParserOptions$popts
ParserFactory$parserFactory
Parsoid$parsoid
PageConfigFactory$pageConfigFactory
SpecialPageFactory$specialPageFactory
TitleFactory$titleFactory

Definition at line 81 of file SignatureValidator.php.

References MediaWiki\Config\ServiceOptions\assertRequiredOptions().

Member Function Documentation

◆ applyPreSaveTransform()

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

Definition at line 222 of file SignatureValidator.php.

References MediaWiki\SpecialPage\SpecialPage\getTitleFor().

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 320 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 256 of file SignatureValidator.php.

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 279 of file SignatureValidator.php.

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

◆ validateSignature()

MediaWiki\Preferences\SignatureValidator::validateSignature ( string  $signature)
Parameters
string$signatureSignature before PST
Returns
string[]|bool If localizer is defined: List of errors, as HTML (empty array for no errors) If localizer is not defined: True if there are errors, false if there are no errors

Definition at line 111 of file SignatureValidator.php.

References MediaWiki\Preferences\SignatureValidator\applyPreSaveTransform(), MediaWiki\Preferences\SignatureValidator\checkLineBreaks(), MediaWiki\Preferences\SignatureValidator\checkLintErrors(), MediaWiki\Preferences\SignatureValidator\checkUserLinks(), MediaWiki\MainConfigNames\SignatureAllowedLintErrors, and wfEscapeWikiText().


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