From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: "Bernhard R. Link" <brl+git@mail.brlink.eu>,
Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH] gitweb: Harden and improve $project_filter page title
Date: Sun, 12 Feb 2012 16:21:30 +0100 [thread overview]
Message-ID: <1329060090-32370-1-git-send-email-jnareb@gmail.com> (raw)
Commit 19d2d23 (gitweb: add project_filter to limit project list
to a subdirectory, 2012-01-30) added also support for displaying
$project_filter, if present, in page title.
Unfortunately it forgot to treat $project_filter as path, and escape
it using esc_path(), like it is done for $filename.
Also, it was not obvious that "$site_name - $project_filter" is about
project filtering: use "$site_name - projects in '$project_filter'".
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Though we should probably also esc_path($project), not only
to_utf8($project) in get_page_title() subroutine.
So I am not that sure if it is really necessary, or if I should follow
it by further hardening of get_page_title().
Anyway I have noticed this when I was examining gitweb code for
generating page title, considering adding information about search for
project search. So this is patch I will be depending textually via
context lines on.
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 081ac45..8ba2022 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3751,7 +3751,7 @@ sub get_page_title {
unless (defined $project) {
if (defined $project_filter) {
- $title .= " - " . to_utf8($project_filter);
+ $title .= " - projects in '" . esc_path($project_filter) . "'";
}
return $title;
}
--
1.7.9
reply other threads:[~2012-02-12 15:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329060090-32370-1-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=brl+git@mail.brlink.eu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).