--- loncom/interface/spreadsheet/Spreadsheet.pm 2003/07/16 16:48:51 1.19 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2003/08/26 19:14:06 1.21 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.19 2003/07/16 16:48:51 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.21 2003/08/26 19:14:06 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -794,8 +794,8 @@ sub expandnamed { my @vars=split(/\W+/,$formula); my %values=(); foreach my $varname ( @vars ) { - if ($varname=~/\D/) { - $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; + if ($varname=~/^(parameter|stores|timestamp)/) { + $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; $varname=~s/$var/\([\\w:\\- ]\+\)/g; foreach (keys(%{$self->{'constants'}})) { if ($_=~/$varname/) { @@ -1217,7 +1217,9 @@ sub html_editable_cell { # # The encoding string "^A-blah" is placed in []'s inside a regexp, so # we specify the characters we want left alone by putting a '^' in front. - $formula = &HTML::Entities::encode($formula,"^A-z0-9 !#\$%-;=?~"); + $formula = &HTML::Entities::encode($formula,'^A-z0-9 !#$%-;=?~'); + # HTML::Entities::encode does not catch everything - we need '\' encoded + $formula =~ s/\\/&\#092/g; # Escape it again - this time the only encodable character is '&' $formula =~ s/\&/\&/g; # Glue everything together