|
@@ 760-763 (lines=4) @@
|
| 757 |
|
if ( $key === 'relation' ) { |
| 758 |
|
$relation = strtoupper( $rule ); |
| 759 |
|
|
| 760 |
|
if ( ! in_array( $relation, $allowed_relations ) ) { |
| 761 |
|
Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $rule . '. ' . |
| 762 |
|
'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
| 763 |
|
} |
| 764 |
|
|
| 765 |
|
$parsed_rules['relation'] = $relation; |
| 766 |
|
continue; |
|
@@ 779-783 (lines=5) @@
|
| 776 |
|
if ( empty( $rule['compare'] ) ) { |
| 777 |
|
$rule['compare'] = '='; |
| 778 |
|
} |
| 779 |
|
if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
| 780 |
|
Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . |
| 781 |
|
$rule['compare'] . '</code><br>Allowed operators are: <code>' . |
| 782 |
|
implode( ', ', $allowed_operators ) . '</code>' ); |
| 783 |
|
} |
| 784 |
|
if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) { |
| 785 |
|
if ( ! is_array( $rule['value'] ) ) { |
| 786 |
|
Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' . |