Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 21594)
+++ wp-includes/post-template.php	(working copy)
@@ -101,7 +101,7 @@
  * @return string
  */
 function get_the_title( $id = 0 ) {
-	$post = &get_post($id);
+	$post = get_post($id);
 
 	$title = isset($post->post_title) ? $post->post_title : '';
 	$id = isset($post->ID) ? $post->ID : (int) $id;
@@ -148,7 +148,7 @@
  * @return string
  */
 function get_the_guid( $id = 0 ) {
-	$post = &get_post($id);
+	$post = get_post($id);
 
 	return apply_filters('get_the_guid', $post->guid);
 }
@@ -276,7 +276,7 @@
  * @return bool
  */
 function has_excerpt( $id = 0 ) {
-	$post = &get_post( $id );
+	$post = get_post( $id );
 	return ( !empty( $post->post_excerpt ) );
 }
 
@@ -1138,7 +1138,7 @@
  */
 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) {
 	$id = intval( $id );
-	$_post = & get_post( $id );
+	$_post = get_post( $id );
 
 	if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )
 		return __( 'Missing Attachment' );
Index: wp-includes/taxonomy.php
===================================================================
--- wp-includes/taxonomy.php	(revision 21594)
+++ wp-includes/taxonomy.php	(working copy)
@@ -3073,10 +3073,7 @@
  * @return array
  */
 function get_the_taxonomies($post = 0, $args = array() ) {
-	if ( is_int($post) )
-		$post =& get_post($post);
-	elseif ( !is_object($post) )
-		$post =& $GLOBALS['post'];
+	$post = get_post( $post );
 
 	$args = wp_parse_args( $args, array(
 		'template' => '%s: %l.',
@@ -3122,7 +3119,7 @@
  * @return array
  */
 function get_post_taxonomies($post = 0) {
-	$post =& get_post($post);
+	$post = get_post( $post );
 
 	return get_object_taxonomies($post);
 }
Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 21594)
+++ wp-includes/post.php	(working copy)
@@ -586,7 +586,7 @@
  * @return bool|string False on failure or returns the mime type
  */
 function get_post_mime_type($ID = '') {
-	$post = & get_post($ID);
+	$post = get_post($ID);
 
 	if ( is_object($post) )
 		return $post->post_mime_type;
@@ -3716,7 +3716,7 @@
 	if (strpos($url, home_url('/?attachment_id=')) !== false)
 		return true;
 	if ( $id = url_to_postid($url) ) {
-		$post = & get_post($id);
+		$post = get_post($id);
 		if ( 'attachment' == $post->post_type )
 			return true;
 	}
@@ -4012,7 +4012,7 @@
  */
 function wp_get_attachment_metadata( $post_id = 0, $unfiltered = false ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 
 	$data = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
@@ -4034,7 +4034,7 @@
  */
 function wp_update_attachment_metadata( $post_id, $data ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 
 	$data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID );
@@ -4052,7 +4052,7 @@
  */
 function wp_get_attachment_url( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 
 	if ( 'attachment' != $post->post_type )
@@ -4091,7 +4091,7 @@
  */
 function wp_get_attachment_thumb_file( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 	if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
 		return false;
@@ -4113,7 +4113,7 @@
  */
 function wp_get_attachment_thumb_url( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 	if ( !$url = wp_get_attachment_url( $post->ID ) )
 		return false;
@@ -4140,7 +4140,7 @@
  */
 function wp_attachment_is_image( $post_id = 0 ) {
 	$post_id = (int) $post_id;
-	if ( !$post =& get_post( $post_id ) )
+	if ( !$post = get_post( $post_id ) )
 		return false;
 
 	if ( !$file = get_attached_file( $post->ID ) )
@@ -4171,7 +4171,7 @@
 		$post_mimes = array();
 		if ( is_numeric($mime) ) {
 			$mime = (int) $mime;
-			if ( $post =& get_post( $mime ) ) {
+			if ( $post = get_post( $mime ) ) {
 				$post_id = (int) $post->ID;
 				$ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
 				if ( !empty($ext) ) {
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 21594)
+++ wp-includes/comment.php	(working copy)
@@ -1371,7 +1371,7 @@
 		if ( '0' == $commentdata['comment_approved'] )
 			wp_notify_moderator($comment_ID);
 
-		$post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
+		$post = get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
 
 		if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) )
 			wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 21594)
+++ wp-includes/media.php	(working copy)
@@ -655,7 +655,7 @@
 		$hwstring = image_hwstring($width, $height);
 		if ( is_array($size) )
 			$size = join('x', $size);
-		$attachment =& get_post($attachment_id);
+		$attachment = get_post($attachment_id);
 		$default_attr = array(
 			'src'	=> $src,
 			'class'	=> "attachment-$size",
Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 21594)
+++ wp-includes/link-template.php	(working copy)
@@ -96,7 +96,7 @@
 		$post = $id;
 		$sample = true;
 	} else {
-		$post = &get_post($id);
+		$post = get_post($id);
 		$sample = false;
 	}
 
@@ -178,7 +178,7 @@
 function get_post_permalink( $id = 0, $leavename = false, $sample = false ) {
 	global $wp_rewrite;
 
-	$post = &get_post($id);
+	$post = get_post($id);
 
 	if ( is_wp_error( $post ) )
 		return $post;
@@ -271,7 +271,7 @@
 	if ( !$id )
 		$id = (int) $post->ID;
 	else
-		$post = &get_post($id);
+		$post = get_post($id);
 
 	$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
 
@@ -898,7 +898,7 @@
  * @return string
  */
 function get_edit_post_link( $id = 0, $context = 'display' ) {
-	if ( !$post = &get_post( $id ) )
+	if ( !$post = get_post( $id ) )
 		return;
 
 	if ( 'display' == $context )
@@ -927,7 +927,7 @@
  * @param int $id Optional. Post ID.
  */
 function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
-	if ( !$post = &get_post( $id ) )
+	if ( !$post = get_post( $id ) )
 		return;
 
 	if ( !$url = get_edit_post_link( $post->ID ) )
@@ -957,7 +957,7 @@
 	if ( ! empty( $deprecated ) )
 		_deprecated_argument( __FUNCTION__, '3.0' );
 
-	if ( !$post = &get_post( $id ) )
+	if ( !$post = get_post( $id ) )
 		return;
 
 	$post_type_object = get_post_type_object( $post->post_type );
@@ -1204,7 +1204,7 @@
  */
 function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) {
 	if ( $previous && is_attachment() && is_object( $GLOBALS['post'] ) )
-		$post = & get_post($GLOBALS['post']->post_parent);
+		$post = get_post($GLOBALS['post']->post_parent);
 	else
 		$post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);
 
@@ -1369,7 +1369,7 @@
  */
 function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) {
 	if ( $previous && is_attachment() )
-		$post = & get_post($GLOBALS['post']->post_parent);
+		$post = get_post($GLOBALS['post']->post_parent);
 	else
 		$post = get_adjacent_post($in_same_cat, $excluded_categories, $previous);
 
Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 21594)
+++ wp-includes/general-template.php	(working copy)
@@ -1627,7 +1627,7 @@
 
 	if ( is_single() || is_page() ) {
 		$id = 0;
-		$post = &get_post( $id );
+		$post = get_post( $id );
 
 		if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
 			$title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) );
Index: wp-includes/deprecated.php
===================================================================
--- wp-includes/deprecated.php	(revision 21594)
+++ wp-includes/deprecated.php	(working copy)
@@ -26,7 +26,7 @@
 function get_postdata($postid) {
 	_deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' );
 
-	$post = &get_post($postid);
+	$post = get_post($postid);
 
 	$postdata = array (
 		'ID' => $post->ID,
@@ -1892,7 +1892,7 @@
 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' );
 	$id = (int) $id;
-	$_post = & get_post($id);
+	$_post = get_post($id);
 
 	if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
 		return __('Missing Attachment');
@@ -1921,7 +1921,7 @@
 function get_attachment_icon_src( $id = 0, $fullsize = false ) {
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' );
 	$id = (int) $id;
-	if ( !$post = & get_post($id) )
+	if ( !$post = get_post($id) )
 		return false;
 
 	$file = get_attached_file( $post->ID );
@@ -1966,7 +1966,7 @@
 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
 	$id = (int) $id;
-	if ( !$post = & get_post($id) )
+	if ( !$post = get_post($id) )
 		return false;
 
 	if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
@@ -2023,7 +2023,7 @@
 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
 	_deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
 	$id = (int) $id;
-	if ( !$post = & get_post($id) )
+	if ( !$post = get_post($id) )
 		return false;
 
 	if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
@@ -2801,7 +2801,7 @@
 	_deprecated_function( __FUNCTION__, '3.3' );
 
 	if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) )
-		$post = & get_post($GLOBALS['post']->post_parent);
+		$post = get_post($GLOBALS['post']->post_parent);
 
 	if ( empty($post) )
 		return;
Index: wp-admin/includes/post.php
===================================================================
--- wp-admin/includes/post.php	(revision 21594)
+++ wp-admin/includes/post.php	(working copy)
@@ -160,7 +160,7 @@
 
 	// Autosave shouldn't save too soon after a real save
 	if ( 'autosave' == $post_data['action'] ) {
-		$post =& get_post( $post_ID );
+		$post = get_post( $post_ID );
 		$now = time();
 		$then = strtotime($post->post_date_gmt . ' +0000');
 		$delta = AUTOSAVE_INTERVAL / 2;
@@ -439,6 +439,7 @@
 		$post->page_template = 'default';
 		$post->post_parent = 0;
 		$post->menu_order = 0;
+		$post = new WP_Post( $post );
 	}
 
 	$post->post_content = apply_filters( 'default_content', $post_content, $post );
@@ -745,7 +746,7 @@
  * @return unknown
  */
 function _fix_attachment_links( $post_ID ) {
-	$post = & get_post( $post_ID, ARRAY_A );
+	$post = get_post( $post_ID, ARRAY_A );
 	$content = $post['post_content'];
 
 	// quick sanity check, don't run if no pretty permalinks or post is not published
@@ -1012,7 +1013,7 @@
  * @return array With two entries of type string
  */
 function get_sample_permalink($id, $title = null, $name = null) {
-	$post = &get_post($id);
+	$post = get_post($id);
 	if ( !$post->ID )
 		return array('', '');
 
@@ -1078,7 +1079,7 @@
  */
 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
 	global $wpdb;
-	$post = &get_post($id);
+	$post = get_post($id);
 
 	list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
 
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 21594)
+++ wp-admin/includes/template.php	(working copy)
@@ -705,7 +705,7 @@
  */
 function the_attachment_links( $id = false ) {
 	$id = (int) $id;
-	$post = & get_post( $id );
+	$post = get_post( $id );
 
 	if ( $post->post_type != 'attachment' )
 		return false;
Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 21594)
+++ wp-admin/includes/media.php	(working copy)
@@ -893,7 +893,7 @@
  * @return unknown
  */
 function image_media_send_to_editor($html, $attachment_id, $attachment) {
-	$post =& get_post($attachment_id);
+	$post = get_post($attachment_id);
 	if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
 		$url = $attachment['url'];
 		$align = !empty($attachment['align']) ? $attachment['align'] : 'none';
@@ -920,9 +920,9 @@
  */
 function get_attachment_fields_to_edit($post, $errors = null) {
 	if ( is_int($post) )
-		$post =& get_post($post);
+		$post = get_post($post);
 	if ( is_array($post) )
-		$post = (object) $post;
+		$post = new WP_Post( (object) $post );
 
 	$image_url = wp_get_attachment_url($post->ID);
 
Index: wp-admin/post.php
===================================================================
--- wp-admin/post.php	(revision 21594)
+++ wp-admin/post.php	(working copy)
@@ -202,7 +202,7 @@
 case 'trash':
 	check_admin_referer('trash-post_' . $post_id);
 
-	$post = & get_post($post_id);
+	$post = get_post($post_id);
 
 	if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
 		wp_die( __('You are not allowed to move this item to the Trash.') );
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 21594)
+++ wp-admin/upload.php	(working copy)
@@ -57,7 +57,7 @@
 			if ( !$parent_id )
 				return;
 
-			$parent = &get_post( $parent_id );
+			$parent = get_post( $parent_id );
 			if ( !current_user_can( 'edit_post', $parent_id ) )
 				wp_die( __( 'You are not allowed to edit this post.' ) );
 
Index: wp-admin/edit.php
===================================================================
--- wp-admin/edit.php	(revision 21594)
+++ wp-admin/edit.php	(working copy)
@@ -103,7 +103,7 @@
 		case 'delete':
 			$deleted = 0;
 			foreach( (array) $post_ids as $post_id ) {
-				$post_del = & get_post($post_id);
+				$post_del = get_post($post_id);
 
 				if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
 					wp_die( __('You are not allowed to delete this item.') );
