/// If data submitted, then process and store.
if ($usernew = data_submitted()) {
+
+ foreach ($usernew as $key => $data) {
+ $usernew->$key = clean_text($usernew->$key, FORMAT_MOODLE);
+ }
+
$usernew->firstname = strip_tags($usernew->firstname);
$usernew->lastname = strip_tags($usernew->lastname);
+
if (isset($usernew->username)) {
$usernew->username = trim(moodle_strtolower($usernew->username));
}