Changeset 31251
- Timestamp:
- 01/20/2015 07:12:48 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/date.php
r31217 r31251 369 369 // Hours per day. 370 370 $min_max_checks['hour'] = array( 371 'min' => 1,371 'min' => 0, 372 372 'max' => 23 373 373 ); … … 395 395 $is_between = $_value >= $check['min'] && $_value <= $check['max']; 396 396 397 if ( ! $is_between ) {397 if ( ! is_numeric( $_value ) || ! $is_between ) { 398 398 $error = sprintf( 399 399 /* translators: Date query invalid date message: 1: invalid value, 2: type of value, 3: minimum valid value, 4: maximum valid value */ -
trunk/tests/phpunit/tests/date/query.php
r31179 r31251 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.