| @@ 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 | } | |
| @@ 965-969 (lines=5) @@ | ||
| 962 | 'value' => '', | |
| 963 | ), $rule ); | |
| 964 | ||
| 965 | 			if ( ! in_array( $rule['compare'], $allowed_operators ) ) { | |
| 966 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic compare operator: <code>' . $rule['compare'] . '</code><br>Allowed operators are: <code>' . | |
| 967 | implode( ', ', $allowed_operators ) . '</code>' ); | |
| 968 | return array(); | |
| 969 | } | |
| 970 | ||
| 971 | 			if ( in_array( $rule['compare'], array( 'IN', 'NOT IN' ) ) && ! is_array( $rule['value'] ) ) { | |
| 972 | Incorrect_Syntax_Exception::raise( 'Invalid conditional logic value format. An array is expected, when using the "' . $rule['compare'] . '" operator.' ); | |