@@ 956-960 (lines=5) @@ | ||
953 | 'value' => '', |
|
954 | ), $rule ); |
|
955 | ||
956 | if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
|
957 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . $rule['compare'] . '</code><br>Allowed operators are: <code>' . |
|
958 | implode( ', ', $allowed_operators ) . '</code>' ); |
|
959 | return array(); |
|
960 | } |
|
961 | ||
962 | if ( in_array( $rule['compare'], array( 'IN', 'NOT IN' ) ) && ! is_array( $rule['value'] ) ) { |
|
963 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' ); |
@@ 272-275 (lines=4) @@ | ||
269 | $relation = strtoupper( $array[ $relation_key ] ); |
|
270 | } |
|
271 | ||
272 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
273 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' . |
|
274 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
275 | } |
|
276 | ||
277 | return $relation; |
|
278 | } |