Code Duplication    Length = 5-5 lines in 3 locations

main/work/downloadfolder.inc.php 1 location

@@ 198-202 (lines=5) @@
195
    //start download of created file
196
    $name = $fileName .'.zip';
197
198
    if (Security::check_abs_path($temp_zip_file, api_get_path(SYS_ARCHIVE_PATH))) {
199
        DocumentManager::file_send_for_download($temp_zip_file, true, $name);
200
        @unlink($temp_zip_file);
201
        exit;
202
    }
203
} else {
204
    exit;
205
}

main/inc/lib/document.lib.php 1 location

@@ 6311-6315 (lines=5) @@
6308
            );
6309
        }
6310
6311
        if (Security::check_abs_path($tempZipFile, api_get_path(SYS_ARCHIVE_PATH))) {
6312
            DocumentManager::file_send_for_download($tempZipFile, true);
6313
            @unlink($tempZipFile);
6314
            exit;
6315
        }
6316
    }
6317
6318
    /**

main/work/work.lib.php 1 location

@@ 5022-5026 (lines=5) @@
5019
        // Start download of created file
5020
        $name = basename(api_replace_dangerous_char($userInfo['complete_name'])).'.zip';
5021
        Event::event_download($name.'.zip (folder)');
5022
        if (Security::check_abs_path($tempZipFile, api_get_path(SYS_ARCHIVE_PATH))) {
5023
            DocumentManager::file_send_for_download($tempZipFile, true, $name);
5024
            @unlink($tempZipFile);
5025
            exit;
5026
        }
5027
    }
5028
    exit;
5029
}