WordPress.org

Make WordPress Core

Ticket #15118: 15118.patch

File 15118.patch, 524 bytes (added by ocean90, 3 years ago)

Check if $tab value exists in media_upload_tabs()

  • wp-admin/media-upload.php

     
    117117        $body_id = 'media-upload'; 
    118118 
    119119        // let the action code decide how to handle the request 
    120         if ( $tab == 'type' || $tab == 'type_url' ) 
     120        if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) 
    121121                do_action("media_upload_$type"); 
    122122        else 
    123123                do_action("media_upload_$tab");