From f605f4ffd127f25d7c1c6c94b26ceed535d19fb8 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 18 Aug 2006 08:36:11 +0000 Subject: [PATCH] Don't page off the end. Props Mark J. fixes #3039 git-svn-id: http://svn.automattic.com/wordpress/trunk@4106 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index d199adf6db..58ba562b24 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -76,6 +76,9 @@ 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]; if ( preg_match('//', $content, $matches) ) { $content = explode($matches[0], $content, 2);