WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/17/2012 06:42:14 AM (6 years ago)
Author:
nacin
Message:

Prevent notices when post_id is not passed to the old media upload forms. props ldebrouwer. fixes #22465.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r22568 r22628  
    13781378 */
    13791379function media_upload_header() {
    1380     echo '<script type="text/javascript">post_id = ' . intval( $_REQUEST['post_id'] ) . ";</script>\n";
     1380    $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
     1381    echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n";
    13811382    if ( empty( $_GET['chromeless'] ) ) {
    13821383        echo '<div id="media-upload-header">';
     
    15971598    media_upload_header();
    15981599
    1599     $post_id = intval($_REQUEST['post_id']);
     1600    $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
    16001601
    16011602    $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
     
    18721873    media_upload_header();
    18731874
    1874     $post_id = intval($_REQUEST['post_id']);
     1875    $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
    18751876
    18761877    $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
Note: See TracChangeset for help on using the changeset viewer.