[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 07 Oct 2004 16:27:48 -0000
albertel Thu Oct 7 12:27:48 2004 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
- escape any dollar signs that appear in a string arg if they aren't immediately
followed by a-z A-Z _ { this is less restictive then what I did in 1.293, and
shouldn't trigger bug #2420 again. Crossing my fingers.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.341 loncom/xml/lonxml.pm:1.342
--- loncom/xml/lonxml.pm:1.341 Tue Oct 5 16:18:29 2004
+++ loncom/xml/lonxml.pm Thu Oct 7 12:27:48 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.341 2004/10/05 20:18:29 albertel Exp $
+# $Id: lonxml.pm,v 1.342 2004/10/07 16:27:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1028,7 +1028,7 @@
unless ($_=~/\W/) {
my $val=$token->[2]->{$_};
$val =~ s/([\%\@\\\"\'])/\\$1/g;
- $val =~ s/^(\$\d)/\\$1/;
+ $val =~ s/(\$[^{a-zA-Z_])/\\$1/g;
#if ($val =~ m/^[\%\@]/) { $val="\\".$val; }
$temp .= "my \$$_=\"$val\";";
}