Make WordPress Core

Ticket #23033: 23033.1.patch

File 23033.1.patch, 776 bytes (added by ericlewis, 10 years ago)

Pervious patch was created in the subdirectory, here's a proper one.

  • wp-includes/meta.php

     
    738738                        $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : '';
    739739                        $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';
    740740
     741                        // Meta type validation
    741742                        if ( 'NUMERIC' == $meta_type )
    742743                                $meta_type = 'SIGNED';
    743                         elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) )
     744                        elseif ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|DECIMAL(?:\(\d+(?:,\s*\d+)?\))?)$/', $meta_type ) )
    744745                                $meta_type = 'CHAR';
    745746
    746747                        $meta_value = isset( $q['value'] ) ? $q['value'] : null;