1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-11 07:59:44 +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:
berckoff 2012-01-13 13:15:23 +00:00
parent 46759d8b31
commit 079ef5b63d

View File

@ -1231,20 +1231,14 @@ class validatorClass
{ {
$tmp = explode(",", $pref[$options['vetParam']]); $tmp = explode(",", $pref[$options['vetParam']]);
foreach($tmp as $disallow) 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 ('!' == substr(trim($disallow), -1) && $v == str_replace('!', '', $disallow))
{ { // Exact match search (noticed with exclamation mark in the end of the word)
if ($v == str_replace('!', '', $disallow)) $errMsg = ERR_DISALLOWED_TEXT_EXACT_MATCH;
{
$errMsg = ERR_DISALLOWED_TEXT_EXACT_MATCH;
}
} }
else elseif(stristr($v, trim($disallow)))
{ // Wild card search { // Wild card search
if(stristr($v, trim($disallow))) $errMsg = ERR_DISALLOWED_TEXT;
{
$errMsg = ERR_DISALLOWED_TEXT;
}
} }
} }
unset($tmp); unset($tmp);