Author: Matt Stauffer (mattstauffer)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2026-10-24T13:30:55+08:00
Commit: Fix calendar (#2043) · php/web-php@e10aeab · GitHub
Raw diff: https://github.com/php/web-php/commit/e10aeab1cfb023d26467abedc34fd3ce6a1e800f.diff
Fix calendar (#2043)
Changed paths:
M phpstan-baseline.neon
M public/cal.php
Diff:
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 1be2fec354..4cccfe305e 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1482,12 +1482,6 @@ parameters:
count: 1
path: public/cached.php
- -
- message: '#^Constant cal not found\.$#'
- identifier: constant.notFound
- count: 1
- path: public/cal.php
-
-
message: '#^Function date_for_recur\(\) has no return type specified\.$#'
identifier: missingType.return
@@ -1560,12 +1554,6 @@ parameters:
count: 1
path: public/cal.php
- -
- message: '#^Function phpdate not found\.$#'
- identifier: function.notFound
- count: 1
- path: public/cal.php
-
-
message: '#^Function read_event\(\) has no return type specified\.$#'
identifier: missingType.return
@@ -1599,7 +1587,7 @@ parameters:
-
message: '#^Parameter \#2 \$timestamp of function date expects int\|null, int\|false given\.$#'
identifier: argument.type
- count: 14
+ count: 15
path: public/cal.php
-
diff --git a/public/cal.php b/public/cal.php
index 5bb64b2918..4c1624ded0 100644
--- a/public/cal.php
+++ b/public/cal.php
@@ -189,7 +189,7 @@
// Print out day number and all events for the day
echo '<td><a class="day" href="/cal.php', "?cm=$cm&cd=$i&cy=$cy",
'">',$i,'</a>';
- display_events_for_day(cal . phpdate("Y-m-", $bom) . sprintf("%02d", $i), $events);
+ display_events_for_day(date("Y-m-", $bom) . sprintf("%02d", $i), $events);
echo '</td>';
// Break HTML table row if at end of week