Make WordPress Core

Changeset 49378


Ignore:
Timestamp:
10/29/2020 05:31:40 PM (4 years ago)
Author:
whyisjake
Message:

Meta: Sanitize meta key before checking protection status.

Props zieladam, peterwilsoncc, xknown, whyisjake.

Location:
branches/5.5
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5/src/wp-includes/meta.php

    r48779 r49378  
    11601160 */
    11611161function is_protected_meta( $meta_key, $meta_type = '' ) {
    1162     $protected = ( '_' === $meta_key[0] );
     1162    $sanitized_key = preg_replace( "/[^\x20-\x7E\p{L}]/", '', $meta_key );
     1163    $protected     = strlen( $sanitized_key ) > 0 && ( '_' == $sanitized_key[0] );
    11631164
    11641165    /**
Note: See TracChangeset for help on using the changeset viewer.