@@ 773-776 (lines=4) @@ | ||
770 | if ( $key === 'relation' ) { |
|
771 | $relation = strtoupper( $rule ); |
|
772 | ||
773 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
774 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $rule . '. ' . |
|
775 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
776 | } |
|
777 | ||
778 | $parsed_rules['relation'] = $relation; |
|
779 | continue; |
|
@@ 792-796 (lines=5) @@ | ||
789 | if ( empty( $rule['compare'] ) ) { |
|
790 | $rule['compare'] = '='; |
|
791 | } |
|
792 | if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
|
793 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . |
|
794 | $rule['compare'] . '</code><br>Allowed operators are: <code>' . |
|
795 | implode( ', ', $allowed_operators ) . '</code>' ); |
|
796 | } |
|
797 | if ( $rule['compare'] === 'IN' || $rule['compare'] === 'NOT IN' ) { |
|
798 | if ( ! is_array( $rule['value'] ) ) { |
|
799 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. ' . |