Skip to content

Commit b72334e

Browse files
Coding Standards: Cast gmdate( 'Z' ) to an integer before addition.
This addresses two instances of the (numeric string) `gmdate( 'Z' )` being added to an `int` value. Affected functions: * `upgrade_110()` * `WP_Date_Query::validate_date_values()` Follow-up to [942], [29925], [45424]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59465 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9840f03 commit b72334e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wp-admin/includes/upgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ function upgrade_110() {
992992

993993
$time_difference = $all_options->time_difference;
994994

995-
$server_time = time() + gmdate( 'Z' );
995+
$server_time = time() + (int) gmdate( 'Z' );
996996
$weblogger_time = $server_time + $time_difference * HOUR_IN_SECONDS;
997997
$gmt_time = time();
998998

src/wp-includes/class-wp-date-query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public function validate_date_values( $date_query = array() ) {
317317
$_year = $date_query['year'];
318318
}
319319

320-
$max_days_of_year = gmdate( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1;
320+
$max_days_of_year = (int) gmdate( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1;
321321
} else {
322322
// Otherwise we use the max of 366 (leap-year).
323323
$max_days_of_year = 366;

0 commit comments

Comments
 (0)