From 1139d6fd36180f2badb5acca18a71b8bd43f2a7e Mon Sep 17 00:00:00 2001 From: rboren Date: Mon, 7 Jun 2004 04:41:06 +0000 Subject: [PATCH] posts_nav_link fixes. http://wordpress.org/support/6/6979 git-svn-id: http://svn.automattic.com/wordpress/trunk@1391 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-links.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index 4c0a5bece6..44ee6dbea1 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -335,10 +335,12 @@ function get_pagenum_link($pagenum = 1){ } $home_root = str_replace('http://', '', trim(get_settings('home'))); + $home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root); $home_root = preg_replace('|/+|i', '/', $home_root); - $qstr = str_replace($home_root . '/', '', $qstr); + $home_root = trailingslashit($home_root); + $qstr = preg_replace('|^'. $home_root . '|', '', $qstr); $qstr = preg_replace('|^/+|', '', $qstr); - return preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . trailingslashit($qstr) ); + return preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr ); } function next_posts($max_page = 0) { // original by cfactor at cooltux.org