Skip to content

Commit fed3436

Browse files
authored
Merge pull request #244 from lloc/dev
FILTER_SANITIZE_FULL_SPECIAL_CHARS instead of FILTER_SANITIZE_STRING
2 parents 17ee9d1 + 000840e commit fed3436

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

includes/ContentImport/Importers/WithRequestPostAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ protected function read_post_type_from_request( $default = 'post' ) {
3232
return $default;
3333
}
3434

35-
return filter_var( $_REQUEST['post_type'], FILTER_SANITIZE_STRING ) ?: 'post';
35+
return filter_var( $_REQUEST['post_type'], FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ?: 'post';
3636
}
3737
}

includes/MslsMetaBox.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,8 @@ public function set( $post_id ) {
361361
return;
362362
}
363363

364-
$capability = (
365-
'page' == filter_input( INPUT_POST, 'post_type', FILTER_SANITIZE_STRING ) ?
366-
'edit_page' :
367-
'edit_post'
368-
);
364+
$post_type = filter_input( INPUT_POST, 'post_type', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
365+
$capability = 'page' === $post_type ? 'edit_page' : 'edit_post';
369366

370367
if ( ! current_user_can( $capability, $post_id ) ) {
371368
return;

0 commit comments

Comments
 (0)