Coding Standards: Restore correct regex formatting in `dbDelta()`.

An earlier regex for normalizing index definitions disables the PHPCS check for extra padding in order to keep a more readable indentation. However, this was missed for index columns regex.

Follow-up to [37583], [42228], [42249], [42343].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53896


git-svn-id: http://core.svn.wordpress.org/trunk@53455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-08-14 02:14:12 +00:00
parent 8a9a20c3ee
commit 0e6a976c0a
2 changed files with 18 additions and 16 deletions

View File

@ -2891,27 +2891,29 @@ function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N
// Normalize columns.
foreach ( $index_columns as $id => &$index_column ) {
// Extract column name and number of indexed characters (sub_part).
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
preg_match(
'/'
. '`?' // Name can be escaped with a backtick.
. '(?P<column_name>' // 1) Name of the column.
. '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'
. ')'
. '`?' // Name can be escaped with a backtick.
. '(?:' // Optional sub part.
. '\s*' // Optional white space character between name and opening bracket.
. '\(' // Opening bracket for the sub part.
. '\s*' // Optional white space character after opening bracket.
. '(?P<sub_part>'
. '\d+' // 2) Number of indexed characters.
. ')'
. '\s*' // Optional white space character before closing bracket.
. '\)' // Closing bracket for the sub part.
. ')?'
. '`?' // Name can be escaped with a backtick.
. '(?P<column_name>' // 1) Name of the column.
. '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'
. ')'
. '`?' // Name can be escaped with a backtick.
. '(?:' // Optional sub part.
. '\s*' // Optional white space character between name and opening bracket.
. '\(' // Opening bracket for the sub part.
. '\s*' // Optional white space character after opening bracket.
. '(?P<sub_part>'
. '\d+' // 2) Number of indexed characters.
. ')'
. '\s*' // Optional white space character before closing bracket.
. '\)' // Closing bracket for the sub part.
. ')?'
. '/',
$index_column,
$index_column_matches
);
// phpcs:enable
// Escape the column name with backticks.
$index_column = '`' . $index_column_matches['column_name'] . '`';

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53895';
$wp_version = '6.1-alpha-53896';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.