Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
htmlconverter.php
1
<?php
2
namespace
Bitrix\Main\Text
;
3
4
class
HtmlConverter
extends
Converter
5
{
6
public
function
encode
($text, $textType =
''
)
7
{
8
if
(is_object($text))
9
{
10
return
$text;
11
}
12
13
$textType =
Converter::initTextType
($textType);
14
if
($textType ===
Converter::HTML
)
15
{
16
return
$text;
17
}
18
19
if
($text ===
null
)
20
{
21
return
''
;
22
}
23
24
return
HtmlFilter::encode
($text);
25
}
26
27
public
function
decode
($text, $textType =
''
)
28
{
29
if
(is_object($text))
30
{
31
return
$text;
32
}
33
34
$textType =
Converter::initTextType
($textType);
35
if
($textType ===
Converter::HTML
)
36
{
37
return
$text;
38
}
39
40
if
($text ===
null
)
41
{
42
return
''
;
43
}
44
45
return
htmlspecialchars_decode($text);
46
}
47
}
Bitrix\Main\Text\Converter
Definition
converter.php:5
Bitrix\Main\Text\Converter\initTextType
static initTextType($textType)
Definition
converter.php:34
Bitrix\Main\Text\Converter\HTML
const HTML
Definition
converter.php:7
Bitrix\Main\Text\HtmlConverter
Definition
htmlconverter.php:5
Bitrix\Main\Text\HtmlConverter\decode
decode($text, $textType='')
Definition
htmlconverter.php:27
Bitrix\Main\Text\HtmlConverter\encode
encode($text, $textType='')
Definition
htmlconverter.php:6
Bitrix\Main\Text\HtmlFilter\encode
static encode($string, $flags=ENT_COMPAT, $doubleEncode=true)
Definition
htmlfilter.php:12
Bitrix\Main\Text
Definition
base32.php:2
modules
main
lib
text
htmlconverter.php
Создано системой
1.10.0