Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 12287)
+++ wp-includes/comment.php	(working copy)
@@ -892,15 +892,11 @@
 
 	do_action('untrash_comment', $comment_id);
 
-	$comment = array('comment_ID' => $comment_id);
-
-	$status = get_comment_meta($comment_id, '_wp_trash_meta_status', true);
+	$status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
 	if ( empty($status) )
 		$status = '0';
 
-	$comment['comment_approved'] = $status;
-
-	if ( wp_update_comment($comment) ) {
+	if ( wp_set_comment_status($comment_id, $status) ) {
 		delete_comment_meta($comment_id, '_wp_trash_meta_time');
 		delete_comment_meta($comment_id, '_wp_trash_meta_status');
 		do_action('untrashed_comment', $comment_id);
@@ -951,11 +947,11 @@
 
 	do_action('unspam_comment', $comment_id);
 
-	$status = get_comment_meta($comment_id, '_wp_trash_meta_status', true);
+	$status = (string) get_comment_meta($comment_id, '_wp_trash_meta_status', true);
 	if ( empty($status) )
 		$status = '0';
 
-	if ( wp_set_comment_status($comment_id, "$status") ) {
+	if ( wp_set_comment_status($comment_id, $status) ) {
 		delete_comment_meta($comment_id, '_wp_trash_meta_status');
 		do_action('unspammed_comment', $comment_id);
 		return true;
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 12287)
+++ wp-admin/upload.php	(working copy)
@@ -206,7 +206,7 @@
 $messages[1] = __('Media attachment updated.');
 $messages[2] = __('Media permanently deleted.');
 $messages[3] = __('Error saving media attachment.');
-$messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.$_GET['ids'], "bulk-media" ) ) . '">' . __('Undo?') . '</a>';
+$messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url( wp_nonce_url( 'upload.php?doaction=undo&action=untrash&ids='.(isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media" ) ) . '">' . __('Undo?') . '</a>';
 $messages[5] = __('Media restored from the trash.');
 
 if ( isset($_GET['message']) && (int) $_GET['message'] ) {

