Code Duplication    Length = 10-11 lines in 3 locations

main/admin/user_update_import.php 1 location

@@ 241-251 (lines=11) @@
238
 * @param string $file Path to the CSV-file
239
 * @return array All userinformation read from the file
240
 */
241
function parse_csv_data($file)
242
{
243
    $users = Import :: csvToArray($file);
244
    foreach ($users as $index => $user) {
245
        if (isset ($user['Courses'])) {
246
            $user['Courses'] = explode('|', trim($user['Courses']));
247
        }
248
        $users[$index] = $user;
249
    }
250
    return $users;
251
}
252
/**
253
 * XML-parser: handle start of element
254
 * @param   string  $parser Deprecated?

main/webservices/user_import/import.lib.php 1 location

@@ 148-157 (lines=10) @@
145
 * @param string $file Path to the CSV-file
146
 * @return array All user information read from the file
147
 */
148
function parse_csv_data($file)
149
{
150
    $users = Import :: csvToArray($file);
151
    foreach ($users as $index => $user) {
152
        if (isset($user['Courses'])) {
153
            $user['Courses'] = explode('|', trim($user['Courses']));
154
        }
155
        $users[$index] = $user;
156
    }
157
158
    return $users;
159
}
160

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

@@ 2445-2454 (lines=10) @@
2442
     * @param string $file Path to the CSV-file
2443
     * @return array All userinformation read from the file
2444
     */
2445
    function parse_csv_data($file)
2446
    {
2447
        $users = Import::csvToArray($file);
2448
        foreach ($users as $index => $user) {
2449
            if (isset ($user['Courses'])) {
2450
                $user['Courses'] = explode('|', trim($user['Courses']));
2451
            }
2452
            $users[$index] = $user;
2453
        }
2454
        return $users;
2455
    }
2456
2457
    /**