Code Duplication    Length = 16-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 6468-6483 (lines=16) @@
6465
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6466
        $tbl_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
6467
6468
        if ($id != 0 && is_array($extra_info)) {
6469
            $item_title = $extra_info['title'];
6470
            $item_description = $extra_info['description'];
6471
        } elseif (is_numeric($extra_info)) {
6472
            $sql = "SELECT title, description
6473
                    FROM " . $tbl_quiz . "
6474
                    WHERE c_id = ".$course_id." AND id = " . $extra_info;
6475
6476
            $result = Database::query($sql);
6477
            $row = Database::fetch_array($result);
6478
            $item_title = $row['title'];
6479
            $item_description = $row['description'];
6480
        } else {
6481
            $item_title = '';
6482
            $item_description = '';
6483
        }
6484
        $item_title			= Security::remove_XSS($item_title);
6485
        $item_description 	= Security::remove_XSS($item_description);
6486
@@ 6885-6900 (lines=16) @@
6882
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6883
        $tbl_forum = Database :: get_course_table(TABLE_FORUM);
6884
6885
        if ($id != 0 && is_array($extra_info)) {
6886
            $item_title = stripslashes($extra_info['title']);
6887
        } elseif (is_numeric($extra_info)) {
6888
            $sql = "SELECT forum_title as title, forum_comment as comment
6889
                    FROM " . $tbl_forum . "
6890
                    WHERE c_id = ".$course_id." AND forum_id = " . $extra_info;
6891
6892
            $result = Database::query($sql);
6893
            $row = Database :: fetch_array($result);
6894
6895
            $item_title = $row['title'];
6896
            $item_description = $row['comment'];
6897
        } else {
6898
            $item_title = '';
6899
            $item_description = '';
6900
        }
6901
6902
        $legend = '<legend>';
6903