- Timestamp:
- 11/04/2023 12:24:33 AM (16 months ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r56664 r57061 2911 2911 2912 2912 // Extract type, name and columns from the definition. 2913 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation2914 2913 preg_match( 2915 '/^ '2916 . '(?P<index_type>' //1) Type of the index.2917 . 'PRIMARY\s+KEY|(?:UNIQUE|FULLTEXT|SPATIAL)\s+(?:KEY|INDEX)|KEY|INDEX'2918 . ')'2919 . '\s+' //Followed by at least one white space character.2920 . '(?:' //Name of the index. Optional if type is PRIMARY KEY.2921 . '`?' //Name can be escaped with a backtick.2922 . '(?P<index_name>' //2) Name of the index.2923 . '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'2924 . ')'2925 . '`?' //Name can be escaped with a backtick.2926 . '\s+' //Followed by at least one white space character.2927 . ')*'2928 . '\(' //Opening bracket for the columns.2929 . '(?P<index_columns>'2930 . '.+?' //3) Column names, index prefixes, and orders.2931 . ')'2932 . '\)' //Closing bracket for the columns.2933 . '$/im',2914 '/^ 2915 (?P<index_type> # 1) Type of the index. 2916 PRIMARY\s+KEY|(?:UNIQUE|FULLTEXT|SPATIAL)\s+(?:KEY|INDEX)|KEY|INDEX 2917 ) 2918 \s+ # Followed by at least one white space character. 2919 (?: # Name of the index. Optional if type is PRIMARY KEY. 2920 `? # Name can be escaped with a backtick. 2921 (?P<index_name> # 2) Name of the index. 2922 (?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+ 2923 ) 2924 `? # Name can be escaped with a backtick. 2925 \s+ # Followed by at least one white space character. 2926 )* 2927 \( # Opening bracket for the columns. 2928 (?P<index_columns> 2929 .+? # 3) Column names, index prefixes, and orders. 2930 ) 2931 \) # Closing bracket for the columns. 2932 $/imx', 2934 2933 $fld, 2935 2934 $index_matches 2936 2935 ); 2937 // phpcs:enable2938 2936 2939 2937 // Uppercase the index type and normalize space characters. … … 2953 2951 foreach ( $index_columns as $id => &$index_column ) { 2954 2952 // Extract column name and number of indexed characters (sub_part). 2955 // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation2956 2953 preg_match( 2957 '/ '2958 . '`?' //Name can be escaped with a backtick.2959 . '(?P<column_name>' //1) Name of the column.2960 . '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'2961 . ')'2962 . '`?' //Name can be escaped with a backtick.2963 . '(?:' //Optional sub part.2964 . '\s*' //Optional white space character between name and opening bracket.2965 . '\(' //Opening bracket for the sub part.2966 . '\s*' //Optional white space character after opening bracket.2967 . '(?P<sub_part>'2968 . '\d+' //2) Number of indexed characters.2969 . ')'2970 . '\s*' //Optional white space character before closing bracket.2971 . '\)' //Closing bracket for the sub part.2972 . ')?'2973 . '/',2954 '/ 2955 `? # Name can be escaped with a backtick. 2956 (?P<column_name> # 1) Name of the column. 2957 (?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+ 2958 ) 2959 `? # Name can be escaped with a backtick. 2960 (?: # Optional sub part. 2961 \s* # Optional white space character between name and opening bracket. 2962 \( # Opening bracket for the sub part. 2963 \s* # Optional white space character after opening bracket. 2964 (?P<sub_part> 2965 \d+ # 2) Number of indexed characters. 2966 ) 2967 \s* # Optional white space character before closing bracket. 2968 \) # Closing bracket for the sub part. 2969 )? 2970 /x', 2974 2971 $index_column, 2975 2972 $index_column_matches 2976 2973 ); 2977 // phpcs:enable2978 2974 2979 2975 // Escape the column name with backticks. -
trunk/src/wp-includes/kses.php
r57056 r57061 1566 1566 */ 1567 1567 1568 $validation = " %^($regex)+$%x";1569 $extraction = " %$regex%x";1568 $validation = "/^($regex)+$/x"; 1569 $extraction = "/$regex/x"; 1570 1570 1571 1571 if ( 1 === preg_match( $validation, $attr ) ) {
Note: See TracChangeset
for help on using the changeset viewer.