]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Harden and improve $project_filter page title
authorJakub Narebski <redacted>
Sun, 12 Feb 2012 15:21:30 +0000 (16:21 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index df001adc71d6d5314458f0fe2093dcf276510493b2c61bc0d0397488fadc97da..dac4129e203c54695238a0acbe57407ff131bbaf42d32ba54c55f9097f74ec8d 100755 (executable)
@@ -3745,7 +3745,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;
        }
This page took 0.292028 seconds and 4 git commands to generate.