Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php
+++ src/wp-includes/formatting.php
@@ -3463,8 +3463,17 @@
  */
 function wp_parse_str( $string, &$array ) {
 	parse_str( $string, $array );
-	if ( get_magic_quotes_gpc() )
+	if ( get_magic_quotes_gpc() ) {
 		$array = stripslashes_deep( $array );
+	}
+
+	// Cast strings of 'true' and 'false' as proper booleans
+	foreach( (array) $array as $key => $value ) {
+		if ( is_string( $value ) && ( 'true' === $value || 'false' === $value ) ) {
+			$array[$key] = wp_validate_boolean( $value );
+	        }
+	}
+
 	/**
 	 * Filter the array of variables derived from a parsed string.
 	 *
Index: tests/phpunit/tests/formatting/WPParseStr.php
new file mode 100644
===================================================================
--- /dev/null
+++ tests/phpunit/tests/formatting/WPParseStr.php
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @group formatting
+ */
+class Tests_Formatting_WPParseStr extends WP_UnitTestCase {
+	public function test_querystring_values_as_booleans() {
+		// when a querystring is used as the arg in wp_parse_args(), wp_parse_str() is used
+		$r = wp_parse_args( 'this_should_be_bool_false=false&this_should_be_bool_true=true', array() );
+
+		$this->assertFalse( $r['this_should_be_bool_false'] );
+		$this->assertTrue(  $r['this_should_be_bool_true'] );
+	}
+}
