Code Duplication    Length = 5-7 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 2526-2530 (lines=5) @@
2523
2524
    $post_date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));
2525
2526
    if ($current_forum['approval_direct_post'] == '1' && !api_is_allowed_to_edit(null, true)) {
2527
        $visible = 0; // The post has not been approved yet.
2528
    } else {
2529
        $visible = 1;
2530
    }
2531
2532
    $clean_post_title = $values['post_title'];
2533
@@ 3318-3324 (lines=7) @@
3315
    $post_date = api_get_utc_datetime();
3316
    $userId = $userId ?: api_get_user_id();
3317
3318
    if ($current_forum['approval_direct_post'] == '1' &&
3319
        !api_is_allowed_to_edit(null, true)
3320
    ) {
3321
        $visible = 0;
3322
    } else {
3323
        $visible = 1;
3324
    }
3325
3326
    $upload_ok = 1;
3327
    $return = array();