From 3cdac022a506c1192454ea6ea45d8009b2d5fdeb Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 21 Aug 2006 10:34:04 +0000 Subject: WP Merge to rev 4106 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@724 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/post-template.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'wp-includes/post-template.php') diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index fcd3f89..58ba562 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -76,8 +76,17 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_ else $file = $pagenow; //$_SERVER['PHP_SELF']; + if ( $page > count($pages) ) // if the requested page doesn't exist + $page = count($pages); // give them the highest numbered page that DOES exist + $content = $pages[$page-1]; - $content = explode('', $content, 2); + if ( preg_match('//', $content, $matches) ) { + $content = explode($matches[0], $content, 2); + if ( !empty($matches[1]) ) + $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1]))); + } else { + $content = array($content); + } if ( (false !== strpos($post->post_content, '') && ((!$multipage) || ($page==1))) ) $stripteaser = 1; $teaser = $content[0]; -- cgit