Merged in MAW-865-auto-patch (pull request #27)
Plugin updates * Plugin updates search-filter-divi,woocommerce,wordpress-seo,search-filter-pro
This commit is contained in:
@@ -41,8 +41,13 @@ class Init {
|
||||
}
|
||||
|
||||
foreach ( $specs as $spec ) {
|
||||
$suggestion = EvaluateSuggestion::evaluate( $spec );
|
||||
$suggestions[] = $suggestion;
|
||||
try {
|
||||
$suggestion = EvaluateSuggestion::evaluate( $spec );
|
||||
$suggestions[] = $suggestion;
|
||||
// phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
|
||||
} catch ( \Throwable $e ) {
|
||||
// Ignore errors.
|
||||
}
|
||||
}
|
||||
|
||||
return array_values(
|
||||
|
||||
@@ -36,24 +36,36 @@ class ComparisonOperation {
|
||||
if ( is_array( $left_operand ) && is_string( $right_operand ) ) {
|
||||
return in_array( $right_operand, $left_operand, true );
|
||||
}
|
||||
return strpos( $right_operand, $left_operand ) !== false;
|
||||
if ( is_string( $right_operand ) && is_string( $left_operand ) ) {
|
||||
return strpos( $right_operand, $left_operand ) !== false;
|
||||
}
|
||||
break;
|
||||
case '!contains':
|
||||
if ( is_array( $left_operand ) && is_string( $right_operand ) ) {
|
||||
return ! in_array( $right_operand, $left_operand, true );
|
||||
}
|
||||
return strpos( $right_operand, $left_operand ) === false;
|
||||
if ( is_string( $right_operand ) && is_string( $left_operand ) ) {
|
||||
return strpos( $right_operand, $left_operand ) === false;
|
||||
}
|
||||
break;
|
||||
case 'in':
|
||||
if ( is_array( $right_operand ) && is_string( $left_operand ) ) {
|
||||
return in_array( $left_operand, $right_operand, true );
|
||||
}
|
||||
return strpos( $left_operand, $right_operand ) !== false;
|
||||
if ( is_string( $left_operand ) && is_string( $right_operand ) ) {
|
||||
return strpos( $left_operand, $right_operand ) !== false;
|
||||
}
|
||||
break;
|
||||
case '!in':
|
||||
if ( is_array( $right_operand ) && is_string( $left_operand ) ) {
|
||||
return ! in_array( $left_operand, $right_operand, true );
|
||||
}
|
||||
return strpos( $left_operand, $right_operand ) === false;
|
||||
if ( is_string( $left_operand ) && is_string( $right_operand ) ) {
|
||||
return strpos( $left_operand, $right_operand ) === false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,12 +37,16 @@ class SpecRunner {
|
||||
|
||||
// Evaluate the spec and get the new note status.
|
||||
$previous_status = $note->get_status();
|
||||
$status = EvaluateAndGetStatus::evaluate(
|
||||
$spec,
|
||||
$previous_status,
|
||||
$stored_state,
|
||||
new RuleEvaluator()
|
||||
);
|
||||
try {
|
||||
$status = EvaluateAndGetStatus::evaluate(
|
||||
$spec,
|
||||
$previous_status,
|
||||
$stored_state,
|
||||
new RuleEvaluator()
|
||||
);
|
||||
} catch ( \Throwable $e ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the status is changing, update the created date to now.
|
||||
if ( $previous_status !== $status ) {
|
||||
|
||||
Reference in New Issue
Block a user