Skip to content

Commit

Permalink
Simplify test - since it is essentially identical to the existing reg…
Browse files Browse the repository at this point in the history
…ex code

Request #12671
  • Loading branch information
slusarz committed Aug 7, 2014
1 parent 9b156b7 commit f0c9dca
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions ingo/lib/Script/Sieve.php
Expand Up @@ -904,17 +904,6 @@ protected function _generate()
break;

case 'regex':
$vals['match-type'] = ':regex';
if ($use_address_test) {
$tmp = new Ingo_Script_Sieve_Test_Address($vals);
} elseif ($condition['field'] == 'Body') {
$tmp = new Ingo_Script_Sieve_Test_Body($vals);
} else {
$tmp = new Ingo_Script_Sieve_Test_Header($vals);
}
$test->addTest($tmp);
break;

case 'not regex':
$vals['match-type'] = ':regex';
if ($use_address_test) {
Expand All @@ -924,7 +913,10 @@ protected function _generate()
} else {
$tmp = new Ingo_Script_Sieve_Test_Header($vals);
}
$test->addTest(new Ingo_Script_Sieve_Test_Not($tmp));
if ($condition['match'] == 'not regex') {
$tmp = new Ingo_Script_Sieve_Test_Not($tmp);
}
$test->addTest($tmp);
break;

case 'matches':
Expand Down

0 comments on commit f0c9dca

Please sign in to comment.