{"thread":{"id":"29608","subject":"[PATCH] gitweb: Harden and improve $project_filter page title","startedAt":"2012-02-12T15:21:30Z","lastAt":"2012-02-12T15:21:30Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"184513","messageId":"1329060090-32370-1-git-send-email-jnareb@gmail.com","threadId":"29608","inReplyTo":null,"subject":"[PATCH] gitweb: Harden and improve $project_filter page title","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2012-02-12T15:21:30Z","receivedAt":"2012-02-12T15:21:30Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Commit 19d2d23 (gitweb: add project_filter to limit project list\nto a subdirectory, 2012-01-30) added also support for displaying\n$project_filter, if present, in page title.\n\nUnfortunately it forgot to treat $project_filter as path, and escape\nit using esc_path(), like it is done for $filename.\n\nAlso, it was not obvious that \"$site_name - $project_filter\" is about\nproject filtering: use \"$site_name - projects in '$project_filter'\".\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThough we should probably also esc_path($project), not only\nto_utf8($project) in get_page_title() subroutine.\n\nSo I am not that sure if it is really necessary, or if I should follow\nit by further hardening of get_page_title().\n\nAnyway I have noticed this when I was examining gitweb code for\ngenerating page title, considering adding information about search for\nproject search.  So this is patch I will be depending textually via\ncontext lines on.\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 081ac45..8ba2022 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3751,7 +3751,7 @@ sub get_page_title {\n \n \tunless (defined $project) {\n \t\tif (defined $project_filter) {\n-\t\t\t$title .= \" - \" . to_utf8($project_filter);\n+\t\t\t$title .= \" - projects in '\" . esc_path($project_filter) . \"'\";\n \t\t}\n \t\treturn $title;\n \t}\n-- \n1.7.9\n"}]}