Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 141-148 (lines=8) @@
138
        $number_of_items = intval($number_of_items);
139
140
        //forcing this order
141
        if (!isset($direction)) {
142
            $column = 3;
143
            $direction = 'DESC';
144
        } else {
145
            $column = intval($column);
146
            if (!in_array($direction, array('ASC', 'DESC')))
147
                $direction = 'ASC';
148
        }
149
150
        $keyword = Session::read('message_search_keyword');
151
        $keywordCondition = '';
@@ 889-896 (lines=8) @@
886
    {
887
        $from = intval($from);
888
        $number_of_items = intval($number_of_items);
889
        if (!isset($direction)) {
890
            $column = 3;
891
            $direction = 'DESC';
892
        } else {
893
            $column = intval($column);
894
            if (!in_array($direction, array('ASC', 'DESC')))
895
                $direction = 'ASC';
896
        }
897
        $table_message = Database::get_main_table(TABLE_MESSAGE);
898
        $request = api_is_xml_http_request();
899