mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Block Editor: Update @wordpress package dependencies.
Updates the following packages: block-library, block-serialization-default-parser, block-serialization-spec-parser, blocks, edit-post, editor, format-library. Merges [43955] to trunk. Props youknowriad. Fixes #45145. git-svn-id: https://develop.svn.wordpress.org/trunk@44281 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -364,6 +364,7 @@ class WP_Block_Parser {
|
||||
*
|
||||
* @internal
|
||||
* @since 3.8.0
|
||||
* @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments
|
||||
* @return array
|
||||
*/
|
||||
function next_token() {
|
||||
@@ -378,13 +379,18 @@ class WP_Block_Parser {
|
||||
* match back in PHP to see which one it was.
|
||||
*/
|
||||
$has_match = preg_match(
|
||||
'/<!--\s+(?<closer>\/)?wp:(?<namespace>[a-z][a-z0-9_-]*\/)?(?<name>[a-z][a-z0-9_-]*)\s+(?<attrs>{(?:[^}]+|}+(?=})|(?!}\s+-->).)*?}\s+)?(?<void>\/)?-->/s',
|
||||
'/<!--\s+(?<closer>\/)?wp:(?<namespace>[a-z][a-z0-9_-]*\/)?(?<name>[a-z][a-z0-9_-]*)\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*+)?}\s+)?(?<void>\/)?-->/s',
|
||||
$this->document,
|
||||
$matches,
|
||||
PREG_OFFSET_CAPTURE,
|
||||
$this->offset
|
||||
);
|
||||
|
||||
// if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE
|
||||
if ( false === $has_match ) {
|
||||
return array( 'no-more-tokens', null, null, null, null );
|
||||
}
|
||||
|
||||
// we have no more tokens
|
||||
if ( 0 === $has_match ) {
|
||||
return array( 'no-more-tokens', null, null, null, null );
|
||||
|
||||
Reference in New Issue
Block a user