mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
Move cap check up. Props mdawaffe. fixes #6838 for trunk
git-svn-id: https://develop.svn.wordpress.org/branches/2.5@7830 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
431b530819
commit
95f19ce42a
@ -9,14 +9,14 @@ wp_reset_vars(array('action'));
|
||||
|
||||
switch( $action ) :
|
||||
case 'editattachment' :
|
||||
$errors = media_upload_form_handler();
|
||||
$attachment_id = (int) $_POST['attachment_id'];
|
||||
|
||||
check_admin_referer('media-form');
|
||||
|
||||
if ( !current_user_can('edit_post', $attachment_id) )
|
||||
wp_die ( __('You are not allowed to edit this attachment.') );
|
||||
|
||||
$errors = media_upload_form_handler();
|
||||
|
||||
if ( empty($errors) ) {
|
||||
$location = 'media.php';
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user