Code Duplication    Length = 16-16 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 6437-6452 (lines=16) @@
6434
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6435
        $tbl_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
6436
6437
        if ($id != 0 && is_array($extra_info)) {
6438
            $item_title = $extra_info['title'];
6439
            $item_description = $extra_info['description'];
6440
        } elseif (is_numeric($extra_info)) {
6441
            $sql = "SELECT title, description
6442
                    FROM " . $tbl_quiz . "
6443
                    WHERE c_id = ".$course_id." AND id = " . $extra_info;
6444
6445
            $result = Database::query($sql);
6446
            $row = Database::fetch_array($result);
6447
            $item_title = $row['title'];
6448
            $item_description = $row['description'];
6449
        } else {
6450
            $item_title = '';
6451
            $item_description = '';
6452
        }
6453
        $item_title			= Security::remove_XSS($item_title);
6454
        $item_description 	= Security::remove_XSS($item_description);
6455
@@ 6854-6869 (lines=16) @@
6851
        $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
6852
        $tbl_forum = Database :: get_course_table(TABLE_FORUM);
6853
6854
        if ($id != 0 && is_array($extra_info)) {
6855
            $item_title = stripslashes($extra_info['title']);
6856
        } elseif (is_numeric($extra_info)) {
6857
            $sql = "SELECT forum_title as title, forum_comment as comment
6858
                    FROM " . $tbl_forum . "
6859
                    WHERE c_id = ".$course_id." AND forum_id = " . $extra_info;
6860
6861
            $result = Database::query($sql);
6862
            $row = Database :: fetch_array($result);
6863
6864
            $item_title = $row['title'];
6865
            $item_description = $row['comment'];
6866
        } else {
6867
            $item_title = '';
6868
            $item_description = '';
6869
        }
6870
6871
        $legend = '<legend>';
6872