Code Duplication    Length = 4-4 lines in 3 locations

main/inc/lib/blog.lib.php 2 locations

@@ 344-347 (lines=4) @@
341
        $has_attachment = false;
342
        $current_date = api_get_utc_datetime();
343
344
        if (!empty($_FILES['user_upload']['name'])) {
345
            $upload_ok = process_uploaded_file($_FILES['user_upload']);
346
            $has_attachment = true;
347
        }
348
349
        if ($upload_ok) {
350
            // Table Definitions
@@ 501-504 (lines=4) @@
498
        $current_date = api_get_utc_datetime();
499
        $course_id = api_get_course_int_id();
500
501
        if (!empty($_FILES['user_upload']['name'])) {
502
            $upload_ok = process_uploaded_file($_FILES['user_upload']);
503
            $has_attachment = true;
504
        }
505
506
        if ($upload_ok) {
507
            // Table Definition

main/forum/forumfunction.inc.php 1 location

@@ 2547-2550 (lines=4) @@
2544
    $upload_ok = 1;
2545
    $has_attachment = false;
2546
2547
    if (!empty($_FILES['user_upload']['name'])) {
2548
        $upload_ok = process_uploaded_file($_FILES['user_upload']);
2549
        $has_attachment = true;
2550
    }
2551
2552
    if (!$upload_ok) {
2553
        if ($showMessage) {