--- loncom/interface/londocs.pm 2017/07/10 12:48:41 1.633
+++ loncom/interface/londocs.pm 2017/08/13 20:52:58 1.634
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.633 2017/07/10 12:48:41 raeburn Exp $
+# $Id: londocs.pm,v 1.634 2017/08/13 20:52:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6574,6 +6574,7 @@ my %suporderhash = (
sub embedded_form_elems {
my ($phase,$primaryurl,$newidx) = @_;
my $folderpath = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ $newidx =~s /\D+//g;
return <
@@ -6594,7 +6595,11 @@ sub embedded_destination {
} elsif ($folder =~ /^(default|supplemental)_(\d+)$/) {
$destination .= $2.'/';
}
- $destination .= $env{'form.newidx'};
+ my $newidx = $env{'form.newidx'};
+ $newidx =~s /\D+//g;
+ if ($newidx) {
+ $destination .= $newidx;
+ }
my $dir_root = '/userfiles';
return ($destination,$dir_root);
}
@@ -6620,6 +6625,9 @@ sub decompression_info {
}
unshift(@hiddens,$pathitem);
foreach my $item (@hiddens) {
+ if ($item eq 'newidx') {
+ next if ($env{'form.'.$item} =~ /\D/);
+ }
if ($env{'form.'.$item}) {
$hiddenelem .= ''."\n";