Making WordPress.org

Changeset 13714


Ignore:
Timestamp:
05/16/2024 05:33:32 AM (9 months ago)
Author:
dd32
Message:

Plugin Directory: Blocks: Don't import a block registration call from Javascript if the name contains a variable.

See #6170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r13713 r13714  
    10111011            // Note that this only works with literal strings for the block name and title, and assumes that order.
    10121012            $contents = file_get_contents( $filename );
    1013             if ( $contents && preg_match_all( "#registerBlockType[^{}]{0,500}[(]\s*[\"']([-\w]+/[-\w]+)[\"']\s*,\s*[{]\s*title\s*:[\s\w(]*[\"']([^\"']*)[\"']#ms", $contents, $matches, PREG_SET_ORDER ) ) {
     1013            if ( $contents && preg_match_all( "#registerBlockType[^{}]{0,500}[(]\s*[\"']([-\w]+/[-\w]+)[\"']\s*,\s*[{]\s*title\s*:[\s\w(]*[\"']([^\"']*)[\"'](?!\s*[+])#ms", $contents, $matches, PREG_SET_ORDER ) ) {
    10141014                foreach ( $matches as $match ) {
    10151015                    $blocks[] = (object) [
Note: See TracChangeset for help on using the changeset viewer.