@@ -4048,7 +4048,7 @@ sub print_feed_meta {
4048
4048
4049
4049
$href_params {' extra_options' } = undef ;
4050
4050
$href_params {' action' } = $type ;
4051
- $link_attr {' -href' } = href(%href_params );
4051
+ $link_attr {' -href' } = esc_attr( href(%href_params ) );
4052
4052
print " <link " .
4053
4053
" rel=\" $link_attr {'-rel'}\" " .
4054
4054
" title=\" $link_attr {'-title'}\" " .
@@ -4057,7 +4057,7 @@ sub print_feed_meta {
4057
4057
" />\n " ;
4058
4058
4059
4059
$href_params {' extra_options' } = ' --no-merges' ;
4060
- $link_attr {' -href' } = href(%href_params );
4060
+ $link_attr {' -href' } = esc_attr( href(%href_params ) );
4061
4061
$link_attr {' -title' } .= ' (no merges)' ;
4062
4062
print " <link " .
4063
4063
" rel=\" $link_attr {'-rel'}\" " .
@@ -4070,10 +4070,12 @@ sub print_feed_meta {
4070
4070
} else {
4071
4071
printf (' <link rel="alternate" title="%s projects list" ' .
4072
4072
' href="%s" type="text/plain; charset=utf-8" />' ." \n " ,
4073
- esc_attr($site_name ), href(project => undef , action => " project_index" ));
4073
+ esc_attr($site_name ),
4074
+ esc_attr(href(project => undef , action => " project_index" )));
4074
4075
printf (' <link rel="alternate" title="%s projects feeds" ' .
4075
4076
' href="%s" type="text/x-opml" />' ." \n " ,
4076
- esc_attr($site_name ), href(project => undef , action => " opml" ));
4077
+ esc_attr($site_name ),
4078
+ esc_attr(href(project => undef , action => " opml" )));
4077
4079
}
4078
4080
}
4079
4081
@@ -4287,8 +4289,8 @@ sub git_footer_html {
4287
4289
if (defined $action &&
4288
4290
$action eq ' blame_incremental' ) {
4289
4291
print qq! <script type="text/javascript">\n ! .
4290
- qq! startBlame("! . href(action => " blame_data" , -replay => 1) .qq! ",\n ! .
4291
- qq! "! . href() .qq! ");\n ! .
4292
+ qq! startBlame("! . esc_attr( href(action => " blame_data" , -replay => 1) ) .qq! ",\n ! .
4293
+ qq! "! . esc_attr( href() ) .qq! ");\n ! .
4292
4294
qq! </script>\n ! ;
4293
4295
} else {
4294
4296
my ($jstimezone , $tz_cookie , $datetime_class ) =
@@ -7155,8 +7157,8 @@ sub git_blob {
7155
7157
print qq! alt="! .esc_attr($file_name ).qq! " title="! .esc_attr($file_name ).qq! "! ;
7156
7158
}
7157
7159
print qq! src="! .
7158
- href(action => " blob_plain" , hash => $hash ,
7159
- hash_base => $hash_base , file_name => $file_name ) .
7160
+ esc_attr( href(action => " blob_plain" , hash => $hash ,
7161
+ hash_base => $hash_base , file_name => $file_name )) .
7160
7162
qq! " />\n ! ;
7161
7163
} else {
7162
7164
my $nr ;
@@ -8239,6 +8241,7 @@ sub git_feed {
8239
8241
} else {
8240
8242
$alt_url = href(-full => 1, action => " summary" );
8241
8243
}
8244
+ $alt_url = esc_attr($alt_url );
8242
8245
print qq! <?xml version="1.0" encoding="utf-8"?>\n ! ;
8243
8246
if ($format eq ' rss' ) {
8244
8247
print <<XML ;
@@ -8276,7 +8279,7 @@ sub git_feed {
8276
8279
$alt_url . ' " />' . " \n " .
8277
8280
' <link rel="self" type="' . $content_type . ' " href="' .
8278
8281
$cgi -> self_url() . ' " />' . " \n " .
8279
- " <id>" . href(-full => 1) . " </id>\n " .
8282
+ " <id>" . esc_url( href(-full => 1) ) . " </id>\n " .
8280
8283
# use project owner for feed author
8281
8284
" <author><name>$owner </name></author>\n " ;
8282
8285
if (defined $favicon ) {
@@ -8322,7 +8325,7 @@ sub git_feed {
8322
8325
" <author>" . esc_html($co {' author' }) . " </author>\n " .
8323
8326
" <pubDate>$cd {'rfc2822'}</pubDate>\n " .
8324
8327
" <guid isPermaLink=\" true\" >$co_url </guid>\n " .
8325
- " <link>$co_url </link>\n " .
8328
+ " <link>" . esc_html( $co_url ) . " </link>\n " .
8326
8329
" <description>" . esc_html($co {' title' }) . " </description>\n " .
8327
8330
" <content:encoded>" .
8328
8331
" <![CDATA[\n " ;
@@ -8344,8 +8347,8 @@ sub git_feed {
8344
8347
}
8345
8348
print " </contributor>\n " .
8346
8349
" <published>$cd {'iso-8601'}</published>\n " .
8347
- " <link rel=\" alternate\" type=\" text/html\" href=\" $co_url \" />\n " .
8348
- " <id>$co_url </id>\n " .
8350
+ " <link rel=\" alternate\" type=\" text/html\" href=\" " . esc_attr( $co_url ) . " \" />\n " .
8351
+ " <id>" . esc_html( $co_url ) . " </id>\n " .
8349
8352
" <content type=\" xhtml\" xml:base=\" " . esc_url($my_url ) . " \" >\n " .
8350
8353
" <div xmlns=\" http://www.w3.org/1999/xhtml\" >\n " ;
8351
8354
}
@@ -8452,8 +8455,8 @@ sub git_opml {
8452
8455
}
8453
8456
8454
8457
my $path = esc_html(chop_str($proj {' path' }, 25, 5));
8455
- my $rss = href(' project' => $proj {' path' }, ' action' => ' rss' , -full => 1);
8456
- my $html = href(' project' => $proj {' path' }, ' action' => ' summary' , -full => 1);
8458
+ my $rss = esc_attr( href(' project' => $proj {' path' }, ' action' => ' rss' , -full => 1) );
8459
+ my $html = esc_attr( href(' project' => $proj {' path' }, ' action' => ' summary' , -full => 1) );
8457
8460
print " <outline type=\" rss\" text=\" $path \" title=\" $path \" xmlUrl=\" $rss \" htmlUrl=\" $html \" />\n " ;
8458
8461
}
8459
8462
print <<XML ;
0 commit comments