Changeset 31377
- Timestamp:
- 02/09/2015 02:32:31 AM (10 years ago)
- Location:
- branches/4.1
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1
-
branches/4.1/src/wp-includes/date.php
r30751 r31377 361 361 // Hours per day. 362 362 $min_max_checks['hour'] = array( 363 'min' => 1,363 'min' => 0, 364 364 'max' => 23 365 365 ); … … 385 385 $is_between = $date_query[ $key ] >= $check['min'] && $date_query[ $key ] <= $check['max']; 386 386 387 if ( ! $is_between ) {387 if ( ! is_numeric( $date_query[ $key ] ) || ! $is_between ) { 388 388 389 389 $error = sprintf( -
branches/4.1/tests/phpunit/tests/date/query.php
r30142 r31377 858 858 public function test_validate_date_values_hour() { 859 859 // Valid values. 860 $hours = range( 1, 23 );860 $hours = range( 0, 23 ); 861 861 foreach ( $hours as $hour ) { 862 862 $this->assertTrue( $this->q->validate_date_values( array( 'hour' => $hour ) ) ); … … 864 864 865 865 // Invalid values. 866 $hours = array( -1, 24, 25, 'string who wants to be a int' );866 $hours = array( -1, 24, 25, 'string' ); 867 867 foreach ( $hours as $hour ) { 868 868 $this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) );
Note: See TracChangeset
for help on using the changeset viewer.