mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-12 03:13:29 +01:00
Query: Remove nextpage block delimiters when setting up global post data.
`WP_Query::setup_postdata()` splits the post up by `<!--nextpage-->`, which causes invalid block data to be contained in the post content. This change removes the `<!-- wp:nextpage -->` and `<!-- /wp:nextpage -->`, as well. Props pento, youknowriad, azaozz, noisysocks. See #45401. Built from https://develop.svn.wordpress.org/branches/5.0@43940 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
97e84f8a03
commit
0a164850fc
@ -4000,6 +4000,10 @@ class WP_Query {
|
|||||||
$content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
|
$content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
|
||||||
$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
|
$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
|
||||||
|
|
||||||
|
// Remove the nextpage block delimiters, to avoid invalid block structures in the split content.
|
||||||
|
$content = str_replace( '<!-- wp:nextpage -->', '', $content );
|
||||||
|
$content = str_replace( '<!-- /wp:nextpage -->', '', $content );
|
||||||
|
|
||||||
// Ignore nextpage at the beginning of the content.
|
// Ignore nextpage at the beginning of the content.
|
||||||
if ( 0 === strpos( $content, '<!--nextpage-->' ) )
|
if ( 0 === strpos( $content, '<!--nextpage-->' ) )
|
||||||
$content = substr( $content, 15 );
|
$content = substr( $content, 15 );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-beta5-43939';
|
$wp_version = '5.0-beta5-43940';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user