[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Tue, 07 Oct 2003 15:30:09 -0000
matthew Tue Oct 7 11:30:09 2003 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
We need to escape single quotes as these are used to enclose the strings
when inserted.
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.101 loncom/interface/loncoursedata.pm:1.102
--- loncom/interface/loncoursedata.pm:1.101 Fri Oct 3 12:39:17 2003
+++ loncom/interface/loncoursedata.pm Tue Oct 7 11:30:09 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.101 2003/10/03 16:39:17 matthew Exp $
+# $Id: loncoursedata.pm,v 1.102 2003/10/07 15:30:09 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1222,6 +1222,7 @@
# However, there is one wrinkle: submissions which end in
# and odd number of '\' cause insert errors to occur.
# Best trap this somehow...
+ $value =~ s/\'/\\\'/g;
my ($offensive_string) = ($value =~ /(\\+)$/);
if (length($offensive_string) % 2) {
$value =~ s/\\$/\\\\/;