Author: Tim Düsterhus (TimWolla)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2026-11-18T22:54:49+01:00
Commit: Keep generated news entry publishing date in sync with filename date … · php/web-php@4f24a21 · GitHub
Raw diff: https://github.com/php/web-php/commit/4f24a2123cdc68d45122ab0ff6b5910b86852a3c.diff
Keep generated news entry publishing date in sync with filename date (#2084)
Changed paths:
M src/News/Entry.php
Diff:
diff --git a/src/News/Entry.php b/src/News/Entry.php
index a08052c168..062aeb4c3d 100755
--- a/src/News/Entry.php
+++ b/src/News/Entry.php
@@ -122,8 +122,8 @@ public function save(): self {
self::ce($dom, "title", $this->title, [], $item);
self::ce($dom, "id", $archive, [], $item);
- self::ce($dom, "published", date(DATE_ATOM), [], $item);
- self::ce($dom, "updated", date(DATE_ATOM), [], $item);
+ self::ce($dom, "published", date(DATE_ATOM, $_SERVER['REQUEST_TIME']), [], $item);
+ self::ce($dom, "updated", date(DATE_ATOM, $_SERVER['REQUEST_TIME']), [], $item);
self::ce($dom, "link", null, ['href' => "{$href}#{$this->id}", "rel" => "alternate", "type" => "text/html"], $item);
self::ce($dom, "link", null, ['href' => $link, 'rel' => 'via', 'type' => 'text/html'], $item);