--- loncom/interface/lonpreferences.pm 2006/10/23 21:22:51 1.94 +++ loncom/interface/lonpreferences.pm 2006/12/06 22:22:37 1.95 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.94 2006/10/23 21:22:51 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.95 2006/12/06 22:22:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,6 +42,7 @@ use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; use Apache::lonnet; +use LONCAPA(); # # Write lonnet::passwd to do the call below. @@ -553,8 +554,8 @@ sub verify_and_change_msgforward { my $message=''; foreach (split(/\,/,$env{'form.msgforward'})) { my ($msuser,$msdomain)=split(/[\@\:]/,$_); - $msuser=~s/\W//g; - $msdomain=~s/\W//g; + $msuser = &LONCAPA::clean_username($msuser); + $msdomain = &LONCAPA::clean_domain($msdomain); if (($msuser) && ($msdomain)) { if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { $newscreen.=$msuser.':'.$msdomain.',';