Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 2827-2832 (lines=6) @@
2824
        if (!empty ($post_id) && is_numeric($post_id)) {
2825
            $where .= " AND post_id = $post_id ";
2826
        }
2827
        if (!empty ($comment_id) && is_numeric($comment_id)) {
2828
            if (!empty ($post_id)) {
2829
                $where .= ' AND ';
2830
            }
2831
            $where .= " comment_id = $comment_id ";
2832
        }
2833
        $course_id = api_get_course_int_id();
2834
        $sql = "SELECT path, filename, comment FROM $blog_table_attachment
2835
	        WHERE c_id = $course_id AND blog_id = $blog_id  $where";
@@ 2871-2876 (lines=6) @@
2868
            $where .= ' AND post_id ="'.$post_id.'" ';
2869
        }
2870
    
2871
        if (!empty ($comment_id) && is_numeric($comment_id)) {
2872
            if (!empty ($post_id)) {
2873
                $where .= ' AND ';
2874
            }
2875
            $where .= ' comment_id ="'.$comment_id.'" ';
2876
        }
2877
    
2878
        // delete all files in directory
2879
        $courseDir = $_course['path'].'/upload/blog';