mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix excessive session data after accessing and voting on many documents and comments
This commit is contained in:
parent
8f20339549
commit
6a93e0c12d
5 changed files with 42 additions and 0 deletions
|
|
@ -1716,6 +1716,12 @@ class CommentController extends Comment
|
|||
$output->add('blamed_count', $trigger_obj->after_point);
|
||||
}
|
||||
|
||||
// Prevent session data getting too large
|
||||
if (count($_SESSION['voted_comment']) > 200)
|
||||
{
|
||||
$_SESSION['voted_comment'] = array_slice($_SESSION['voted_comment'], 100, null, true);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -1875,6 +1881,12 @@ class CommentController extends Comment
|
|||
// leave into the session information
|
||||
$_SESSION['declared_comment'][$comment_srl] = TRUE;
|
||||
|
||||
// Prevent session data getting too large
|
||||
if (count($_SESSION['declared_comment']) > 200)
|
||||
{
|
||||
$_SESSION['declared_comment'] = array_slice($_SESSION['declared_comment'], 100, null, true);
|
||||
}
|
||||
|
||||
$this->setMessage('success_declared');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue