Permalink
Browse files

Merge branch 'MDL-16730-m22' of git://github.com/ankitagarwal/moodle …

…into MOODLE_22_STABLE
  • Loading branch information...
2 parents 0fbadb5 + 4ad011d commit 75c6461ac17d3cf9287131cc369f0f30e1501499 Sam Hemelryk committed Jan 6, 2013
Showing with 6 additions and 1 deletion.
  1. +5 −1 admin/tool/uploaduser/index.php
  2. +1 −0 lang/en/error.php
@@ -285,7 +285,11 @@
$userserrors++;
continue;
}
-
+ if ($user->username !== clean_param($user->username, PARAM_USERNAME)) {
+ $upt->track('status', get_string('invalidusername', 'error', 'username'), 'error');
+ $upt->track('username', $errorstr, 'error');
+ $userserrors++;
+ }
if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
$upt->track('id', $existinguser->id, 'normal', false);
}
View
@@ -322,6 +322,7 @@
$string['invaliduser'] = 'Invalid user';
$string['invaliduserid'] = 'Invalid user id';
$string['invaliduserfield'] = 'Invalid user field: {$a}';
+$string['invalidusername'] = 'The given username contains invalid characters';
$string['invalidxmlfile'] = '"{$a}" is not a valid XML file';
$string['iplookupfailed'] = 'Cannot find geo information about this IP address {$a}';
$string['iplookupprivate'] = 'Cannot display lookup of private IP address';

0 comments on commit 75c6461

Please sign in to comment.