1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
pregmatchrule.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Security\W\Rules;
4
5
use Bitrix\Main\Text\StringHelper;
6
use Bitrix\Main\Security\W\Rules\Results\CheckResult;
7
8
class
PregMatchRule
extends
PregRule
9
{
10
protected
$action
;
11
12
public
function
__construct
(
$path
,
$context
,
$keys
,
$process
,
$encoding
,
$pattern
,
$action
)
13
{
14
parent::__construct(
$path
,
$context
,
$keys
,
$process
,
$encoding
,
$pattern
);
15
16
$this->action =
$action
;
17
}
18
19
public
function
evaluate
($value)
20
{
21
$failure = !StringHelper::isStringable($value) || preg_match($this->pattern, $value);
22
23
if
($failure)
24
{
25
return
new
CheckResult
(
26
false
,
27
$this->action
28
);
29
}
30
31
return
true
;
32
}
33
37
public
function
getAction
()
38
{
39
return
$this->action
;
40
}
41
}
Bitrix\Main\Security\W\Rules\PregMatchRule
Определения
pregmatchrule.php:9
Bitrix\Main\Security\W\Rules\PregMatchRule\getAction
getAction()
Определения
pregmatchrule.php:37
Bitrix\Main\Security\W\Rules\PregMatchRule\evaluate
evaluate($value)
Определения
pregmatchrule.php:19
Bitrix\Main\Security\W\Rules\PregMatchRule\$action
$action
Определения
pregmatchrule.php:10
Bitrix\Main\Security\W\Rules\PregMatchRule\__construct
__construct($path, $context, $keys, $process, $encoding, $pattern, $action)
Определения
pregmatchrule.php:12
Bitrix\Main\Security\W\Rules\PregRule
Определения
pregrule.php:6
Bitrix\Main\Security\W\Rules\PregRule\$pattern
$pattern
Определения
pregrule.php:7
Bitrix\Main\Security\W\Rules\Results\CheckResult
Определения
checkresult.php:1
Bitrix\Main\Security\W\Rules\Rule\$path
$path
Определения
rule.php:11
Bitrix\Main\Security\W\Rules\Rule\$process
$process
Определения
rule.php:17
Bitrix\Main\Security\W\Rules\Rule\$context
$context
Определения
rule.php:13
Bitrix\Main\Security\W\Rules\Rule\$encoding
$encoding
Определения
rule.php:19
Bitrix\Main\Security\W\Rules\Rule\$keys
$keys
Определения
rule.php:15
bitrix
modules
main
lib
security
w
rules
pregmatchrule.php
Создано системой
1.14.0