catchupSelected: pass ids in POST to prevent url size limit problems

This commit is contained in:
Andrew Dolgov 2009-04-25 12:15:26 +04:00
parent 32d2181b92
commit 2855ee88bd
2 changed files with 22 additions and 10 deletions

View File

@ -193,8 +193,8 @@
/* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */ /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */
if ($subop == "catchupSelected") { if ($subop == "catchupSelected") {
$ids = split(",", db_escape_string($_GET["ids"])); $ids = split(",", db_escape_string($_REQUEST["ids"]));
$cmode = sprintf("%d", $_GET["cmode"]); $cmode = sprintf("%d", $_REQUEST["cmode"]);
catchupArticlesById($link, $ids, $cmode); catchupArticlesById($link, $ids, $cmode);

View File

@ -896,12 +896,15 @@ function toggleUnread(id, cmode, effect) {
if (cmode == undefined) cmode = 2; if (cmode == undefined) cmode = 2;
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + var query = "backend.php?op=rpc&subop=catchupSelected" +
param_escape(id) + "&cmode=" + param_escape(cmode); "&cmode=" + param_escape(cmode);
var ids = "?ids=" + param_escape(id);
// notify_progress("Loading, please wait..."); // notify_progress("Loading, please wait...");
new Ajax.Request(query, { new Ajax.Request(query, {
parameters: ids,
onComplete: function(transport) { onComplete: function(transport) {
all_counters_callback2(transport); all_counters_callback2(transport);
} }); } });
@ -1049,12 +1052,15 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
cmode = "0"; cmode = "0";
} }
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + var query = "backend.php?op=rpc&subop=catchupSelected" +
param_escape(rows.toString()) + "&cmode=" + cmode; "&cmode=" + cmode;
var ids = "?ids=" + param_escape(rows.toString());
notify_progress("Loading, please wait..."); notify_progress("Loading, please wait...");
new Ajax.Request(query, { new Ajax.Request(query, {
parameters: ids,
onComplete: function(transport) { onComplete: function(transport) {
catchup_callback2(transport, callback_func); catchup_callback2(transport, callback_func);
} }); } });
@ -1548,10 +1554,13 @@ function cdmWatchdog() {
} }
} }
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + var query = "backend.php?op=rpc&subop=catchupSelected" +
param_escape(ids.toString()) + "&cmode=0"; "&cmode=0";
var ids = "?ids=" + param_escape(ids.toString());
new Ajax.Request(query, { new Ajax.Request(query, {
parameters: ids,
onComplete: function(transport) { onComplete: function(transport) {
all_counters_callback2(transport); all_counters_callback2(transport);
} }); } });
@ -1929,10 +1938,13 @@ function catchupRelativeToArticle(below) {
e.className = e.className.replace("Unread", ""); e.className = e.className.replace("Unread", "");
} }
var query = "backend.php?op=rpc&subop=catchupSelected&ids=" + var query = "backend.php?op=rpc&subop=catchupSelected" +
param_escape(ids_to_mark.toString()) + "&cmode=0"; "&cmode=0";
var ids = "?ids=" + param_escape(ids_to_mark.toString());
new Ajax.Request(query, { new Ajax.Request(query, {
parameters: ids,
onComplete: function(transport) { onComplete: function(transport) {
catchup_callback2(transport); catchup_callback2(transport);
} }); } });