From 0fc7ecbc1d468ce55136c29c4ad5b87534701162 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 12 Dec 2006 22:50:54 +0000 Subject: [PATCH] Avoid infinite loop when getting attachment link. git-svn-id: https://develop.svn.wordpress.org/trunk@4644 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 151a98641b..ef570f282a 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -134,7 +134,7 @@ function get_attachment_link($id = false) { } $object = get_post($id); - if ( $wp_rewrite->using_permalinks() && ($object->post_parent > 0) ) { + if ( $wp_rewrite->using_permalinks() && ($object->post_parent > 0) && ($object->post_parent != $id) ) { $parent = get_post($object->post_parent); if ( 'page' == $parent->post_type ) $parentlink = _get_page_link( $object->post_parent ); // Ignores page_on_front