Meta: Sanitize meta key before checking protection status.

Props zieladam, peterwilsoncc, xknown, whyisjake.
Merges [49377,49381] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49387


git-svn-id: http://core.svn.wordpress.org/trunk@49146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2020-10-29 18:08:06 +00:00
parent a8e86c768c
commit 84a7bde414
2 changed files with 3 additions and 2 deletions

View File

@ -1159,7 +1159,8 @@ function _get_meta_table( $type ) {
* @return bool Whether the meta key is considered protected.
*/
function is_protected_meta( $meta_key, $meta_type = '' ) {
$protected = ( '_' === $meta_key[0] );
$sanitized_key = preg_replace( "/[^\x20-\x7E\p{L}]/", '', $meta_key );
$protected = strlen( $sanitized_key ) > 0 && ( '_' === $sanitized_key[0] );
/**
* Filters whether a meta key is considered protected.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-beta2-49386';
$wp_version = '5.6-beta2-49387';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.