[Rt-commit] rt branch, 4.0/canonicalize-multiple-slashes, updated. rt-4.0.5-119-gebe06d2

Thomas Sibley trs at bestpractical.com
Mon Aug 27 20:13:09 EDT 2012


The branch, 4.0/canonicalize-multiple-slashes has been updated
       via  ebe06d2e0218454e5ad3dc5c0a9dba4b90051dd0 (commit)
      from  9b8d1425f8f9905e2a2cacf7e544e6fbb0efa74d (commit)

Summary of changes:
 lib/RT/Interface/Web/Menu.pm | 1 +
 1 file changed, 1 insertion(+)

- Log -----------------------------------------------------------------
commit ebe06d2e0218454e5ad3dc5c0a9dba4b90051dd0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Aug 27 17:10:43 2012 -0700

    Canonicalize slashes in the request path when comparing to menu paths
    
    Request paths with double slashes will now correctly compare to the
    already canonicalized menu paths.

diff --git a/lib/RT/Interface/Web/Menu.pm b/lib/RT/Interface/Web/Menu.pm
index ba601fd..90821e8 100644
--- a/lib/RT/Interface/Web/Menu.pm
+++ b/lib/RT/Interface/Web/Menu.pm
@@ -230,6 +230,7 @@ sub child {
         if ( defined $path and length $path ) {
             my $base_path = $HTML::Mason::Commands::r->path_info;
             my $query     = $HTML::Mason::Commands::m->cgi_object->query_string;
+            $base_path =~ s!/+!/!g;
             $base_path .= "?$query" if defined $query and length $query;
 
             $base_path =~ s/index\.html$//;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list