From 7f86e4825bc4b2dea370fdceebf11b27237dabcc Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Fri, 22 Nov 2019 00:54:24 +0100
Subject: [PATCH] Load: $_SERVER['REQUEST_TIME'] should always be an integer

... and $_SERVER['REQUEST_TIME_FLOAT'] should always be a float.
---
 src/wp-includes/load.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index d8e80fb178..d831d79271 100644
--- a/src/wp-includes/load.php
+++ b/src/wp-includes/load.php
@@ -928,6 +928,18 @@ function wp_magic_quotes() {
 	$_COOKIE = add_magic_quotes( $_COOKIE );
 	$_SERVER = add_magic_quotes( $_SERVER );
 
+	/*
+	 * Revert the type change to string of two indexes which should retain their proper type.
+	 * Amongst other things, this preserves compatibility of WP with PHPUnit Code Coverage generation.
+	 */
+	if ( isset( $_SERVER['REQUEST_TIME'] ) ) {
+		$_SERVER['REQUEST_TIME'] = (int) $_SERVER['REQUEST_TIME'];
+	}
+
+	if ( isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ) {
+		$_SERVER['REQUEST_TIME_FLOAT'] = (float) $_SERVER['REQUEST_TIME_FLOAT'];
+	}
+
 	// Force REQUEST to be GET + POST.
 	$_REQUEST = array_merge( $_GET, $_POST );
 }
-- 
2.23.0.windows.1

