diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 04c515197..05a3b0e90 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -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'); } diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php index 096a2f887..63a8369a1 100644 --- a/modules/comment/comment.item.php +++ b/modules/comment/comment.item.php @@ -241,6 +241,10 @@ class CommentItem extends BaseObject { $_SESSION['accessible'][$this->comment_srl] = $this->get('last_update'); } + if(is_array($_SESSION['accessible']) && count($_SESSION['accessible']) > 200) + { + $_SESSION['accessible'] = array_slice($_SESSION['accessible'], 100, null, true); + } } function isEditable() diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index e0fdd3008..f30f879c9 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -1719,6 +1719,12 @@ class DocumentController extends Document $_SESSION['readed_document'][$document_srl] = true; } + // Prevent session data getting too large + if (is_array($_SESSION['readed_document']) && count($_SESSION['readed_document']) > 1000) + { + $_SESSION['readed_document'] = array_slice($_SESSION['readed_document'], 500, null, true); + } + return TRUE; } @@ -2105,6 +2111,12 @@ class DocumentController extends Document $output->add('blamed_count', $trigger_obj->after_point); } + // Prevent session data getting too large + if (count($_SESSION['voted_document']) > 200) + { + $_SESSION['voted_document'] = array_slice($_SESSION['voted_document'], 100, null, true); + } + return $output; } @@ -2264,6 +2276,12 @@ class DocumentController extends Document // Leave in the session information $_SESSION['declared_document'][$document_srl] = true; + // Prevent session data getting too large + if (count($_SESSION['declared_document']) > 200) + { + $_SESSION['declared_document'] = array_slice($_SESSION['declared_document'], 100, null, true); + } + $this->setMessage('success_declared'); } diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 36fdf4c09..35b49ded3 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -285,6 +285,10 @@ class DocumentItem extends BaseObject { $_SESSION['accessible'][$this->document_srl] = $this->get('last_update'); } + if(is_array($_SESSION['accessible']) && count($_SESSION['accessible']) > 200) + { + $_SESSION['accessible'] = array_slice($_SESSION['accessible'], 100, null, true); + } } function allowComment() diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 915ddf64b..886f5fba2 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -772,6 +772,10 @@ class FileController extends File { $_SESSION['upload_info'] = array(); } + if(count($_SESSION['upload_info']) > 200) + { + $_SESSION['upload_info'] = array_slice($_SESSION['upload_info'], 100, null, true); + } if(!isset($_SESSION['upload_info'][$editor_sequence])) { $_SESSION['upload_info'][$editor_sequence] = new stdClass();