Code Duplication    Length = 5-7 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

@@ 2506-2510 (lines=5) @@
2503
2504
    $post_date = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC'));
2505
2506
        if ($current_forum['approval_direct_post'] == '1' && !api_is_allowed_to_edit(null, true)) {
2507
            $visible = 0; // The post has not been approved yet.
2508
        } else {
2509
            $visible = 1;
2510
        }
2511
2512
        $clean_post_title = $values['post_title'];
2513
@@ 3429-3435 (lines=7) @@
3426
    $post_date = api_get_utc_datetime();
3427
    $userId = $userId ?: api_get_user_id();
3428
3429
    if ($current_forum['approval_direct_post'] == '1' &&
3430
        !api_is_allowed_to_edit(null, true)
3431
    ) {
3432
        $visible = 0;
3433
    } else {
3434
        $visible = 1;
3435
    }
3436
3437
    $upload_ok = 1;
3438
    $return = array();