forked from extern/egroupware
* Sieve/Felamimail|Mail:Make exclamation mark (\!) in the begining of sieve rule query escapable from always bien used as NOT conditon
This commit is contained in:
parent
8d3a2d0007
commit
b429fe8ef6
@ -938,21 +938,28 @@ class mail_sieve
|
||||
function setMatchType (&$matchstr, $regex = false)
|
||||
{
|
||||
$match = lang('contains');
|
||||
if (preg_match("/\s*!/", $matchstr))
|
||||
if (preg_match("/^\s*!/", $matchstr))
|
||||
$match = lang('does not contain');
|
||||
if (preg_match("/\*|\?/", $matchstr))
|
||||
{
|
||||
$match = lang('matches');
|
||||
if (preg_match("/\s*!/", $matchstr))
|
||||
if (preg_match("/^\s*!/", $matchstr))
|
||||
$match = lang('does not match');
|
||||
}
|
||||
if ($regex)
|
||||
{
|
||||
$match = lang('matches regexp');
|
||||
if (preg_match("/\s*!/", $matchstr))
|
||||
if (preg_match("/^\s*!/", $matchstr))
|
||||
$match = lang('does not match regexp');
|
||||
}
|
||||
if ($regex && preg_match("/^\s*\\\\!/", $matchstr))
|
||||
{
|
||||
$matchstr = preg_replace("/^\s*\\\\!/","!",$matchstr);
|
||||
}
|
||||
else
|
||||
{
|
||||
$matchstr = preg_replace("/^\s*!/","",$matchstr);
|
||||
}
|
||||
return $match;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<description value="(*) wildcards (*,?) may be used. If you are trying to match * or ? itself, you must escape them with a backslash (\). If you check "Use regular expressions" you must use valid regular expressions."/>
|
||||
<description value='(*) wildcards (*,?) may be used. If you are trying to match * or ? itself, you must escape them with a backslash (\). If you check "Use regular expressions" you must use valid regular expressions. In order to escape of exclamation mark (!) at the begining not being used as "NOT", use regex and backslash (\) (e.g. \!)'/>
|
||||
</groupbox>
|
||||
</row>
|
||||
<row>
|
||||
|
Loading…
Reference in New Issue
Block a user