mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-26 09:53:20 +01:00
* 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)
|
function setMatchType (&$matchstr, $regex = false)
|
||||||
{
|
{
|
||||||
$match = lang('contains');
|
$match = lang('contains');
|
||||||
if (preg_match("/\s*!/", $matchstr))
|
if (preg_match("/^\s*!/", $matchstr))
|
||||||
$match = lang('does not contain');
|
$match = lang('does not contain');
|
||||||
if (preg_match("/\*|\?/", $matchstr))
|
if (preg_match("/\*|\?/", $matchstr))
|
||||||
{
|
{
|
||||||
$match = lang('matches');
|
$match = lang('matches');
|
||||||
if (preg_match("/\s*!/", $matchstr))
|
if (preg_match("/^\s*!/", $matchstr))
|
||||||
$match = lang('does not match');
|
$match = lang('does not match');
|
||||||
}
|
}
|
||||||
if ($regex)
|
if ($regex)
|
||||||
{
|
{
|
||||||
$match = lang('matches regexp');
|
$match = lang('matches regexp');
|
||||||
if (preg_match("/\s*!/", $matchstr))
|
if (preg_match("/^\s*!/", $matchstr))
|
||||||
$match = lang('does not match regexp');
|
$match = lang('does not match regexp');
|
||||||
}
|
}
|
||||||
$matchstr = preg_replace("/^\s*!/","",$matchstr);
|
if ($regex && preg_match("/^\s*\\\\!/", $matchstr))
|
||||||
|
{
|
||||||
|
$matchstr = preg_replace("/^\s*\\\\!/","!",$matchstr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$matchstr = preg_replace("/^\s*!/","",$matchstr);
|
||||||
|
}
|
||||||
return $match;
|
return $match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</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>
|
</groupbox>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
Loading…
Reference in New Issue
Block a user