Code Duplication    Length = 5-7 lines in 2 locations

main/forum/forumfunction.inc.php 2 locations

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