From 0a164850fc27468d4e2b490d7ce2873ae266d004 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Fri, 23 Nov 2018 00:42:45 +0000 Subject: [PATCH] Query: Remove nextpage block delimiters when setting up global post data. `WP_Query::setup_postdata()` splits the post up by ``, which causes invalid block data to be contained in the post content. This change removes the `` and ``, 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 --- wp-includes/class-wp-query.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index a6c248a7bf..6d2cdfa391 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -4000,6 +4000,10 @@ class WP_Query { $content = str_replace( "\n", '', $content ); $content = str_replace( "\n", '', $content ); + // Remove the nextpage block delimiters, to avoid invalid block structures in the split content. + $content = str_replace( '', '', $content ); + $content = str_replace( '', '', $content ); + // Ignore nextpage at the beginning of the content. if ( 0 === strpos( $content, '' ) ) $content = substr( $content, 15 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index cb61776f6c..6eec6742da 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.