Code Duplication    Length = 4-4 lines in 3 locations

main/forum/forumfunction.inc.php 1 location

@@ 2509-2512 (lines=4) @@
2506
    $upload_ok = 1;
2507
    $has_attachment = false;
2508
2509
    if (!empty($_FILES['user_upload']['name'])) {
2510
        $upload_ok = process_uploaded_file($_FILES['user_upload']);
2511
        $has_attachment = true;
2512
    }
2513
2514
    if (!$upload_ok) {
2515
        if ($showMessage) {

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