Code Duplication    Length = 5-7 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 2518-2522 (lines=5) @@
2515
2516
    $post_date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));
2517
2518
    if ($current_forum['approval_direct_post'] == '1' && !api_is_allowed_to_edit(null, true)) {
2519
        $visible = 0; // The post has not been approved yet.
2520
    } else {
2521
        $visible = 1;
2522
    }
2523
2524
    $clean_post_title = $values['post_title'];
2525
@@ 3437-3443 (lines=7) @@
3434
    $post_date = api_get_utc_datetime();
3435
    $userId = $userId ?: api_get_user_id();
3436
3437
    if ($current_forum['approval_direct_post'] == '1' &&
3438
        !api_is_allowed_to_edit(null, true)
3439
    ) {
3440
        $visible = 0;
3441
    } else {
3442
        $visible = 1;
3443
    }
3444
3445
    $upload_ok = 1;
3446
    $return = array();