Ticket #38203: 38203.2.patch
| File 38203.2.patch, 2.1 KB (added by , 15 months ago) |
|---|
-
src/wp-includes/functions.php
8985 8985 } 8986 8986 8987 8987 /** 8988 * Checks if an integer is greater than zero. 8989 * 8990 * This function is primarily used to verify that the ID of an object is neither 8991 * zero nor a negative number. Consider using it in place of `! $object_id` when 8992 * the ID you need to check cannot be less than zero. 8993 * 8994 * For instance, the Meta API uses this function to prevent plugins from trying 8995 * to save data to invalid objects, and also to avoid using`absint( $object_id )` 8996 * to force the object ID into being valid. 8997 * 8998 * @since 6.9.0 8999 * 9000 * @param int $integer The integer to check. 9001 * @return bool Whether the integer is greater than zero. 9002 */ 9003 function wp_is_int_greater_than_zero( $integer = 0 ) { 9004 return ( $integer > 0 ); 9005 } 9006 9007 /** 8988 9008 * Creates and returns the markup for an admin notice. 8989 9009 * 8990 9010 * @since 6.4.0 -
src/wp-includes/meta.php
44 44 return false; 45 45 } 46 46 47 $object_id = absint( $object_id );48 if ( ! $object_id) {47 $object_id = intval( $object_id ); 48 if ( ! wp_is_int_greater_than_zero( $object_id ) ) { 49 49 return false; 50 50 } 51 51 … … 200 200 return false; 201 201 } 202 202 203 $object_id = absint( $object_id );204 if ( ! $object_id) {203 $object_id = intval( $object_id ); 204 if ( ! wp_is_int_greater_than_zero( $object_id ) ) { 205 205 return false; 206 206 } 207 207 … … 403 403 return false; 404 404 } 405 405 406 $object_id = absint( $object_id );407 if ( ! $object_id && ! $delete_all) {406 $object_id = intval( $object_id ); 407 if ( ! wp_is_int_greater_than_zero( $object_id ) && ! $delete_all) { 408 408 return false; 409 409 } 410 410 … … 630 630 return false; 631 631 } 632 632 633 $object_id = absint( $object_id );634 if ( ! $object_id) {633 $object_id = intval( $object_id ); 634 if ( ! wp_is_int_greater_than_zero( $object_id ) ) { 635 635 return false; 636 636 } 637 637 … … 769 769 return false; 770 770 } 771 771 772 $object_id = absint( $object_id );773 if ( ! $object_id) {772 $object_id = intval( $object_id ); 773 if ( ! wp_is_int_greater_than_zero( $object_id ) ) { 774 774 return false; 775 775 } 776 776
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)