Code Duplication    Length = 16-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 6445-6460 (lines=16) @@
6442
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6443
        $tbl_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
6444
6445
        if ($id != 0 && is_array($extra_info)) {
6446
            $item_title = $extra_info['title'];
6447
            $item_description = $extra_info['description'];
6448
        } elseif (is_numeric($extra_info)) {
6449
            $sql = "SELECT title, description
6450
                    FROM " . $tbl_quiz . "
6451
                    WHERE c_id = ".$course_id." AND id = " . $extra_info;
6452
6453
            $result = Database::query($sql);
6454
            $row = Database::fetch_array($result);
6455
            $item_title = $row['title'];
6456
            $item_description = $row['description'];
6457
        } else {
6458
            $item_title = '';
6459
            $item_description = '';
6460
        }
6461
        $item_title			= Security::remove_XSS($item_title);
6462
        $item_description 	= Security::remove_XSS($item_description);
6463
@@ 6862-6877 (lines=16) @@
6859
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6860
        $tbl_forum = Database :: get_course_table(TABLE_FORUM);
6861
6862
        if ($id != 0 && is_array($extra_info)) {
6863
            $item_title = stripslashes($extra_info['title']);
6864
        } elseif (is_numeric($extra_info)) {
6865
            $sql = "SELECT forum_title as title, forum_comment as comment
6866
                    FROM " . $tbl_forum . "
6867
                    WHERE c_id = ".$course_id." AND forum_id = " . $extra_info;
6868
6869
            $result = Database::query($sql);
6870
            $row = Database :: fetch_array($result);
6871
6872
            $item_title = $row['title'];
6873
            $item_description = $row['comment'];
6874
        } else {
6875
            $item_title = '';
6876
            $item_description = '';
6877
        }
6878
6879
        $legend = '<legend>';
6880