/[swish]/trunk/html/swish.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/html/swish.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 27 by dpavlin, Fri Mar 21 22:01:59 2003 UTC revision 29 by dpavlin, Mon Mar 24 09:04:57 2003 UTC
# Line 19  sub x { Line 19  sub x {
19          return $from_utf8->convert($_[0]);          return $from_utf8->convert($_[0]);
20  }  }
21    
22  use Data::Dumper;  # Escape <, >, & and ", and to produce valid XML
23  #print Dumper($config);  my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');  
24    my $escape_re  = join '|' => keys %escape;
25    sub e {
26            my $out;
27            foreach my $v (@_) {
28                    $v =~ s/($escape_re)/$escape{$1}/g;
29                    $out .= $v;
30            }
31            return $out;
32    }
33    
34  my $spelling_alt;  my $spelling_alt;
35  # FIX: doesn't work very well  # FIX: doesn't work very well
# Line 125  if (param('search')) { Line 134  if (param('search')) {
134                                  "<a href=\"%s\">%s</a> [%s]<br>\n";                                  "<a href=\"%s\">%s</a> [%s]<br>\n";
135    
136                          if ($config->{url}) {                          if ($config->{url}) {
137                                  printf ($hit_fmt ,"http://".virtual_host().x($config->{url}).$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank);                                  printf ($hit_fmt ,"http://".virtual_host().x($config->{url}).$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank);
138                          } else {                          } else {
139                                  printf ($hit_fmt ,$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank, map($hit->$_, @properties) );                                  printf ($hit_fmt ,$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank, map($hit->$_, @properties) );
140    
141                          }                          }
142    

Legend:
Removed from v.27  
changed lines
  Added in v.29

  ViewVC Help
Powered by ViewVC 1.1.26