Skip to content

Commit

Permalink
gitweb: esc_html() site name for title in OPML
Browse files Browse the repository at this point in the history
This escapes the site name in OPML (XML uses the same escaping rules
as HTML).  Also fixes encoding issues because esc_html() uses
to_utf8().

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jürgen Kreileder authored and Junio C Hamano committed Dec 19, 2011
1 parent 168c1e0 commit 5d79105
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -7700,11 +7700,12 @@ sub git_opml {
-charset => 'utf-8',
-content_disposition => 'inline; filename="opml.xml"');

my $title = esc_html($site_name);
print <<XML;
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
<head>
<title>$site_name OPML Export</title>
<title>$title OPML Export</title>
</head>
<body>
<outline text="git RSS feeds">
Expand Down

0 comments on commit 5d79105

Please sign in to comment.