--- loncom/publisher/lonupload.pm 2006/07/05 22:23:09 1.33 +++ loncom/publisher/lonupload.pm 2006/12/06 22:22:39 1.34 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.33 2006/07/05 22:23:09 albertel Exp $ +# $Id: lonupload.pm,v 1.34 2006/12/06 22:22:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,7 @@ use Apache::lonnet; use HTML::Entities(); use Apache::lonlocal; use Apache::lonnet; +use LONCAPA(); my $DEBUG=0; @@ -289,7 +290,7 @@ function verifyForm() { $fn=$env{'form.filename'}; $fn=~s/^http\:\/\/[^\/]+\///; $fn=~s/^\///; - $fn=~s/(\~|priv\/)(\w+)//; + $fn=~s{(~|priv/)($LONCAPA::username_re)}{}; $fn=~s/\/+/\//g; } else { $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.