From 6c31c17921061c309d8b8430b9ed4ecd72985484 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 Dec 2006 22:50:54 +0000 Subject: [PATCH] Avoid infinite loop when getting attachment link. git-svn-id: http://svn.automattic.com/wordpress/trunk@4644 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 151a98641..ef570f282 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