Code Duplication    Length = 3-3 lines in 2 locations

main/announcements/announcements.php 1 location

@@ 109-111 (lines=3) @@
106
        }
107
108
        if (!empty($sortDirection)) {
109
            if (!in_array(trim(strtoupper($sortDirection)), array('ASC', 'DESC'))) {
110
                $sortDirection = 'ASC';
111
            }
112
113
            $announcementInfo = AnnouncementManager::get_by_id($course_id, $thisAnnouncementId);
114

main/inc/lib/link.lib.php 1 location

@@ 1207-1209 (lines=3) @@
1204
        $movetable = $tbl_categories;
1205
1206
        if (!empty($sortDirection)) {
1207
            if (!in_array(trim(strtoupper($sortDirection)), array('ASC', 'DESC'))) {
1208
                $sortDirection = 'ASC';
1209
            }
1210
1211
            $sql = "SELECT id, display_order FROM $movetable
1212
                    WHERE c_id = $courseId