[PATCH] gitweb: use href() when generating URLs in OPML

Subsystems: the rest

STALE3736d

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

[PATCH] gitweb: use href() when generating URLs in OPML

From: Giuseppe Bilotta <hidden>
Date: 2016-06-15 22:45:51

Since the OPML project list view was hand-coding the RSS and HTML URLs,
it didn't respect global options such as use_pathinfo. Make it use
href() to ensure consistency with the rest of the gitweb setup.

Signed-off-by: Giuseppe Bilotta <redacted>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fa7d8ad..b164001 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6146,8 +6146,8 @@ XML
 		}
 
 		my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-		my $rss  = "$my_url?p=$proj{'path'};a=rss";
-		my $html = "$my_url?p=$proj{'path'};a=summary";
+		my $rss  = href('project' => $proj{'path'}, 'action' => 'rss', -full => 1);
+		my $html = href('project' => $proj{'path'}, 'action' => 'summary', -full => 1);
 		print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
 	}
 	print <<XML;
-- 
1.5.6.5

Re: [PATCH] gitweb: use href() when generating URLs in OPML

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:45:51

Giuseppe Bilotta wrote:
Since the OPML project list view was hand-coding the RSS and HTML URLs,
it didn't respect global options such as use_pathinfo. Make it use
href() to ensure consistency with the rest of the gitweb setup.
Good catch. I guess it was before href(..., -full=>1)...
Signed-off-by: Giuseppe Bilotta <redacted>
Acked-by: Jakub Narebski <redacted>
quoted hunk
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index fa7d8ad..b164001 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6146,8 +6146,8 @@ XML
 		}
 
 		my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-		my $rss  = "$my_url?p=$proj{'path'};a=rss";
-		my $html = "$my_url?p=$proj{'path'};a=summary";
+		my $rss  = href('project' => $proj{'path'}, 'action' => 'rss', -full => 1);
+		my $html = href('project' => $proj{'path'}, 'action' => 'summary', -full => 1);
 		print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
 	}
 	print <<XML;
-- 
1.5.6.5
-- 
Jakub Narebski
Poland

Re: [PATCH] gitweb: use href() when generating URLs in OPML

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:52

Thanks, both; applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help