Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/adapter/HeraldAdapter.php
| Show First 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | switch ($condition_type) { | ||||
| foreach ((array)$field_value as $value) { | foreach ((array)$field_value as $value) { | ||||
| // We add the 'S' flag because we use the regexp multiple times. | // We add the 'S' flag because we use the regexp multiple times. | ||||
| // It shouldn't cause any troubles if the flag is already there | // It shouldn't cause any troubles if the flag is already there | ||||
| // - /.*/S is evaluated same as /.*/SS. | // - /.*/S is evaluated same as /.*/SS. | ||||
| $result = @preg_match($condition_value.'S', $value); | $result = @preg_match($condition_value.'S', $value); | ||||
| if ($result === false) { | if ($result === false) { | ||||
| throw new HeraldInvalidConditionException( | throw new HeraldInvalidConditionException( | ||||
| pht('Regular expression is not valid!')); | pht( | ||||
| 'Regular expression "%s" in Herald rule "%s" is not valid, '. | |||||
| 'or exceeded backtracking or recursion limits while '. | |||||
| 'executing. Verify the expression and correct it or rewrite '. | |||||
| 'it with less backtracking.', | |||||
| $condition_value, | |||||
| $rule->getMonogram())); | |||||
| } | } | ||||
| if ($result) { | if ($result) { | ||||
| return $result_if_match; | return $result_if_match; | ||||
| } | } | ||||
| } | } | ||||
| return !$result_if_match; | return !$result_if_match; | ||||
| case self::CONDITION_REGEXP_PAIR: | case self::CONDITION_REGEXP_PAIR: | ||||
| // Match a JSON-encoded pair of regular expressions against a | // Match a JSON-encoded pair of regular expressions against a | ||||
| ▲ Show 20 Lines • Show All 727 Lines • Show Last 20 Lines | |||||