Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sanitizer.php
1
<?php
2
namespace
Bitrix\Vote\Inner
;
3
4
class
Sanitizer
5
{
6
private
static \CBXSanitizer $sanitizer;
7
8
protected
static
function
getSanitizer
(): \CBXSanitizer
9
{
10
if
(!isset(static::$sanitizer))
11
{
12
$sanitizer = new \CBXSanitizer();
13
$sanitizer->applyDoubleEncode(
false
);
14
$sanitizer->setLevel(\CBXSanitizer::SECURE_LEVEL_LOW);
15
static::$sanitizer = $sanitizer;
16
}
17
return
static::$sanitizer;
18
}
19
20
public
static
function
cleanText
(?
string
$text): string
21
{
22
if
(empty($text) || mb_strpos($text,
'<'
) ===
false
)
23
{
24
return
strval($text);
25
}
26
return
static::getSanitizer()->sanitizeHtml($text);
27
}
28
}
Bitrix\Vote\Inner\Sanitizer
Definition
sanitizer.php:5
Bitrix\Vote\Inner\Sanitizer\cleanText
static cleanText(?string $text)
Definition
sanitizer.php:20
Bitrix\Vote\Inner\Sanitizer\getSanitizer
static getSanitizer()
Definition
sanitizer.php:8
Bitrix\Vote\Inner
Definition
sanitizer.php:2
modules
vote
lib
inner
sanitizer.php
Создано системой
1.10.0