[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][base-browser-128.2.0esr-14.0-1] Bug 42773: Replace ~ with the original home.



Title: GitLab

morgan pushed to branch base-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 24d6492f
    by Pier Angelo Vendrame at 2024-09-04T16:15:43+00:00
    Bug 42773: Replace ~ with the original home.
    
    In Bug 93141, Mozilla started sending users to their home when they type
    ~ in the URL bar.
    On Linux, we change $HOME for various reason, therefore you would be
    redirected to the spoofed home directory when typing ~.
    So, we check if the original home directory is known, and use that,
    instead.
    

1 changed file:

Changes:

  • docshell/base/URIFixup.sys.mjs
    ... ... @@ -934,6 +934,10 @@ function fileURIFixup(uriString) {
    934 934
       } else {
    
    935 935
         // UNIX: Check if it starts with "/" or "~".
    
    936 936
         attemptFixup = /^[~/]/.test(uriString);
    
    937
    +    const originalHome = Services.env.get("BB_ORIGINAL_HOME");
    
    938
    +    if (originalHome && (uriString === "~" || uriString.startsWith("~/"))) {
    
    939
    +      path = originalHome + path.substring(1);
    
    940
    +    }
    
    937 941
       }
    
    938 942
       if (attemptFixup) {
    
    939 943
         try {
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits