|
From: <rgr...@us...> - 2014-07-08 23:09:20
|
Revision: 12688
http://sourceforge.net/p/xoops/svn/12688
Author: rgriffith
Date: 2014-07-08 23:09:11 +0000 (Tue, 08 Jul 2014)
Log Message:
-----------
Fix issues when protector 'id_forceintval' preference is enabled, that manifests as an error when deleting private messages.
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-07-08 19:32:05 UTC (rev 12687)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/viewpmsg.php 2014-07-08 23:09:11 UTC (rev 12688)
@@ -34,17 +34,17 @@
$start = empty($_REQUEST["start"]) ? 0 : intval($_REQUEST["start"]);
$pm_handler =& xoops_getModuleHandler('message');
-if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) {
+if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) {
if (!$GLOBALS['xoopsSecurity']->check()) {
$GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
} else if (empty($_REQUEST['ok'])) {
- xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
+ xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
include $GLOBALS['xoops']->path('footer.php');
exit();
} else {
- $clean_msg_id = json_decode($_POST['msg_id'], true, 2);
+ $clean_msg_id = json_decode($_POST['msg_ids'], true, 2);
if (!empty($clean_msg_id)) {
- $clean_msg_id = array_map("intval", (array) $clean_msg_id);
+ $clean_msg_id = array_map("intval", $clean_msg_id);
}
$size = count($clean_msg_id);
$msg =& $clean_msg_id;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php 2014-07-08 19:32:05 UTC (rev 12687)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/viewpmsg.php 2014-07-08 23:09:11 UTC (rev 12688)
@@ -27,17 +27,17 @@
redirect_header("user.php", 2, $errormessage);
} else {
$pm_handler =& xoops_gethandler('privmessage');
- if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) {
+ if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) {
if (!$GLOBALS['xoopsSecurity']->check()) {
echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors());
exit();
} elseif (empty($_REQUEST['ok'])) {
include $GLOBALS['xoops']->path('header.php');
- xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
+ xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE);
include $GLOBALS['xoops']->path('footer.php');
exit();
}
- $clean_msg_id = json_decode($_POST['msg_id'], true, 2);
+ $clean_msg_id = json_decode($_POST['msg_ids'], true, 2);
if (!empty($clean_msg_id)) {
$clean_msg_id = array_map("intval", $clean_msg_id);
}
|