Make WordPress Core


Ignore:
Timestamp:
10/11/2015 11:29:55 PM (11 years ago)
Author:
jeremyfelt
Message:

MS: Reject truthy, non-numeric network ids in _network_option().

A valid $network_id or null/false is expected as the first parameter for _network_option(). If something other than that is passed, we immediately return false rather than attempting to guess what network was intended.

See #28290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r35024 r35025  
    10701070        global $wpdb, $current_site;
    10711071
     1072        if ( $network_id && ! is_numeric( $network_id ) ) {
     1073                return false;
     1074        }
     1075
    10721076        $network_id = (int) $network_id;
    10731077
    … …  
    11831187        global $wpdb, $current_site;
    11841188
     1189        if ( $network_id && ! is_numeric( $network_id ) ) {
     1190                return false;
     1191        }
     1192
    11851193        $network_id = (int) $network_id;
    11861194
    … …  
    12881296        global $wpdb, $current_site;
    12891297
     1298        if ( $network_id && ! is_numeric( $network_id ) ) {
     1299                return false;
     1300        }
     1301
    12901302        $network_id = (int) $network_id;
    12911303
    … …  
    13661378function update_network_option( $network_id, $option, $value ) {
    13671379        global $wpdb, $current_site;
     1380
     1381        if ( $network_id && ! is_numeric( $network_id ) ) {
     1382                return false;
     1383        }
    13681384
    13691385        $network_id = (int) $network_id;
Note: See TracChangeset for help on using the changeset viewer.