mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Validator class: changed logics for exact word match -> exclamation mark is supported only in the end of the word. (suggested by SecretR to comply with core)
This commit is contained in:
parent
46759d8b31
commit
079ef5b63d
@ -1231,22 +1231,16 @@ class validatorClass
|
||||
{
|
||||
$tmp = explode(",", $pref[$options['vetParam']]);
|
||||
foreach($tmp as $disallow)
|
||||
{ // Exact match search (exact match should be noticed with exclamation mark in the beginning or the end of the word)
|
||||
if (stristr(trim($disallow), '!'))
|
||||
{
|
||||
if ($v == str_replace('!', '', $disallow))
|
||||
{
|
||||
if ('!' == substr(trim($disallow), -1) && $v == str_replace('!', '', $disallow))
|
||||
{ // Exact match search (noticed with exclamation mark in the end of the word)
|
||||
$errMsg = ERR_DISALLOWED_TEXT_EXACT_MATCH;
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif(stristr($v, trim($disallow)))
|
||||
{ // Wild card search
|
||||
if(stristr($v, trim($disallow)))
|
||||
{
|
||||
$errMsg = ERR_DISALLOWED_TEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($tmp);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user