From 5052fb00681b9be7fd6dece51de7a5ba3dacf95d Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Thu, 21 Dec 2017 11:28:33 +0100 Subject: [PATCH] Add column validation --- main/inc/lib/message.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index aa235a9a74..13c89d4c5b 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -126,6 +126,10 @@ class MessageManager } } + if (!in_array($column, [0, 1, 2])) { + $column = 2; + } + $keyword = Session::read('message_search_keyword'); $keywordCondition = ''; if (!empty($keyword)) { @@ -993,6 +997,10 @@ class MessageManager $direction = 'ASC'; } } + + if (!in_array($column, [0, 1, 2])) { + $column = 2; + } $table = Database::get_main_table(TABLE_MESSAGE); $request = api_is_xml_http_request(); $keyword = Session::read('message_sent_search_keyword');