mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Meta: Sanitize meta key before checking protection status.
Props zieladam, peterwilsoncc, xknown, whyisjake. Merges [49377,49381] to trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@49387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user