PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | includes/page-availability-general/ajax/availability_general__save.php +12 -2 11.8.3 → 11.9 View file →
@@ -24,10 +24,20 @@
24 24 if ( ! wpbc_is_mu_user_can_be_here( 'only_super_admin' ) || ! current_user_can( wpbc_availability_general__get_manage_cap() ) ) {
25 25 wp_send_json_error( array( 'message' => __( 'You do not have permission to change Schedule & Rules.', 'booking' ) ), 403 );
26 26 }
27 27
28 - $cleaned_data = wpbc_availability_general__validate_data( $_POST ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
29 - wpbc_availability_general__update_settings( $cleaned_data );
28 + $cleaned_data = wpbc_availability_general__validate_data( $_POST ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
29 + if ( is_wp_error( $cleaned_data ) ) {
30 + wp_send_json_error(
31 + array(
32 + 'code' => $cleaned_data->get_error_code(),
33 + 'message' => $cleaned_data->get_error_message(),
34 + ),
35 + 422
36 + );
37 + }
38 +
39 + wpbc_availability_general__update_settings( $cleaned_data );
30 40
31 41 wp_send_json_success(
32 42 array(
33 43 'message' => __( 'Schedule & Rules settings updated.', 'booking' ),