Skip to contentSkip to conversation

gitweb: use href() when generating URLs in OPML

PATCH In review Giuseppe Bilotta 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitweb: use href() when generating URLs in OPML

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.

---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +2 -2
index fa7d8ad..b164001 100755
@@ -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;
Signature · 1 line
1.5.6.5
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Giuseppe Bilotta

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)...

Quoted 2 lines
Quoted 23 lines
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +2 -2
index fa7d8ad..b164001 100755
@@ -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;
Signature · 1 line
1.5.6.5
Signature · 2 lines
Jakub Narebski
Poland