[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm lonparmset.pm /xml lonxml.pm
damieng
damieng at source.lon-capa.org
Thu Feb 16 13:17:53 EST 2017
damieng Thu Feb 16 18:17:53 2017 EDT
Modified files:
/loncom/interface lonparmset.pm lonannounce.pm
/loncom/xml lonxml.pm
Log:
fixed bug 6846 (bad regexp to match part id)
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.571 loncom/interface/lonparmset.pm:1.572
--- loncom/interface/lonparmset.pm:1.571 Tue Dec 6 15:59:56 2016
+++ loncom/interface/lonparmset.pm Thu Feb 16 18:17:49 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.571 2016/12/06 15:59:56 damieng Exp $
+# $Id: lonparmset.pm,v 1.572 2017/02/16 18:17:49 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3938,7 +3938,7 @@
$thistype=$$resourcedata{$thiskey.'.type'};
}
my ($middle,$part,$name)=
- ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s\-]+)\.(\w+)$/);
my $section=&mt('All Students');
if ($middle=~/^\[(.*)\]/) {
my $issection=$1;
@@ -5186,7 +5186,7 @@
my ($key) = @_;
my %data;
my ($middle,$part,$name)=
- ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s\-]+)\.(\w+)$/);
$data{'scope_type'} = 'all';
if ($middle=~/^\[(.*)\]/) {
$data{'scope'} = $1;
@@ -5938,7 +5938,7 @@
}
my ($middle,$part,$name)=
- ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s\-]+)\.(\w+)$/);
my $issection;
my $section=&mt('All Students');
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.87 loncom/interface/lonannounce.pm:1.88
--- loncom/interface/lonannounce.pm:1.87 Mon May 27 00:19:32 2013
+++ loncom/interface/lonannounce.pm Thu Feb 16 18:17:49 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Announce
#
-# $Id: lonannounce.pm,v 1.87 2013/05/27 00:19:32 raeburn Exp $
+# $Id: lonannounce.pm,v 1.88 2017/02/16 18:17:49 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -117,7 +117,7 @@
foreach my $thiskey (keys(%$resourcedata)) {
if ($resourcedata->{$thiskey.'.type'}=~/^date/) {
my ($course,$middle,$part,$name)=
- ($thiskey=~/^(\Q$courseid\E)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($thiskey=~/^(\Q$courseid\E)\.(?:(.+)\.)*([\w\s\-]+)\.(\w+)$/);
my %data = ( 'section' => &mt('All Students'));
if ($middle=~/^\[(.*)\]\./) {
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.556 loncom/xml/lonxml.pm:1.557
--- loncom/xml/lonxml.pm:1.556 Tue Aug 9 23:43:39 2016
+++ loncom/xml/lonxml.pm Thu Feb 16 18:17:53 2017
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.556 2016/08/09 23:43:39 raeburn Exp $
+# $Id: lonxml.pm,v 1.557 2017/02/16 18:17:53 damieng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -991,7 +991,7 @@
sub get_id {
my ($parstack,$safeeval)=@_;
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);
- if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\d\s[:punct:]])/) {
+ if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\s\-])/) {
&error(&mt('ID [_1] contains invalid characters. IDs are only allowed to contain letters, numbers, spaces and -','"<tt>'.$id.'</tt>"'));
}
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; }
More information about the LON-CAPA-cvs
mailing list