diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index b83f64c5c2..9422315922 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -2248,6 +2248,7 @@ function dbDelta( $queries = '', $execute = true ) { */ // Extract type, name and columns from the definition. + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation preg_match( '/^' . '(?P' // 1) Type of the index. @@ -2271,6 +2272,7 @@ function dbDelta( $queries = '', $execute = true ) { $fld, $index_matches ); + // phpcs:enable // Uppercase the index type and normalize space characters. $index_type = strtoupper( preg_replace( '/\s+/', ' ', trim( $index_matches['index_type'] ) ) ); diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 1dfaff9f26..442a6f282c 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -617,8 +617,9 @@ function get_html_split_regex() { static $regex; if ( ! isset( $regex ) ) { + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation $comments = - '!' // Start of comment, after the <. + '!' // Start of comment, after the <. . '(?:' // Unroll the loop: Consume everything until --> is found. . '-(?!->)' // Dash not followed by end of comment. . '[^\-]*+' // Consume non-dashes. @@ -626,7 +627,7 @@ function get_html_split_regex() { . '(?:-->)?'; // End of comment. If not found, match all input. $cdata = - '!\[CDATA\[' // Start of comment, after the <. + '!\[CDATA\[' // Start of comment, after the <. . '[^\]]*+' // Consume non-]. . '(?:' // Unroll the loop: Consume everything until ]]> is found. . '](?!]>)' // One ] not followed by end of comment. @@ -635,7 +636,7 @@ function get_html_split_regex() { . '(?:]]>)?'; // End of comment. If not found, match all input. $escaped = - '(?=' // Is the element escaped? + '(?=' // Is the element escaped? . '!--' . '|' . '!\[CDATA\[' @@ -647,7 +648,7 @@ function get_html_split_regex() { . ')'; $regex = - '/(' // Capture the entire match. + '/(' // Capture the entire match. . '<' // Find start of element. . '(?' // Conditional expression follows. . $escaped // Find end of escaped element. @@ -655,6 +656,7 @@ function get_html_split_regex() { . '[^>]*>?' // Find end of normal element. . ')' . ')/'; + // phpcs:enable } return $regex; @@ -677,8 +679,9 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) { static $html_regex; if ( ! isset( $html_regex ) ) { + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation $comment_regex = - '!' // Start of comment, after the <. + '!' // Start of comment, after the <. . '(?:' // Unroll the loop: Consume everything until --> is found. . '-(?!->)' // Dash not followed by end of comment. . '[^\-]*+' // Consume non-dashes. @@ -686,12 +689,13 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) { . '(?:-->)?'; // End of comment. If not found, match all input. $html_regex = // Needs replaced with wp_html_split() per Shortcode API Roadmap. - '<' // Find start of element. + '<' // Find start of element. . '(?(?=!--)' // Is this a comment? . $comment_regex // Find end of comment. . '|' . '[^>]*>?' // Find end of element. If not found, match all input. . ')'; + // phpcs:enable } if ( empty( $shortcode_regex ) ) { @@ -717,6 +721,7 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) { function _get_wptexturize_shortcode_regex( $tagnames ) { $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex(). + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation $regex = '\[' // Find start of shortcode. . '[\/\[]?' // Shortcodes may begin with [/ or [[ @@ -728,6 +733,7 @@ function _get_wptexturize_shortcode_regex( $tagnames ) { . ')*+' // Possessive critical. . '\]' // Find end of shortcode. . '\]?'; // Shortcodes may end with ]] + // phpcs:enable return $regex; } @@ -817,6 +823,7 @@ function shortcode_unautop( $pee ) { $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) ); $spaces = wp_spaces_regexp(); + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation $pattern = '/' . '

' // Opening paragraph @@ -848,6 +855,7 @@ function shortcode_unautop( $pee ) { . '(?:' . $spaces . ')*+' // optional trailing whitespace . '<\\/p>' // closing paragraph . '/'; + // phpcs:enable return preg_replace( $pattern, '$1', $pee ); } diff --git a/wp-includes/kses.php b/wp-includes/kses.php index 8a595903ea..f5d0ef5ef9 100644 --- a/wp-includes/kses.php +++ b/wp-includes/kses.php @@ -1093,6 +1093,7 @@ function wp_kses_hair_parse( $attr ) { return array(); } + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation $regex = '(?:' . '[-a-zA-Z:]+' // Attribute name. @@ -1113,6 +1114,7 @@ function wp_kses_hair_parse( $attr ) { . '(?:\s|$)' // If attribute has no value, space is required. . ')' . '\s*'; // Trailing space is optional except as mentioned above. + // phpcs:enable // Although it is possible to reduce this procedure to a single regexp, // we must run that regexp twice to get exactly the expected result. diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 596e6c0eb7..61d6054f67 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -235,8 +235,10 @@ function get_shortcode_regex( $tagnames = null ) { // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag() // Also, see shortcode_unautop() and shortcode.js. + + // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation return - '\\[' // Opening bracket + '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . "($tagregexp)" // 2: Shortcode name . '(?![\\w-])' // Not followed by word character or hyphen @@ -264,6 +266,7 @@ function get_shortcode_regex( $tagnames = null ) { . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] + // phpcs:enable } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 8c46d265b9..cc5ec363de 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42247'; +$wp_version = '5.0-alpha-42249'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.