From f106142a9ba246fba79da405986bf8ac706914d5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 9 Jul 2013 05:23:53 +0000 Subject: [PATCH] Avoid getting tripped up on post content that starts with . props SergeyBiryukov. fixes #16746. git-svn-id: http://core.svn.wordpress.org/trunk@24599 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index fd93c525bd..04286aa517 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3656,12 +3656,15 @@ function setup_postdata( $post ) { if ( is_single() || is_page() || is_feed() ) $more = 1; $content = $post->post_content; - if ( strpos( $content, '' ) ) { + if ( false !== strpos( $content, '' ) ) { if ( $page > 1 ) $more = 1; $content = str_replace( "\n\n", '', $content ); $content = str_replace( "\n", '', $content ); $content = str_replace( "\n", '', $content ); + // Ignore nextpage at the beginning of the content. + if ( 0 === strpos( $content, '' ) ) + $content = substr( $content, 15 ); $pages = explode('', $content); $numpages = count($pages); if ( $numpages > 1 )