WordPress.org

Make WordPress Core

Ticket #37738: class-wp-post.php.patch

File class-wp-post.php.patch, 434 bytes (added by deeptiboddapati, 4 years ago)

Adds a line to check if the input param is an int,bool or float and returns false if it isn't.

  • class-wp-post.php

     
    209209         */
    210210        public static function get_instance( $post_id ) {
    211211                global $wpdb;
    212 
     212                if(!(is_int($post_id) or is_bool($post_id) or is_float($post_id))){
     213                        return false;
     214                }
    213215                $post_id = (int) $post_id;
    214216                if ( ! $post_id )
    215217                        return false;