~canonical-sysadmins/wordpress/4.6.1

« back to all changes in this revision

Viewing changes to wp-admin/includes/post.php

  • Committer: Barry Price
  • Date: 2016-06-22 02:23:41 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: barry.price@canonical.com-20160622022341-9qrp2nesacwfx017
Merge WP4.5.3 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
                $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
166
166
        }
167
167
 
 
168
        if ( isset( $post_data['post_category'] ) ) {
 
169
                $category_object = get_taxonomy( 'category' );
 
170
                if ( ! current_user_can( $category_object->cap->assign_terms ) ) {
 
171
                        unset( $post_data['post_category'] );
 
172
                }
 
173
        }
 
174
 
168
175
        return $post_data;
169
176
}
170
177
 
1312
1319
 
1313
1320
                if ( false !== $view_link ) {
1314
1321
                        $display_link = urldecode( $view_link );
1315
 
                        $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a>\n";
 
1322
                        $return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
1316
1323
                } else {
1317
1324
                        $return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
1318
1325
                }
1336
1343
                        }
1337
1344
                }
1338
1345
 
1339
 
                $post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
1340
 
                $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
 
1346
                $post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
 
1347
                $display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
1341
1348
 
1342
1349
                $return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
1343
1350
                $return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
1344
1351
                $return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
1345
1352
                $return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n";
1346
 
                $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
 
1353
                $return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
1347
1354
        }
1348
1355
 
1349
1356
        /**