WordPress.org

Make WordPress Core

Ticket #13317: 13317.3.patch

File 13317.3.patch, 1.1 KB (added by hakre, 5 years ago)

One must not use absint() or intval()

  • wordpress/wp-includes/functions.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-tests
     
    31323132 * 
    31333133 * @since 2.5.0 
    31343134 * 
    3135  * @param mixed $maybeint Data you wish to have convered to an nonnegative integer 
    3136  * @return int An nonnegative integer 
     3135 * @param scalar|array $maybeint Data to be converted to an integer greate than -1 
     3136 * @return int A non-negative integer  
    31373137 */ 
    31383138function absint( $maybeint ) { 
    3139         return abs( intval( $maybeint ) ); 
     3139        return abs( (int) $maybeint ); 
    31403140} 
    31413141 
    31423142/** 
  • wordpress/wp-includes/pluggable.php

     
    103103function get_userdata( $user_id ) { 
    104104        global $wpdb; 
    105105 
    106         $user_id = absint( $user_id ); 
     106        $user_id = abs( (int) $user_id ); 
    107107        if ( ! $user_id ) 
    108108                return false; 
    109109