Code Duplication    Length = 5-7 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 2400-2404 (lines=5) @@
2397
2398
        $post_date = api_get_utc_datetime();
2399
2400
        if ($current_forum['approval_direct_post'] == '1' && !api_is_allowed_to_edit(null, true)) {
2401
            $visible = 0; // The post has not been approved yet.
2402
        } else {
2403
            $visible = 1;
2404
        }
2405
2406
        $clean_post_title = $values['post_title'];
2407
@@ 3264-3270 (lines=7) @@
3261
    $table_posts = Database :: get_course_table(TABLE_FORUM_POST);
3262
    $post_date = api_get_utc_datetime();
3263
3264
    if ($current_forum['approval_direct_post'] == '1' &&
3265
        !api_is_allowed_to_edit(null, true)
3266
    ) {
3267
        $visible = 0;
3268
    } else {
3269
        $visible = 1;
3270
    }
3271
3272
    $upload_ok = 1;
3273