WordPress.org

Make WordPress Core

Ticket #20854: 20854.diff

File 20854.diff, 753 bytes (added by kobenland, 3 years ago)

Wraps $count in absint()

  • wp-includes/ms-functions.php

     
    19751975        global $wpdb; 
    19761976 
    19771977        $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) ); 
    1978         update_site_option( 'blog_count', $count ); 
     1978        update_site_option( 'blog_count', absint( $count ) ); 
    19791979 
    19801980        $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'") ); 
    1981         update_site_option( 'user_count', $count ); 
     1981        update_site_option( 'user_count', absint( $count ) ); 
    19821982}