MediaWiki master
UnicodeConstraint.php
Go to the documentation of this file.
1<?php
8
10
18
22 public const VALID_UNICODE = 'ℳ𝒲β™₯π“Šπ“ƒπ’Ύπ’Έβ„΄π’Ήβ„―';
23
27 public function __construct(
28 private readonly string $input,
29 ) {
30 }
31
32 public function checkConstraint(): EditPageStatus {
33 if ( $this->input !== self::VALID_UNICODE ) {
34 return EditPageStatus::newFatal( 'unicode-support-fail' )
35 ->setValue( self::AS_UNICODE_NOT_SUPPORTED );
36 }
38 }
39
40}
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:69
Abstract class for all constraints that can prevent edits.
Status returned by edit constraints and other page editing checks.
setValue(int $value)
Sets the value of the status.
static newFatal( $message,... $parameters)
Factory function for fatal errors.
static newGood( $value=null)
Factory function for good results.