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. Built from https://develop.svn.wordpress.org/trunk@35025 git-svn-id: http://core.svn.wordpress.org/trunk@34990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
092478579a
commit
364e63b83b
|
@ -1069,6 +1069,10 @@ function update_site_option( $option, $value ) {
|
||||||
function get_network_option( $network_id, $option, $default = false ) {
|
function get_network_option( $network_id, $option, $default = false ) {
|
||||||
global $wpdb, $current_site;
|
global $wpdb, $current_site;
|
||||||
|
|
||||||
|
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$network_id = (int) $network_id;
|
$network_id = (int) $network_id;
|
||||||
|
|
||||||
// Fallback to the current network if a network ID is not specified.
|
// Fallback to the current network if a network ID is not specified.
|
||||||
|
@ -1182,6 +1186,10 @@ function get_network_option( $network_id, $option, $default = false ) {
|
||||||
function add_network_option( $network_id, $option, $value ) {
|
function add_network_option( $network_id, $option, $value ) {
|
||||||
global $wpdb, $current_site;
|
global $wpdb, $current_site;
|
||||||
|
|
||||||
|
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$network_id = (int) $network_id;
|
$network_id = (int) $network_id;
|
||||||
|
|
||||||
// Fallback to the current network if a network ID is not specified.
|
// Fallback to the current network if a network ID is not specified.
|
||||||
|
@ -1287,6 +1295,10 @@ function add_network_option( $network_id, $option, $value ) {
|
||||||
function delete_network_option( $network_id, $option ) {
|
function delete_network_option( $network_id, $option ) {
|
||||||
global $wpdb, $current_site;
|
global $wpdb, $current_site;
|
||||||
|
|
||||||
|
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$network_id = (int) $network_id;
|
$network_id = (int) $network_id;
|
||||||
|
|
||||||
// Fallback to the current network if a network ID is not specified.
|
// Fallback to the current network if a network ID is not specified.
|
||||||
|
@ -1366,6 +1378,10 @@ function delete_network_option( $network_id, $option ) {
|
||||||
function update_network_option( $network_id, $option, $value ) {
|
function update_network_option( $network_id, $option, $value ) {
|
||||||
global $wpdb, $current_site;
|
global $wpdb, $current_site;
|
||||||
|
|
||||||
|
if ( $network_id && ! is_numeric( $network_id ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$network_id = (int) $network_id;
|
$network_id = (int) $network_id;
|
||||||
|
|
||||||
// Fallback to the current network if a network ID is not specified.
|
// Fallback to the current network if a network ID is not specified.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-35024';
|
$wp_version = '4.4-alpha-35025';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue