Code Duplication    Length = 4-4 lines in 3 locations

main/forum/forumfunction.inc.php 1 location

@@ 2385-2388 (lines=4) @@
2382
    $upload_ok = 1;
2383
    $has_attachment = false;
2384
2385
    if (!empty($_FILES['user_upload']['name'])) {
2386
        $upload_ok = process_uploaded_file($_FILES['user_upload']);
2387
        $has_attachment = true;
2388
    }
2389
2390
    if ($upload_ok) {
2391

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

@@ 339-342 (lines=4) @@
336
        $has_attachment = false;
337
        $current_date = api_get_utc_datetime();
338
339
        if (!empty($_FILES['user_upload']['name'])) {
340
            $upload_ok = process_uploaded_file($_FILES['user_upload']);
341
            $has_attachment = true;
342
        }
343
344
		if ($upload_ok) {
345
			// Table Definitions
@@ 494-497 (lines=4) @@
491
        $current_date = api_get_utc_datetime();
492
        $course_id = api_get_course_int_id();
493
494
        if (!empty($_FILES['user_upload']['name'])) {
495
            $upload_ok = process_uploaded_file($_FILES['user_upload']);
496
            $has_attachment = true;
497
        }
498
499
		if ($upload_ok) {
500
			// Table Definition