Code Duplication    Length = 10-11 lines in 4 locations

main/admin/user_import.php 1 location

@@ 232-242 (lines=11) @@
229
 * @param string $file Path to the CSV-file
230
 * @return array All userinformation read from the file
231
 */
232
function parse_csv_data($file)
233
{
234
    $users = Import :: csvToArray($file);
235
    foreach ($users as $index => $user) {
236
        if (isset ($user['Courses'])) {
237
            $user['Courses'] = explode('|', trim($user['Courses']));
238
        }
239
        $users[$index] = $user;
240
    }
241
    return $users;
242
}
243
/**
244
 * XML-parser: handle start of element
245
 * @param   string  $parser Deprecated?

main/admin/user_update_import.php 1 location

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

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

@@ 139-148 (lines=10) @@
136
 * @param string $file Path to the CSV-file
137
 * @return array All userinformation read from the file
138
 */
139
function parse_csv_data($file) {
140
	$users = Import :: csvToArray($file);
141
	foreach ($users as $index => $user) {
142
		if (isset ($user['Courses'])) {
143
			$user['Courses'] = explode('|', trim($user['Courses']));
144
		}
145
		$users[$index] = $user;
146
	}
147
	return $users;
148
}
149

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

@@ 2657-2666 (lines=10) @@
2654
     * @param string $file Path to the CSV-file
2655
     * @return array All userinformation read from the file
2656
     */
2657
    function parse_csv_data($file) {
2658
        $users = Import :: csvToArray($file);
2659
        foreach ($users as $index => $user) {
2660
            if (isset ($user['Courses'])) {
2661
                $user['Courses'] = explode('|', trim($user['Courses']));
2662
            }
2663
            $users[$index] = $user;
2664
        }
2665
        return $users;
2666
    }
2667
2668
    /**
2669
     * XML-parser: the handler at the beginning of element.