Code Duplication    Length = 8-8 lines in 2 locations

main/inc/lib/message.lib.php 2 locations

@@ 124-131 (lines=8) @@
121
        $number_of_items = intval($number_of_items);
122
123
        //forcing this order
124
        if (!isset($direction)) {
125
            $column = 3;
126
            $direction = 'DESC';
127
        } else {
128
            $column = intval($column);
129
            if (!in_array($direction, array('ASC', 'DESC'))) {
130
                $direction = 'ASC';
131
            }
132
        }
133
134
        $keyword = Session::read('message_search_keyword');
@@ 887-894 (lines=8) @@
884
    {
885
        $from = intval($from);
886
        $number_of_items = intval($number_of_items);
887
        if (!isset($direction)) {
888
            $column = 3;
889
            $direction = 'DESC';
890
        } else {
891
            $column = intval($column);
892
            if (!in_array($direction, array('ASC', 'DESC')))
893
                $direction = 'ASC';
894
        }
895
        $table_message = Database::get_main_table(TABLE_MESSAGE);
896
        $request = api_is_xml_http_request();
897