Make WordPress Core


Ignore:
Timestamp:
02/09/2015 02:32:31 AM (10 years ago)
Author:
dd32
Message:

WP_Date_Query date validation should not fail for hour = 0.

Props ChriCo, tyxla.
Merges [31251] to the 4.1 branch.
Fixes #31067.

Location:
branches/4.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1

  • branches/4.1/tests/phpunit/tests/date/query.php

    r30142 r31377  
    858858    public function test_validate_date_values_hour() {
    859859        // Valid values.
    860         $hours = range( 1, 23 );
     860        $hours = range( 0, 23 );
    861861        foreach ( $hours as $hour ) {
    862862            $this->assertTrue( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
     
    864864
    865865        // Invalid values.
    866         $hours = array( -1, 24, 25, 'string who wants to be a int' );
     866        $hours = array( -1, 24, 25, 'string' );
    867867        foreach ( $hours as $hour ) {
    868868            $this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
Note: See TracChangeset for help on using the changeset viewer.