Commit d46057ae authored by tbrehm's avatar tbrehm
Browse files

Escape searchterm for preg in user mail filter.

parent a3e2d208
......@@ -129,14 +129,16 @@ if ( ".'$RETURNCODE'." != 0 )
$content .= "if (/^".$this->dataRecord["source"].":";
$searchterm = preg_quote($this->dataRecord["searchterm"]);
if($this->dataRecord["op"] == 'contains') {
$content .= ".*".$this->dataRecord["searchterm"]."/:h)\n";
$content .= ".*".$searchterm."/:h)\n";
} elseif ($this->dataRecord["op"] == 'is') {
$content .= $this->dataRecord["searchterm"]."$/:h)\n";
$content .= $searchterm."$/:h)\n";
} elseif ($this->dataRecord["op"] == 'begins') {
$content .= $this->dataRecord["searchterm"]."/:h)\n";
$content .= $searchterm."/:h)\n";
} elseif ($this->dataRecord["op"] == 'ends') {
$content .= ".*".$this->dataRecord["searchterm"]."$/:h)\n";
$content .= ".*".$searchterm."$/:h)\n";
}
$content .= "{\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment