From 92bfcd3e37e4bba4f7c567cc290442f17224c490 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 30 Mar 2005 06:51:55 +0000 Subject: [PATCH] Fix Manage->Posts paging when running WP in a subdir. http://mosquito.wordpress.org/view.php?id=1177 git-svn-id: https://develop.svn.wordpress.org/trunk@2499 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 66a195b9de..9eec371563 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -377,8 +377,6 @@ function get_pagenum_link($pagenum = 1) { $page_modstring = "page/"; $page_modregex = "page/?"; $permalink = 0; - //$index = 'index.php'; - $index = $_SERVER['SCRIPT_NAME']; $home_root = parse_url(get_settings('home')); $home_root = $home_root['path']; @@ -386,6 +384,10 @@ function get_pagenum_link($pagenum = 1) { $qstr = preg_replace('|^'. $home_root . '|', '', $qstr); $qstr = preg_replace('|^/+|', '', $qstr); + $index = $_SERVER['SCRIPT_NAME']; + $index = preg_replace('|^'. $home_root . '|', '', $index); + $index = preg_replace('|^/+|', '', $index); + // if we already have a QUERY style page string if( stristr( $qstr, $page_querystring ) ) { $replacement = "$page_querystring=$pagenum";