Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 23121)
+++ wp-admin/includes/media.php	(working copy)
@@ -1924,21 +1924,30 @@
  *
  * @param array $errors
  */
-function media_upload_library_form($errors) {
+function media_upload_library_form( $errors ) {
 	global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
 
 	media_upload_header();
 
-	$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
+	if( isset( $_REQUEST['post_id'] ) ) {
+		$post_id = ( int ) $_REQUEST['post_id'];
+	} else {
+		$post_id = 0;
+	} 
 
-	$form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
-	$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
+	$form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" );
+	$form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
 	$form_class = 'media-upload-form validate';
 
-	if ( get_user_setting('uploader') )
+	if ( get_user_setting( 'uploader' ) )
 		$form_class .= ' html-uploader';
 
-	$_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
+	if( isset( $_GET['paged'] ) ){
+		$_GET['paged'] = ( int ) $_GET['paged'];
+	} else {
+		$_GET['paged'] = 0;
+	}
+
 	if ( $_GET['paged'] < 1 )
 		$_GET['paged'] = 1;
 	$start = ( $_GET['paged'] - 1 ) * 10;
@@ -1953,7 +1962,7 @@
 <form id="filter" action="" method="get">
 <input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
 <input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
-<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
+<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" />
 <input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" />
 <input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" />
 
