From 8f24ab263d2d07d55798b32fd04f7482b6db2e2f 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: https://develop.svn.wordpress.org/trunk@24599 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 )