From 7c32770901fdd738dba579bdbb62578aba0e1b6e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 3 Sep 2015 08:58:34 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@33887 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/bookmark.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index bdf1d7fa40..486ae835be 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -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( + '

' . __( 'Cheatin’ uh?' ) . '

' . + '

' . __( 'You do not have sufficient permissions to edit the links for this site.' ) . '

', + 403 + ); + } $_POST['link_url'] = esc_html( $_POST['link_url'] ); $_POST['link_url'] = esc_url($_POST['link_url']);