Provide more helpful feedback than just "Cheatin' uh?" for permission errors in `wp-admin/includes/bookmark.php`.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33682. see #14530.
Built from https://develop.svn.wordpress.org/trunk@33887


git-svn-id: http://core.svn.wordpress.org/trunk@33856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-09-03 08:59:24 +00:00
parent c4ce11422c
commit 771b29455b
2 changed files with 8 additions and 3 deletions

View File

@ -26,8 +26,13 @@ function add_link() {
* @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
*/
function edit_link( $link_id = 0 ) {
if ( !current_user_can( 'manage_links' ) )
wp_die( __( 'Cheatin’ uh?' ), 403 );
if ( ! current_user_can( 'manage_links' ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'You do not have sufficient permissions to edit the links for this site.' ) . '</p>',
403
);
}
$_POST['link_url'] = esc_html( $_POST['link_url'] );
$_POST['link_url'] = esc_url($_POST['link_url']);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33886';
$wp_version = '4.4-alpha-33887';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.