We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a58d566 + 311cf03 commit 2cca00fCopy full SHA for 2cca00f
includes/Classifai/Providers/Watson/NLU.php
@@ -250,7 +250,10 @@ public function get_post_classifier_preview_data() {
250
wp_send_json_error( esc_html__( 'Failed nonce check.', 'classifai' ) );
251
}
252
253
- $post_id = filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
+ $post_id = filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );
254
+ if ( ! current_user_can( 'read_post', $post_id ) ) {
255
+ wp_send_json_error( esc_html__( 'You do not have permission to preview this post.', 'classifai' ) );
256
+ }
257
$classifier = new Classifier();
258
$normalizer = new \Classifai\Normalizer();
259
0 commit comments