]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Clean up HTML escapes in the configuration manual
authorhno <>
Mon, 25 Jun 2007 15:58:49 +0000 (15:58 +0000)
committerhno <>
Mon, 25 Jun 2007 15:58:49 +0000 (15:58 +0000)
scripts/www/build-cfg-help.pl

index a708ac0202fb07bf698483c4b7e692a2601023c8..cc474afc55059f60a8f425de10dd02fafc22ec47 100755 (executable)
@@ -10,7 +10,7 @@ use File::Basename;
 #
 # Adrian Chadd <adrian@squid-cache.org>
 #
-# $Id: build-cfg-help.pl,v 1.2 2007/05/21 23:31:37 hno Exp $
+# $Id: build-cfg-help.pl,v 1.3 2007/06/25 09:58:49 hno Exp $
 
 #
 # The template file is reasonably simple to parse. There's a number of
@@ -106,7 +106,10 @@ sub htmlescape($)
 {
        my ($line) = @_;
        return "" if !defined $line;
-       $line =~ s/([^\w\s])/sprintf ("&#%d;", ord ($1))/ge;
+       $line =~ s/&/\&amp;/g;
+       $line =~ s/</\&lt;/g;
+       $line =~ s/>/\&gt;/g;
+       $line =~ s/[^\x{20}-\x{7e}\s]/sprintf ("&#%d;", ord ($1))/ge;
        return $line;
 }