diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 7c95c3af1cc..35ebb1a61de 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -1482,7 +1482,7 @@ class WC_AJAX { check_ajax_referer( 'add-order-note', 'security' ); - $post_id = (int) $_POST['post_id']; + $post_id = absint( $_POST['post_id'] ); $note = wp_kses_post( trim( stripslashes( $_POST['note'] ) ) ); $note_type = $_POST['note_type'];