From: Dobrica Pavlinusic Date: Tue, 8 Jul 2003 08:24:13 +0000 (+0000) Subject: fixed bugs with < and > in headline X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=71e603fa16799249349febdb169360921dec36a6;p=webpac fixed bugs with < and > in headline git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@80 13eb9ef6-21d5-0310-b721-a9d68796d827 --- diff --git a/WebPac.pm b/WebPac.pm index 6afdba8..cb361a0 100644 --- a/WebPac.pm +++ b/WebPac.pm @@ -117,6 +117,13 @@ sub show_results_list { my $tmpl = $self->load_tmpl('results.html'); + sub esc_html { + my $html = shift; + $html =~ s//>/g; + return $html; + } + # call swish my $sh = SWISH->connect('Fork', prog => $SWISH, @@ -128,7 +135,7 @@ sub show_results_list { push @swish_results, { nr => ($#swish_results + 2), path => $hit->swishdocpath, - headline => $from_utf8->convert($hit->headline), + headline => esc_html($from_utf8->convert($hit->headline)), html => back2html($from_utf8->convert($hit->html)), rank => $hit->swishrank }; diff --git a/back2html.pm b/back2html.pm index 1df1342..d61922f 100644 --- a/back2html.pm +++ b/back2html.pm @@ -7,6 +7,8 @@ sub back2html { my $html = shift; + $html =~ s//>/g; my $out; foreach $line (split(/\s*###\s*/,$html)) { $out .= "";