From 8b93fc92845d13e17795b9b3a52cdeb81e5340c5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 25 May 2014 05:07:40 -0400
Subject: [PATCH] Use POST for refresh/check-recent request
---
program/steps/mail/check_recent.inc | 8 +++++---
program/js/app.js | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/program/js/app.js b/program/js/app.js
index f0ad2ab..d56088d 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2151,7 +2151,7 @@
var lock = this.set_busy(true, 'checkingmail'),
params = this.check_recent_params();
- this.http_request('check-recent', params, lock);
+ this.http_post('check-recent', params, lock);
};
// list messages of a specific mailbox using filter
@@ -7330,7 +7330,7 @@
this.env.lastrefresh = new Date();
// plugins should bind to 'requestrefresh' event to add own params
- this.http_request('refresh', params, lock);
+ this.http_post('refresh', params, lock);
};
// returns check-recent request parameters
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index d2d27a2..5eb190e 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -21,7 +21,7 @@
// If there's no folder or messages list, there's nothing to update
// This can happen on 'refresh' request
-if (empty($_REQUEST['_folderlist']) && empty($_REQUEST['_list'])) {
+if (empty($_POST['_folderlist']) && empty($_POST['_list'])) {
return;
}
@@ -73,14 +73,16 @@
$_SESSION['search'] = $RCMAIL->storage->refresh_search();
}
- if (!empty($_GET['_quota']))
+ if (!empty($_POST['_quota'])) {
$OUTPUT->command('set_quota', $RCMAIL->quota_content());
+ }
$OUTPUT->set_env('exists', $RCMAIL->storage->count($mbox_name, 'EXISTS'));
// "No-list" mode, don't get messages
- if (empty($_GET['_list']))
+ if (empty($_POST['_list'])) {
continue;
+ }
// get overall message count; allow caching because rcube_storage::folder_status()
// did a refresh but only in list mode
--
Gitblit v1.9.1