Make WordPress Core

Ticket #56025: 56025.diff

File 56025.diff, 493 bytes (added by karpstrucking, 3 years ago)

update wp_validate_boolean() to validate false-y strings

  • wp-includes/functions.php

    diff --git a/wp-includes/functions.php b/wp-includes/functions.php
    index 4ecad8e808..160d4521f4 100644
    a b function wp_validate_boolean( $var ) { 
    73107310               return $var;
    73117311       }
    73127312
    7313        if ( is_string( $var ) && 'false' === strtolower( $var ) ) {
     7313       if ( is_string( $var ) && ( in_array( strtolower( $var ), array( 'false', 'off', 'no' ) ) ) ) {
    73147314               return false;
    73157315       }