@@ 971-975 (lines=5) @@ | ||
968 | 'value' => '', |
|
969 | ), $rule ); |
|
970 | ||
971 | if ( ! in_array( $rule['compare'], $allowed_operators ) ) { |
|
972 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . $rule['compare'] . '</code><br>Allowed operators are: <code>' . |
|
973 | implode( ', ', $allowed_operators ) . '</code>' ); |
|
974 | return null; |
|
975 | } |
|
976 | ||
977 | if ( in_array( $rule['compare'], $array_operators ) && ! is_array( $rule['value'] ) ) { |
|
978 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' ); |
@@ 323-326 (lines=4) @@ | ||
320 | $relation = strtoupper( $array[ $relation_key ] ); |
|
321 | } |
|
322 | ||
323 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
324 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' . |
|
325 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
326 | } |
|
327 | ||
328 | return $relation; |
|
329 | } |