|
@@ 790-793 (lines=4) @@
|
| 787 |
|
if ( $key === 'relation' ) { |
| 788 |
|
$relation = strtoupper( $rule ); |
| 789 |
|
|
| 790 |
|
if ( ! in_array( $relation, $allowed_relations ) ) { |
| 791 |
|
Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $rule . '. ' . |
| 792 |
|
'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
| 793 |
|
} |
| 794 |
|
|
| 795 |
|
$parsed_rules['relation'] = $relation; |
| 796 |
|
continue; |
|
@@ 809-813 (lines=5) @@
|
| 806 |
|
if ( empty( $rule['compare'] ) ) { |
| 807 |
|
$rule['compare'] = '='; |
| 808 |
|
} |
| 809 |
|
if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
| 810 |
|
Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . |
| 811 |
|
$rule['compare'] . '</code><br>Allowed operators are: <code>' . |
| 812 |
|
implode( ', ', $allowed_operators ) . '</code>' ); |
| 813 |
|
} |
| 814 |
|
if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) { |
| 815 |
|
if ( ! is_array( $rule['value'] ) ) { |
| 816 |
|
Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' . |