From 89526ca7f125c1fbfce6e93026b6ca14c0c81290 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 3 Nov 2014 15:55:23 +0000 Subject: [PATCH] Ignore case when checking string 'false' in `wp_validate_boolean()`. Props TobiasBg, kitchin. Fixes #30238. Built from https://develop.svn.wordpress.org/trunk@30207 git-svn-id: http://core.svn.wordpress.org/trunk@30207 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index dce925a677..8ca5ca17de 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4740,7 +4740,9 @@ function reset_mbstring_encoding() { } /** - * Alternative to filter_var( $var, FILTER_VALIDATE_BOOLEAN ). + * Filter/validate a variable as a boolean. + * + * Alternative to `filter_var( $var, FILTER_VALIDATE_BOOLEAN )`. * * @since 4.0.0 * @@ -4752,7 +4754,7 @@ function wp_validate_boolean( $var ) { return $var; } - if ( 'false' === $var ) { + if ( is_string( $var ) && 'false' === strtolower( $var ) ) { return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index b257e972fd..a67ccea9b2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30206'; +$wp_version = '4.1-alpha-30207'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.