MediaWiki REL1_33
HtmlArmor.php
Go to the documentation of this file.
1<?php
28class HtmlArmor {
29
33 private $value;
34
38 public function __construct( $value ) {
39 $this->value = $value;
40 }
41
50 public static function getHtml( $input ) {
51 if ( $input instanceof HtmlArmor ) {
52 return $input->value;
53 } else {
54 return htmlspecialchars( $input, ENT_QUOTES );
55 }
56 }
57}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:28
string null $value
Definition HtmlArmor.php:33
static getHtml( $input)
Provide a string or HtmlArmor object and get safe HTML back.
Definition HtmlArmor.php:50
__construct( $value)
Definition HtmlArmor.php:38
if(is_array($mode)) switch( $mode) $input