From: <be...@us...> - 2014-07-13 00:34:43
|
Revision: 12708 http://sourceforge.net/p/xoops/svn/12708 Author: beckmi Date: 2014-07-13 00:34:40 +0000 (Sun, 13 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.8/docs/changelog.250.txt XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/pm/viewpmsg.php XoopsCore/branches/2.5.x/2.5.8/htdocs/viewpmsg.php Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2014-07-13 00:23:40 UTC (rev 12707) +++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2014-07-13 00:34:40 UTC (rev 12708) @@ -5,6 +5,7 @@ =============================== - replaced "dirname(__FILE__)" with "__DIR__" since the min. PHP is now 5.3.7, and __DIR__ is faster (mamba) - updating some copyright notices +- Fix issues when protector 'id_forceintval' preference is enabled, that manifests as an error when deleting private messages. (rgriffith) - fix for Update setting Template import date to 0 (timgno/mamba) =============================== Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/pm/viewpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/pm/viewpmsg.php 2014-07-13 00:23:40 UTC (rev 12707) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/pm/viewpmsg.php 2014-07-13 00:34:40 UTC (rev 12708) @@ -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.8/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/viewpmsg.php 2014-07-13 00:23:40 UTC (rev 12707) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/viewpmsg.php 2014-07-13 00:34:40 UTC (rev 12708) @@ -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); } |