Date/Time: Use strict comparison in `is_new_day()`, add a unit test.

Props pbearne.
Fixes #46627.
Built from https://develop.svn.wordpress.org/trunk@45375


git-svn-id: http://core.svn.wordpress.org/trunk@45186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-05-22 17:53:52 +00:00
parent 03148046b5
commit 9785381a8c
2 changed files with 3 additions and 2 deletions

View File

@ -797,7 +797,8 @@ function wp_get_http_headers( $url, $deprecated = false ) {
*/ */
function is_new_day() { function is_new_day() {
global $currentday, $previousday; global $currentday, $previousday;
if ( $currentday != $previousday ) {
if ( $currentday !== $previousday ) {
return 1; return 1;
} else { } else {
return 0; return 0;

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-45371'; $wp_version = '5.3-alpha-45375';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.