[LON-CAPA-cvs] cvs: loncom /interface londocs.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sat, 08 Jan 2005 06:34:30 -0000
albertel Sat Jan 8 01:34:30 2005 EDT
Modified files:
/loncom/interface londocs.pm
Log:
- BUG#3807, allow more things in file names than just \w
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.162 loncom/interface/londocs.pm:1.163
--- loncom/interface/londocs.pm:1.162 Thu Dec 23 15:50:35 2004
+++ loncom/interface/londocs.pm Sat Jan 8 01:34:30 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.162 2004/12/23 20:50:35 raeburn Exp $
+# $Id: londocs.pm,v 1.163 2005/01/08 06:34:30 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -214,7 +214,7 @@
}
my $title=$origcrsdata{'description'};
$title=~s/\s+/\_/gs;
- $title=~s/\W//gs;
+ $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;
$r->print('<h3>'.&mt('Folder in Construction Space').'</h3><input type="text" size="50" name="authorfolder" value="'.$title.'" /><br />');
&tiehash();
$r->print('<h3>'.&mt('Filenames in Construction Space').'</h3><table border="2"><tr><th>'.&mt('Internal Filename').'</th><th>'.&mt('Title').'</th><th>'.&mt('Save as ...').'</th></tr>');
@@ -223,12 +223,13 @@
my ($ext)=($_=~/\.(\w+)$/);
my $title=$hash{'title_'.$hash{
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}};
+ $title=~s/:/:/g;
$r->print('<td>'.($title?$title:' ').'</td>');
unless ($title) {
$title=$_;
}
$title=~s/\.(\w+)$//;
- $title=~s/[^\w\/]+/\_/gs;
+ $title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs;
$title.='.'.$ext;
$r->print("\n<td><input type='text' size='60' name='namefor_".$_."' value='".$title."' /></td></tr>\n");
}