--- loncom/interface/spreadsheet/Spreadsheet.pm 2004/02/24 20:47:14 1.36 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2005/04/21 17:30:24 1.37.2.1 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.36 2004/02/24 20:47:14 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.37.2.1 2005/04/21 17:30:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -911,7 +911,8 @@ sub sett { $t{$cell}=~s/(^|[^\"\'])([A-Za-z]\d+)/$1\$sheet_values\{\'$2\'\}/g; $t{$cell}=~s/(^|[^\"\'])\[([^\]]+)\]/$1.$self->expandnamed($2)/ge; } elsif ( $col =~ /^[A-Z]$/ ) { - if ($formula !~ /^\!/ && exists($self->{'constants'}->{$cell})) { + if ($formula !~ /^\!/ && exists($self->{'constants'}->{$cell}) + && $self->{'constants'}->{$cell} ne '') { my $data = $self->{'constants'}->{$cell}; $t{$cell} = $data; } @@ -1294,7 +1295,7 @@ sub html_editable_cell { } elsif ($value =~ /^\s*$/ ) { $value = '#'; } else { - $value = &HTML::Entities::encode($value) if ($value !~/ /); + $value = &HTML::Entities::encode($value,'<>&"') if ($value !~/ /); } return $value if (! $allowed); # @@ -1317,7 +1318,7 @@ sub html_editable_cell { sub html_uneditable_cell { my ($cell,$bgcolor) = @_; my $value = (defined($cell) ? $cell->{'value'} : ''); - $value = &HTML::Entities::encode($value) if ($value !~/ /); + $value = &HTML::Entities::encode($value,'<>&"') if ($value !~/ /); return ' '.$value.' '; }