WordPress.org

Make WordPress Core

Ticket #13317: 13317-negative-values-equal-zero.2.patch

File 13317-negative-values-equal-zero.2.patch, 475 bytes (added by hakre, 8 years ago)

updated using is_scalar() instead of is_numeric()

  • wp-includes/pluggable.php

     
    103103function get_userdata( $user_id ) {
    104104        global $wpdb;
    105105
    106         if ( ! is_numeric( $user_id ) )
     106        if ( ! is_scalar( $user_id ) )
    107107                return false;
    108108               
    109         $user_id = absint( $user_id );
     109        $user_id = max( 0, (int) $user_id );
    110110        if ( ! $user_id )
    111111                return false;
    112112