From 20ca44fd532cfac200d7e9e33d0e391e8d8307c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Tue, 4 Jun 2024 10:46:58 -0300 Subject: [PATCH] Include modulars for last modification date computation (#3562) * Include modulars for last modification date computation Fix #3561 * use ->modified() --------- Co-authored-by: Andy Miller <1084697+rhukster@users.noreply.github.com> --- system/src/Grav/Common/Page/Page.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 7ecd0fec4..f91647a08 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -613,7 +613,15 @@ public function httpHeaders() // Set Last-Modified header if ($this->lastModified()) { - $last_modified_date = gmdate('D, d M Y H:i:s', $this->modified()) . ' GMT'; + $last_modified = $this->modified(); + foreach ($this->children()->modular() as $cpage) { + $modular_mtime = $cpage->modified(); + if ($modular_mtime > $last_modified) { + $last_modified = $modular_mtime; + } + } + + $last_modified_date = gmdate('D, d M Y H:i:s', $last_modified) . ' GMT'; $headers['Last-Modified'] = $last_modified_date; }