Don't page off the end. Props Mark J. fixes #3039
git-svn-id: https://develop.svn.wordpress.org/trunk@4106 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
af017d27c1
commit
fbfc1f6947
@ -76,6 +76,9 @@ function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_
|
|||||||
else
|
else
|
||||||
$file = $pagenow; //$_SERVER['PHP_SELF'];
|
$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 = $pages[$page-1];
|
||||||
if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {
|
if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {
|
||||||
$content = explode($matches[0], $content, 2);
|
$content = explode($matches[0], $content, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user