diff --git src/wp-includes/post-template.php src/wp-includes/post-template.php
index be15252..a894c6b 100644
--- src/wp-includes/post-template.php
+++ src/wp-includes/post-template.php
@@ -1459,8 +1459,10 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
 		$link_text = '';
 	}
 
-	if ( trim( $link_text ) == '' )
-		$link_text = $_post->post_title;
+	if ( trim( $link_text ) == '' ) {
+		$parts = pathinfo( get_attached_file( $_post->ID ) );
+		$link_text = esc_html( $parts['filename'] );
+	}
 
 	/**
 	 * Filters a retrieved attachment page link.
