Fix get_pagenum_link() to work with path info permalinks and permalinks without trailing slashes. Bug 0002040.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-08-07 18:12:54 +00:00
parent a2342f1a3f
commit 1a47e9d839
1 changed files with 7 additions and 1 deletions

View File

@ -331,7 +331,13 @@ function get_pagenum_link($pagenum = 1){
// otherwise, it could be rewritten, OR just the default index ...
} elseif( '' != get_settings('permalink_structure')) {
$permalink = 1;
$qstr = preg_replace('|(.*)/[^/]*|', '$1/', $qstr).$page_modstring.$pagenum;
// If it's not a path info permalink structure, trim the index.
if ( ! preg_match('#^/*' . get_settings('blogfilename') . '#', get_settings('permalink_structure'))) {
$qstr = preg_replace("#/*" . get_settings('blogfilename') . "/*#", '/', $qstr);
}
$qstr = trailingslashit($qstr) . $page_modstring . $pagenum;
} else {
$qstr = get_settings('blogfilename') . $querystring_start.$page_querystring.$querystring_equal.$pagenum;
}