PITS /
01564: TypeError: gmdate() in scripts/caches.php:38
Summary: TypeError: gmdate() in scripts/caches.php:38
Created: 2026-08-05 18:13
Status: Closed, fixed for 2.7.5
Category: Bug
From: Jonathan Blake
Assigned:
Priority: 3
Version: 2.6.0
OS: Ubuntu 22.04.5 LTS / Apache 2.4.52-1ubuntu4.23 / PHP 8.2.30
Description: My PHP log recently filled up with a lot of errors like this :
[03-Aug-2026 03:56:06 America/Los_Angeles] PHP Fatal error: Uncaught TypeError: gmdate(): Argument #2 ($timestamp) must be of type ?int, string given in /home/[...]/pmwiki-farm/scripts/caches.php:38 Stack trace: #0 /home/[...]/pmwiki-farm/scripts/caches.php(38): gmdate('D, d M Y H:i:s ...', '1785281136))EXT...') [...]
Might be malicious based on the extra text passed in via cookie.
As a temporary fix, I wrapped the $IMSTime variable in intval which seems to work so far.
$HTTPLastMod = gmdate('D, d M Y H:i:s \G\M\T', intval($IMSTime));
Thanks, should be fixed in 2.7.5, available in the pre-release from Subversion or ChangeLog. --Petko