ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HTMLUtil.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\HTTP;
26
28{
29 public function __construct()
30 {
31 }
32
33 public function escape(string $input): string
34 {
35 return htmlspecialchars(
36 $input,
37 ENT_QUOTES | ENT_SUBSTITUTE,
38 'utf-8'
39 );
40 }
41
42 public function escapeCurly(string $input): string
43 {
44 return str_replace(["{", "}"], ["&#123;", "&#125;"], $input);
45 }
46
47 public function strip(string $input): string
48 {
49 // see https://www.ilias.de/mantis/view.php?id=19727
50 $str = \ilUtil::stripSlashes($input);
51 if ($str !== $input) {
52 $str = \ilUtil::stripSlashes(str_replace("<", "< ", $input));
53 }
54 return $str;
55 }
56}
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
escapeCurly(string $input)
Definition: HTMLUtil.php:42
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...