]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Fix HTML entity decoding for unit, especially °C...
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Wed, 21 May 2014 06:00:41 +0000 (08:00 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Wed, 21 May 2014 13:30:09 +0000 (15:30 +0200)
xml-db/get.pl

index 2f6fdaf6a222fa264bd6020cfa7788a7f3b0e631..4699eb3d38fe6c30713224fb646c4e9d022b6e68 100755 (executable)
@@ -4,6 +4,7 @@ use Storable qw(lock_store lock_retrieve);
 use feature "switch";
 use Time::HiRes qw( time usleep );
 use CGI::Carp qw(fatalsToBrowser);
+use HTML::Entities qw(encode_entities);
 
 use if (!defined $ENV{'QUERY_STRING'}), warnings;
 use if (!defined $ENV{'QUERY_STRING'}), Pod::Usage;
@@ -253,7 +254,7 @@ sub FormatPretty {
       }
     my $range = $obj->{start}+$obj->{bits}-1;
     $range .= "..".$obj->{start} if ($obj->{bits}>1);
-    $ret .= " ".$obj->{unit} if exists $obj->{unit};
+    $ret .= " ".encode_entities($obj->{unit}) if exists $obj->{unit};
     $ret .= sprintf("<span class=\"tooltip\"><b>$name</b> (Bit $range)<br>raw: 0x%x<br>$cstr</span></div>",$rawvalue);
 
     }
@@ -278,7 +279,7 @@ sub FormatPretty {
                           }
       default           {$ret = sprintf("0x%08x",$value);}
       }
-    $ret .= " ".$obj->{unit} if exists $obj->{unit};
+    $ret .= " ".encode_entities($obj->{unit}) if exists $obj->{unit};
     }
   return $ret;
   }