X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/e8f61417994be715a90671aa87f1cd70d8ba132a..4feeb71a9d812a9ae371c28a3d8b442a4394ded7:/wp-admin/includes/post.php diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 8be61474..4eb762de 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -165,6 +165,13 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); } + if ( isset( $post_data['post_category'] ) ) { + $category_object = get_taxonomy( 'category' ); + if ( ! current_user_can( $category_object->cap->assign_terms ) ) { + unset( $post_data['post_category'] ); + } + } + return $post_data; } @@ -1312,7 +1319,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { if ( false !== $view_link ) { $display_link = urldecode( $view_link ); - $return .= '' . $display_link . "\n"; + $return .= '' . esc_html( $display_link ) . "\n"; } else { $return .= '' . $permalink . "\n"; } @@ -1336,14 +1343,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { } } - $post_name_html = '' . $post_name_abridged . ''; - $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) ); + $post_name_html = '' . esc_html( $post_name_abridged ) . ''; + $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) ); $return = '' . __( 'Permalink:' ) . "\n"; $return .= '' . $display_link . "\n"; $return .= '‎'; // Fix bi-directional text display defect in RTL languages. $return .= '\n"; - $return .= '' . $post_name . "\n"; + $return .= '' . esc_html( $post_name ) . "\n"; } /**