Bug#186740: Encode HTML special chars in $short_desc
Attached a patch that would encode HTML special chars in the short
description (see #181872 for a similar discussion on long
descriptions) both in all_packages and in the packages pages.
The lines handling & are commented out. See the corresponding
discussion in the bug mentioned above.
Greetings,
Frank
Index: htmlscripts/pages.pl
===================================================================
RCS file: /cvs/webwml/packages/htmlscripts/pages.pl,v
retrieving revision 1.10
diff -u -IMD5 -r1.10 pages.pl
--- htmlscripts/pages.pl 24 Mar 2003 15:05:57 -0000 1.10
+++ htmlscripts/pages.pl 29 Mar 2003 15:23:42 -0000
@@ -113,7 +113,11 @@
if ($distrib =~ /(contrib|non-free|non-us|security)/o) {
$all_package .= " [<font color=\"red\">$distrib</font>]\n";
}
- $all_package .= "\n <dd>".$package{$_}{'short-desc'}."\n";
+ my $short_desc = $package{$_}{'short-desc'};
+# $short_desc =~ s/&/\&\;/go;
+ $short_desc =~ s/</\<\;/go;
+ $short_desc =~ s/>/\>\;/go;
+ $all_package .= "\n <dd>".$short_desc."\n";
}
$all_package .= "</dl>\n";
$all_package .= trailer('../..');
@@ -161,6 +165,9 @@
}
$short_desc = $package{$pack}{'short-desc'};
$long_desc = $package{$pack}{'long-desc'};
+# $short_desc =~ s/\&/\&\;/go;
+ $short_desc =~ s/</\<\;/go;
+ $short_desc =~ s/>/\>\;/go;
$long_desc =~ s,<((URL:)?http://[\S~-]+?/?)>,\<\;$1\>\;,go;
$long_desc =~ s,(http://[\S~-]+?/?)((\>\;)?[)]?[']?[.\,]?(\s|$)),<a href=\"$1\">$1</a>$2,go;
$long_desc =~ s/\A //o;
--
*** Frank Lichtenheld <frank@lichtenheld.de> ***
*** http://www.djpig.de/ ***
see also: - http://www.usta.de/
- http://fachschaft.physik.uni-karlsruhe.de/
Reply to: