Changeset:
9e1f7e31c5f5
https://sourceforge.net/p/mrbs/hg-code/ci/9e1f7e31c5f5851da520ef90b7b3411c22d65da7
Author:
Campbell Morrison <[email protected]>
Date:
Wed Mar 01 16:12:00 2017 +0000
Log message:
Added headers to disable caching when sending application data, eg JSON or
iCalendar. Although the PHP session scheme will normally add these headers
when $auth['session'] is set to 'php', this won't happen in some other session
schemes, eg 'cookie'. So MRBS explicitly adds the headers itself just to make
sure.
diffstat:
web/check_slot_ajax.php | 1 +
web/edit_users.php | 1 +
web/report.php | 3 +++
web/search.php | 1 +
web/view_entry.php | 1 +
5 files changed, 7 insertions(+), 0 deletions(-)
diffs (70 lines):
diff -r 9a30929fe771 -r 9e1f7e31c5f5 web/check_slot_ajax.php
--- a/web/check_slot_ajax.php Wed Mar 01 15:13:07 2017 +0000
+++ b/web/check_slot_ajax.php Wed Mar 01 16:12:00 2017 +0000
@@ -36,5 +36,6 @@
}
header("Content-Type: application/json");
+expires_header(0); // no caching
echo json_encode($result);
diff -r 9a30929fe771 -r 9e1f7e31c5f5 web/edit_users.php
--- a/web/edit_users.php Wed Mar 01 15:13:07 2017 +0000
+++ b/web/edit_users.php Wed Mar 01 16:12:00 2017 +0000
@@ -904,6 +904,7 @@
if ($ajax)
{
header("Content-Type: application/json");
+ expires_header(0); // no caching
echo json_encode($json_data);
}
else
diff -r 9a30929fe771 -r 9e1f7e31c5f5 web/report.php
--- a/web/report.php Wed Mar 01 15:13:07 2017 +0000
+++ b/web/report.php Wed Mar 01 16:12:00 2017 +0000
@@ -579,6 +579,7 @@
if ($ajax)
{
header("Content-Type: application/json");
+ expires_header(0); // no caching
echo json_encode($json_data);
}
elseif ($output_format == OUTPUT_HTML)
@@ -1545,6 +1546,7 @@
{
header("Content-Type: $content_type");
header("Content-Disposition: attachment; filename=\"$filename\"");
+ expires_header(0); // no caching
}
if (($output_format == OUTPUT_CSV) && $csv_bom)
@@ -1604,6 +1606,7 @@
if ($ajax)
{
header("Content-Type: application/json");
+ expires_header(0); // no caching
echo json_encode($json_data);
}
else
diff -r 9a30929fe771 -r 9e1f7e31c5f5 web/search.php
--- a/web/search.php Wed Mar 01 15:13:07 2017 +0000
+++ b/web/search.php Wed Mar 01 16:12:00 2017 +0000
@@ -359,6 +359,7 @@
if ($ajax)
{
header("Content-Type: application/json");
+ expires_header(0); // no caching
echo json_encode($json_data);
}
else
diff -r 9a30929fe771 -r 9e1f7e31c5f5 web/view_entry.php
--- a/web/view_entry.php Wed Mar 01 15:13:07 2017 +0000
+++ b/web/view_entry.php Wed Mar 01 16:12:00 2017 +0000
@@ -236,6 +236,7 @@
require_once "functions_ical.inc";
header("Content-Type: application/ics; charset=" . get_charset(). ";
name=\"" . $mail_settings['ics_filename'] . ".ics\"");
header("Content-Disposition: attachment; filename=\"" .
$mail_settings['ics_filename'] . ".ics\"");
+ expires_header(0); // no caching
export_icalendar($res, $keep_private);
exit;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits