| @@ 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.' ); |
|
| @@ 322-325 (lines=4) @@ | ||
| 319 | $relation = strtoupper( $array[ $relation_key ] ); |
|
| 320 | } |
|
| 321 | ||
| 322 | if ( ! in_array( $relation, $allowed_relations ) ) { |
|
| 323 | Incorrect_Syntax_Exception::raise( 'Invalid relation type ' . $relation . '. ' . |
|
| 324 | 'The rule should be one of the following: "' . implode( '", "', $allowed_relations ) . '"' ); |
|
| 325 | } |
|
| 326 | ||
| 327 | return $relation; |
|
| 328 | } |
|