Don't page off the end. Props Mark J. fixes #3039

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-09-25 01:55:41 +00:00
parent 5d6f4b5ca5
commit 95139ceac6
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,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];
$content = explode('<!--more-->', $content, 2);
if ( (preg_match('/<!--noteaser-->/', $post->post_content) && ((!$multipage) || ($page==1))) )