From 91011917f7948d40bd97408853d5d794cba5cf03 Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 15 Mar 2008 21:27:10 +0000 Subject: [PATCH] Only replace the last segment of the uri when generating the sample permalink. Fixes #6068. git-svn-id: http://svn.automattic.com/wordpress/trunk@7320 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index fdc8b46f14..eb43ae92d2 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -609,7 +609,8 @@ function get_sample_permalink($id, $title=null, $name = null) { // Handle page hierarchy if ( 'page' == $post->post_type ) { $uri = get_page_uri($post->ID); - $uri = str_replace($post->post_name, '', $uri); + $uri = untrailingslashit($uri); + $uri = strrev( stristr( strrev( $uri ), '/' ) ); $uri = untrailingslashit($uri); if ( !empty($uri) ) $uri .='/';