Log Message:
-----------
string2hash will now handle strings with newlines, fixing GDBM.
Modified Files:
--------------
webwork2/lib/WeBWorK/DB:
Utils.pm
Revision Data
-------------
Index: Utils.pm
===================================================================
RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB/Utils.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -Llib/WeBWorK/DB/Utils.pm -Llib/WeBWorK/DB/Utils.pm -u -r1.14 -r1.15
--- lib/WeBWorK/DB/Utils.pm
+++ lib/WeBWorK/DB/Utils.pm
@@ -134,7 +134,7 @@
sub string2hash($) {
my $string = shift;
return unless defined $string and $string;
- my %hash = $string =~ /(.*?)(?<!\\)=(.*?)(?:(?<!\\)&|$)/g;
+ my %hash = $string =~ /(.*?)(?<!\\)=(.*?)(?:(?<!\\)&|$)/gs; # /s allows . to match \n
$hash{$_} =~ s/\\(&|=)/$1/g foreach keys %hash; # unescape & and =
return %hash;
}
|