From 41bd579f15d88dc31acd2c2763dc495f9e889f79 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 12 Sep 2007 17:46:13 +0000 Subject: [PATCH] Ensure the parentlink is trailingslashed when building the url - don't trim / off the front. Fixes #2801 props Libertus git-svn-id: https://develop.svn.wordpress.org/trunk@6095 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 027edd0831..f01f594331 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -167,7 +167,7 @@ function get_attachment_link($id = false) { else $parentlink = get_permalink( $object->post_parent ); if (strpos($parentlink, '?') === false) - $link = trim($parentlink, '/') . '/' . $object->post_name . '/'; + $link = trailingslashit($parentlink) . $object->post_name . '/'; } if (! $link ) {