mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Send last-modified header with generatetd previews
This commit is contained in:
parent
837cae618b
commit
6bc2259139
3 changed files with 6 additions and 5 deletions
|
@ -1369,7 +1369,7 @@ class page_renderer
|
|||
"{admin-details-name}" => $settings->admindetails_name,
|
||||
"{admin-details-email}" => $settings->admindetails_email,
|
||||
|
||||
"{admins-name-list}" => implode(", ", $settings->admins),
|
||||
"{admins-name-list}" => implode(", ", array_map(function($username) { return page_renderer::render_username($username); }, $settings->admins)),
|
||||
|
||||
"{generation-date}" => date("l jS \of F Y \a\\t h:ia T"),
|
||||
|
||||
|
@ -2653,7 +2653,7 @@ register_module([
|
|||
$size_display_class .= " significant";
|
||||
$size_title_display = human_filesize($revisionData->newsize - $revisionData->sizediff) . " -> " . human_filesize($revisionData->newsize);
|
||||
|
||||
$content .= "<li><a href='?page=" . rawurlencode($env->page) . "&revision=$revisionData->rid'>#$revisionData->rid</a> " . render_editor($revisionData->editor) . " " . render_timestamp($revisionData->timestamp) . " <span class='cursor-query $size_display_class' title='$size_title_display'>($size_display)</span>";
|
||||
$content .= "<li><a href='?page=" . rawurlencode($env->page) . "&revision=$revisionData->rid'>#$revisionData->rid</a> " . render_editor(page_renderer::render_username($revisionData->editor)) . " " . render_timestamp($revisionData->timestamp) . " <span class='cursor-query $size_display_class' title='$size_title_display'>($size_display)</span>";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4064,7 +4064,7 @@ register_module([
|
|||
add_recent_change([
|
||||
"type" => "upload",
|
||||
"timestamp" => time(),
|
||||
"page" => $new_filename,
|
||||
"page" => $new_pagepath,
|
||||
"user" => $env->user,
|
||||
"filesize" => filesize($env->storage_prefix . $entry->uploadedfilepath)
|
||||
]);
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds the ability to keep unlimited page history, limited only by your disk space. Note that this doesn't store file history (yet). Currently depends on feature-recent-changes for rendering of the history page.",
|
||||
"id": "feature-history",
|
||||
"lastupdate": 1465757909,
|
||||
"lastupdate": 1497791855,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
@ -104,7 +104,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
|
||||
"id": "feature-upload",
|
||||
"lastupdate": 1497791495,
|
||||
"lastupdate": 1497791727,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -296,6 +296,7 @@ register_module([
|
|||
$shortFilename = substr($filepath, 1 + (strrpos($filepath, '/') !== false ? strrpos($filepath, '/') : -1));
|
||||
|
||||
header("content-disposition: inline; filename=\"$shortFilename\"");
|
||||
header("last-modified: " . gmdate('D, d M Y H:i:s T', $pageindex->{$env->page}->lastmodified));
|
||||
|
||||
// If the size is set or original, then send (or redirect to) the original image
|
||||
// Also do the same for SVGs if svg rendering is disabled.
|
||||
|
|
Loading…
Reference in a new issue