--- loncom/interface/loncommon.pm 2013/11/25 20:18:55 1.1159 +++ loncom/interface/loncommon.pm 2013/11/26 03:17:07 1.1161 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1159 2013/11/25 20:18:55 raeburn Exp $ +# $Id: loncommon.pm,v 1.1161 2013/11/26 03:17:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7282,7 +7282,7 @@ sub headtag { my $result = '
'. - &font_settings(); + &font_settings($args); my $inhibitprint = &print_suppression(); @@ -7347,13 +7347,15 @@ ADDMETA Returns neccessary to set the proper encoding -Inputs: none +Inputs: optional reference to HASH -- $args passed to &headtag() =cut sub font_settings { + my ($args) = @_; my $headerstring=''; - if (!$env{'browser.mathml'} && $env{'browser.unicode'}) { + if ((!$env{'browser.mathml'} && $env{'browser.unicode'}) || + ((ref($args) eq 'HASH') && ($args->{'browser.unicode'}))) { $headerstring.= ''."\n"; } @@ -14908,6 +14910,28 @@ sub check_recaptcha { return $captcha_chk; } +sub cleanup_html { + my ($incoming) = @_; + my $outgoing; + if ($incoming ne '') { + $outgoing = $incoming; + $outgoing =~ s/;/;/g; + $outgoing =~ s/\#/#/g; + $outgoing =~ s/\&/&/g; + $outgoing =~ s/</g; + $outgoing =~ s/>/>/g; + $outgoing =~ s/\(/(/g; + $outgoing =~ s/\)/)/g; + $outgoing =~ s/"/"/g; + $outgoing =~ s/'/'/g; + $outgoing =~ s/\$/$/g; + $outgoing =~ s{/}{/}g; + $outgoing =~ s/=/=/g; + $outgoing =~ s/\\/\/g + } + return $outgoing; +} + =pod =back