Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4100025
UnicodeConstraint.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
929 B
Referenced Files
None
Subscribers
None
UnicodeConstraint.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
namespace
MediaWiki\EditPage\Constraint
;
use
StatusValue
;
/**
* Verify unicode constraint
*
* @since 1.36
* @internal
*/
class
UnicodeConstraint
implements
IEditConstraint
{
/**
* Correct unicode
*/
public
const
VALID_UNICODE
=
'β³π²β₯πππΎπΈβ΄πΉβ―'
;
/**
* @param string $input Unicode string provided, to compare
*/
public
function
__construct
(
private
readonly
string
$input
,
)
{
}
public
function
checkConstraint
():
string
{
if
(
$this
->
input
===
self
::
VALID_UNICODE
)
{
return
self
::
CONSTRAINT_PASSED
;
}
return
self
::
CONSTRAINT_FAILED
;
}
public
function
getLegacyStatus
():
StatusValue
{
$statusValue
=
StatusValue
::
newGood
();
if
(
$this
->
input
!==
self
::
VALID_UNICODE
)
{
$statusValue
->
fatal
(
'unicode-support-fail'
);
$statusValue
->
value
=
self
::
AS_UNICODE_NOT_SUPPORTED
;
}
return
$statusValue
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 16:11 (3 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5c/ee/27297d8ca149a833638eae493538
Default Alt Text
UnicodeConstraint.php (929 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment