From 85453877951b98d7b5f6d6e66d09a18e78b5ee88 Mon Sep 17 00:00:00 2001 From: nbachiyski 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: http://svn.automattic.com/wordpress/trunk@14987 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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);