Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
base.php
1
<?php
9
namespace
Bitrix\Security\Filter\Auditor
;
10
17
abstract
class
Base
18
{
19
private
$splittingChar =
' '
;
20
private
$filteredValue =
''
;
21
22
protected
$filters
= array();
23
protected
$name
=
''
;
24
25
26
function
__construct
($splittingChar =
''
)
27
{
28
$this->
setSplittingChar
($splittingChar);
29
}
30
45
public
function
process
($value)
46
{
47
$this->
initializeFilters
();
48
$this->
setFilteredValue
(
''
);
49
$found =
false
;
50
51
$str2 =
''
;
52
$strX = $value;
53
while
($str2 != $strX)
54
{
55
$str2 = $strX;
56
$strX = preg_replace($this->filters[
'search'
], $this->filters[
'replace'
], $str2);
57
}
58
59
if
($str2 != $value)
60
{
61
$this->
setFilteredValue
($str2);
62
$found =
true
;
63
}
64
return
$found;
65
}
66
67
74
public
function
getFilteredValue
()
75
{
76
return
$this->filteredValue;
77
}
78
79
85
public
function
getName
()
86
{
87
return
$this->name
;
88
}
89
90
94
protected
function
setFilteredValue
($string)
95
{
96
$this->filteredValue = $string;
97
}
98
99
103
protected
function
setSplittingChar
($char)
104
{
105
if
(is_string($char) && $char !=
''
)
106
{
107
$this->splittingChar = $char;
108
}
109
}
110
115
protected
function
getSplittingChar
($customChar =
''
)
116
{
117
if
(is_string($customChar) && $customChar !=
''
)
118
{
119
return
$customChar;
120
}
121
elseif (is_string($this->splittingChar) && $this->splittingChar !=
''
)
122
{
123
return
$this->splittingChar;
124
}
125
else
126
{
127
return
' '
;
128
}
129
}
130
137
protected
function
getSplittingString
($splitItemsCount = 2, $customSplitChar =
''
)
138
{
139
$glue =
self::getSplittingChar
($customSplitChar).
'\\'
;
140
$result =
'\\'
;
141
$result .= join($glue, range(1, $splitItemsCount));
142
return
$result;
143
}
144
145
protected
function
initializeFilters
()
146
{
147
if
(!$this->filters)
148
{
149
$this->filters = $this->
getFilters
();
150
}
151
}
152
156
abstract
protected
function
getFilters
();
157
158
}
Bitrix\Security\Filter\Auditor\Base
Definition
base.php:18
Bitrix\Security\Filter\Auditor\Base\setSplittingChar
setSplittingChar($char)
Definition
base.php:103
Bitrix\Security\Filter\Auditor\Base\getSplittingChar
getSplittingChar($customChar='')
Definition
base.php:115
Bitrix\Security\Filter\Auditor\Base\process
process($value)
Definition
base.php:45
Bitrix\Security\Filter\Auditor\Base\getName
getName()
Definition
base.php:85
Bitrix\Security\Filter\Auditor\Base\getFilters
getFilters()
Bitrix\Security\Filter\Auditor\Base\getFilteredValue
getFilteredValue()
Definition
base.php:74
Bitrix\Security\Filter\Auditor\Base\getSplittingString
getSplittingString($splitItemsCount=2, $customSplitChar='')
Definition
base.php:137
Bitrix\Security\Filter\Auditor\Base\$name
$name
Definition
base.php:23
Bitrix\Security\Filter\Auditor\Base\__construct
__construct($splittingChar='')
Definition
base.php:26
Bitrix\Security\Filter\Auditor\Base\setFilteredValue
setFilteredValue($string)
Definition
base.php:94
Bitrix\Security\Filter\Auditor\Base\$filters
$filters
Definition
base.php:22
Bitrix\Security\Filter\Auditor\Base\initializeFilters
initializeFilters()
Definition
base.php:145
Bitrix\Security\Filter\Auditor
Definition
base.php:9
modules
security
lib
filter
auditor
base.php
Создано системой
1.10.0