Make WordPress Core

Changeset 59465


Ignore:
Timestamp:
11/27/2024 11:38:10 AM (4 days ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r59166 r59465  
    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();
  • trunk/src/wp-includes/class-wp-date-query.php

    r57644 r59465  
    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).
Note: See TracChangeset for help on using the changeset viewer.