MediaWiki
master
HtmlArmor.php
Go to the documentation of this file.
1
<?php
9
namespace
Wikimedia\HtmlArmor
;
10
18
class
HtmlArmor
{
19
23
private
$value;
24
31
public
function
__construct
( $value ) {
32
$this->value = $value;
33
}
34
43
public
static
function
getHtml
( $input ) {
44
if
( $input instanceof
HtmlArmor
) {
45
return
$input->value;
46
}
else
{
47
return
htmlspecialchars( $input, ENT_QUOTES );
48
}
49
}
50
}
51
53
class_alias( HtmlArmor::class,
'HtmlArmor'
);
Wikimedia\HtmlArmor\HtmlArmor
Marks HTML that shouldn't be escaped.
Definition
HtmlArmor.php:18
Wikimedia\HtmlArmor\HtmlArmor\getHtml
static getHtml( $input)
Provide a string or HtmlArmor object and get safe HTML back.
Definition
HtmlArmor.php:43
Wikimedia\HtmlArmor\HtmlArmor\__construct
__construct( $value)
Definition
HtmlArmor.php:31
Wikimedia\HtmlArmor
Definition
HtmlArmor.php:9
includes
libs
HtmlArmor
HtmlArmor.php
Generated on Fri Nov 7 2025 01:25:55 for MediaWiki by
1.10.0