New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Serialization Default Parser: Use PCRE v6.x-compatible subpattern syntax #13369

Merged
merged 1 commit into from Jan 21, 2019

Conversation

Projects
None yet
4 participants
@aduth
Copy link
Member

aduth commented Jan 18, 2019

Closes #13310

This pull request seeks to use a PCRE 6.x-compatible subpattern syntax in the block serialization parser. See #13310 for more information for the rationale of this change.

Testing instructions:

The affected PHP code here does not override the behavior of the WP_Block_Parser_Block class defined in WordPress 5.x . Therefore, you must test either by using an older version of WordPress, or by manually commenting the following line in your WordPress installation (see also #11015):

https://github.com/WordPress/WordPress/blob/b7897c576141adee3686056aff147ea09566c918/wp-settings.php#L258

...and applying a patch update to your local Gutenberg plugin to force the load of the bundled parser class definition:

diff --git a/gutenberg.php b/gutenberg.php
index 2df698bd4..f62a78bab 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -567,3 +567,5 @@ function gutenberg_add_responsive_body_class( $classes ) {
 }
 
 add_filter( 'body_class', 'gutenberg_add_responsive_body_class' );
+
+require_once dirname( __FILE__ ) . '/packages/block-serialization-default-parser/parser.php';

Then, confirm there are no regressions in the behavior of the parser. For example, a dynamic block such as the Latest Posts block should display in a front-end preview.

Ensure parser tests pass:

npm run test-unit-php

@aduth aduth requested review from mcsf , pento and dmsnell Jan 18, 2019

@aduth aduth changed the title Block Serialization Default Parser: Use PCRE v6.x subpattern syntax Block Serialization Default Parser: Use PCRE v6.x-compatible subpattern syntax Jan 18, 2019

@pento

pento approved these changes Jan 19, 2019

Copy link
Member

pento left a comment

👍🏻

@mcsf

mcsf approved these changes Jan 21, 2019

Copy link
Contributor

mcsf left a comment

LGTM!

@youknowriad youknowriad added this to the 5.0 (Gutenberg) milestone Jan 21, 2019

@youknowriad youknowriad merged commit 44409fb into master Jan 21, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the fix/13310-pcre-6-subpatterns branch Jan 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment