Index: post-template.php
===================================================================
--- post-template.php	(revision 33553)
+++ post-template.php	(working copy)
@@ -1556,7 +1556,7 @@
  *
  * @since 2.5.0
  *
- * @param int|WP_Post  $id        Optional. Post ID or post object.
+ * @param int          $id        Optional. Post ID or post object.
  * @param string       $size      Optional, default is 'thumbnail'. Size of image, either array or string.
  * @param bool         $permalink Optional, default is false. Whether to add permalink to image.
  * @param bool         $icon      Optional, default is false. Whether to include icon.
@@ -1565,7 +1565,6 @@
  * @return string HTML content.
  */
 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) {
-	$id = intval( $id );
 	$_post = get_post( $id );
 
 	if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )
@@ -1577,7 +1576,7 @@
 	if ( $text ) {
 		$link_text = $text;
 	} elseif ( $size && 'none' != $size ) {
-		$link_text = wp_get_attachment_image( $id, $size, $icon, $attr );
+		$link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr );
 	} else {
 		$link_text = '';
 	}
