From de9e77a9c69a7e671117f5d2f82d17222bfe3fc6 Mon Sep 17 00:00:00 2001 From: Nikolay Bachiyski Date: Thu, 27 May 2010 11:42:46 +0000 Subject: [PATCH] Prevent a notice if $_REQUEST['post_id'] is missing. Just use 0 in this case, which will be the same as using intval on an undefined value. git-svn-id: https://develop.svn.wordpress.org/trunk@14987 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 4054d28f6b..d9d6538e92 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1532,7 +1532,7 @@ SWFUpload.onload = function() { function media_upload_type_form($type = 'file', $errors = null, $id = null) { media_upload_header(); - $post_id = intval($_REQUEST['post_id']); + $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0; $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);