5af72bf1f49b25b8a2272368ed93275ab3e1a842
chmalee
  Mon May 5 16:01:50 2025 -0700
use cgiEncode() rather than encodeURIComponent to preserve '/' characters in input

diff --git src/hg/js/hgMyData.js src/hg/js/hgMyData.js
index daf07739c16..70a4e3719ff 100644
--- src/hg/js/hgMyData.js
+++ src/hg/js/hgMyData.js
@@ -349,31 +349,31 @@
     let selectedData = {};
     function viewAllInGenomeBrowser(ev) {
         // redirect to hgTracks with these tracks/hubs open
         let data = selectedData;
         if (typeof uiState.userUrl !== "undefined" && uiState.userUrl.length > 0) {
             let url = "../cgi-bin/hgTracks?hgsid=" + getHgsid();
             let genome; // may be multiple genomes in list, just redirect to the first one
                         // TODO: this should probably raise an alert to click through
             let hubsAdded = {};
             _.forEach(data, (d) => {
                 if (!genome) {
                     genome = d.genome;
                     url += "&db=" + genome;
                 }
                 if (d.fileType === "hub.txt") {
-                    url += "&hubUrl=" + uiState.userUrl + encodeURIComponent(d.fullPath);
+                    url += "&hubUrl=" + uiState.userUrl + cgiEncode(d.fullPath);
                 }
                 else if (d.fileType in extensionMap) {
                     // TODO: tusd should return this location in it's response after
                     // uploading a file and then we can look it up somehow, the cgi can
                     // write the links directly into the html directly for prev uploaded files maybe?
                     if (!(d.parentDir in hubsAdded)) {
                         // NOTE: hubUrls get added regardless of whether they are on this assembly
                         // or not, because multiple genomes may have been requested. If this user
                         // switches to another genome we want this hub to be connected already
                         url += "&hubUrl=" + uiState.userUrl + cgiEncode(d.parentDir);
                         if (d.parentDir.endsWith("/")) {
                             url += "hub.txt";
                         } else {
                             url += "/hub.txt";
                         }