Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 24095)
+++ wp-includes/media.php	(working copy)
@@ -1850,8 +1850,7 @@
  * @return array Found attachments
  */
 function get_attached_media( $type, $post_id = 0 ) {
-	$post = empty( $post_id ) ? get_post() : get_post( $post_id );
-	if ( empty( $post ) )
+	if ( ! $post = get_post( $post_id ) )
 		return;
 
 	$args = array(
@@ -2347,10 +2346,12 @@
  *		from the expanded shortcode
  */
 function get_post_galleries( $post_id = 0, $html = true ) {
-	$post = empty( $post_id ) ? clone get_post() : get_post( $post_id );
-	if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' )  )
+	if ( ! $post = get_post( $post_id ) )
 		return array();
 
+	if ( ! has_shortcode( $post->post_content, 'gallery' )  )
+		return array();
+
 	return get_content_galleries( $post->post_content, $html );
 }
 
@@ -2364,10 +2365,12 @@
  *		from an expanded shortcode
  */
 function get_post_galleries_images( $post_id = 0 ) {
-	$post = empty( $post_id ) ? clone get_post() : get_post( $post_id );
-	if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' )  )
+	if ( ! $post = get_post( $post_id ) )
 		return array();
 
+	if ( ! has_shortcode( $post->post_content, 'gallery' )  )
+		return array();
+
 	$data = get_content_galleries( $post->post_content, false );
 	return wp_list_pluck( $data, 'src' );
 }
@@ -2382,10 +2385,12 @@
  * @return array Gallery data and srcs parsed from the expanded shortcode
  */
 function get_post_gallery( $post_id = 0, $html = true ) {
-	$post = empty( $post_id ) ? clone get_post() : get_post( $post_id );
-	if ( empty( $post ) || ! has_shortcode( $post->post_content, 'gallery' ) )
+	if ( ! $post = get_post( $post_id ) )
 		return array();
 
+	if ( ! has_shortcode( $post->post_content, 'gallery' ) )
+		return array();
+
 	$data = get_content_galleries( $post->post_content, $html, false, 1 );
 	return reset( $data );
 }
Index: wp-includes/post-formats.php
===================================================================
--- wp-includes/post-formats.php	(revision 24095)
+++ wp-includes/post-formats.php	(working copy)
@@ -319,9 +319,8 @@
  * @param int $id (optional) The post ID.
  * @return string Formatted output based on associated post format.
  */
-function post_formats_compat( $content, $id = 0 ) {
-	$post = empty( $id ) ? get_post() : get_post( $id );
-	if ( empty( $post ) )
+function post_formats_compat( $content, $post_id = 0 ) {
+	if ( ! $post = get_post( $post_id ) )
 		return $content;
 
 	$format = get_post_format( $post );
@@ -643,9 +642,8 @@
  * @param int $id (optional) The post ID.
  * @return array The chat content.
  */
-function get_the_post_format_chat( $id = 0 ) {
-	$post = empty( $id ) ? clone get_post() : get_post( $id );
-	if ( empty( $post ) )
+function get_the_post_format_chat( $post_id = 0 ) {
+	if ( ! $post = get_post( $post_id ) )
 		return array();
 
 	$data = get_content_chat( get_paged_content( $post->post_content ) );
@@ -819,9 +817,8 @@
  * @param int $id (optional) The post ID.
  * @return string A URL, if found.
  */
-function get_the_post_format_url( $id = 0 ) {
-	$post = empty( $id ) ? get_post() : get_post( $id );
-	if ( empty( $post ) )
+function get_the_post_format_url( $post_id = 0 ) {
+	if ( ! $post = get_post( $post_id ) )
 		return '';
 
 	$format = get_post_format( $post->ID );
