Code Duplication    Length = 9-11 lines in 2 locations

main/work/downloadfolder.inc.php 1 location

@@ 197-207 (lines=11) @@
194
195
/*	Extra function (only used here) */
196
197
function my_pre_add_callback($p_event, &$p_header)
198
{
199
    global $files;
200
    if (isset($files[basename($p_header['stored_filename'])])) {
201
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])];
202
203
        return 1;
204
    }
205
206
    return 0;
207
}
208
209
/**
210
 * Return the difference between two arrays, as an array of those key/values

main/work/work.lib.php 1 location

@@ 5071-5079 (lines=9) @@
5068
 * @param array $p_header
5069
 * @return int
5070
 */
5071
function preAddAllWorkStudentCallback($p_event, &$p_header)
5072
{
5073
    $files = Session::read('files');
5074
    if (isset($files[basename($p_header['stored_filename'])])) {
5075
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5076
        return 1;
5077
    }
5078
    return 0;
5079
}
5080
5081
/**
5082
 * Get all work created by a user