MediaWiki 1.42.1
HtmlArmor.php
Go to the documentation of this file.
1<?php
30class HtmlArmor {
31
35 private $value;
36
43 public function __construct( $value ) {
44 $this->value = $value;
45 }
46
55 public static function getHtml( $input ) {
56 if ( $input instanceof HtmlArmor ) {
57 return $input->value;
58 } else {
59 return htmlspecialchars( $input, ENT_QUOTES );
60 }
61 }
62}
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:30
static getHtml( $input)
Provide a string or HtmlArmor object and get safe HTML back.
Definition HtmlArmor.php:55
__construct( $value)
Definition HtmlArmor.php:43