MediaWiki
master
HtmlArmor.php
Go to the documentation of this file.
1
<?php
23
namespace
Wikimedia\HtmlArmor
;
24
32
class
HtmlArmor
{
33
37
private
$value;
38
45
public
function
__construct
( $value ) {
46
$this->value = $value;
47
}
48
57
public
static
function
getHtml
( $input ) {
58
if
( $input instanceof
HtmlArmor
) {
59
return
$input->value;
60
}
else
{
61
return
htmlspecialchars( $input, ENT_QUOTES );
62
}
63
}
64
}
65
67
class_alias( HtmlArmor::class,
'HtmlArmor'
);
Wikimedia\HtmlArmor\HtmlArmor
Marks HTML that shouldn't be escaped.
Definition
HtmlArmor.php:32
Wikimedia\HtmlArmor\HtmlArmor\getHtml
static getHtml( $input)
Provide a string or HtmlArmor object and get safe HTML back.
Definition
HtmlArmor.php:57
Wikimedia\HtmlArmor\HtmlArmor\__construct
__construct( $value)
Definition
HtmlArmor.php:45
Wikimedia\HtmlArmor
Definition
HtmlArmor.php:23
includes
libs
HtmlArmor
HtmlArmor.php
Generated on Fri Jul 18 2025 16:24:52 for MediaWiki by
1.10.0