Skip to content

Commit

Permalink
Include modulars for last modification date computation (#3562)
Browse files Browse the repository at this point in the history
* Include modulars for last modification date computation

Fix #3561

* use ->modified()

---------

Co-authored-by: Andy Miller <[email protected]>
  • Loading branch information
drzraf and rhukster committed Jun 4, 2024
1 parent 24cd0e1 commit 20ca44f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 20ca44f

Please sign in to comment.