Make WordPress Core

Changeset 24599


Ignore:
Timestamp:
07/09/2013 05:23:53 AM (11 years ago)
Author:
nacin
Message:

Avoid getting tripped up on post content that starts with <!--nextpage-->. props SergeyBiryukov. fixes #16746.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r24598 r24599  
    36573657        $more = 1;
    36583658    $content = $post->post_content;
    3659     if ( strpos( $content, '<!--nextpage-->' ) ) {
     3659    if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
    36603660        if ( $page > 1 )
    36613661            $more = 1;
     
    36633663        $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
    36643664        $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
     3665        // Ignore nextpage at the beginning of the content.
     3666        if ( 0 === strpos( $content, '<!--nextpage-->' ) )
     3667            $content = substr( $content, 15 );
    36653668        $pages = explode('<!--nextpage-->', $content);
    36663669        $numpages = count($pages);
Note: See TracChangeset for help on using the changeset viewer.