LP1858701: prevent doubles slashes in opac iframe urls
authorJason Boyer <JBoyer@eoli.info>
Wed, 8 Jan 2020 18:37:01 +0000 (13:37 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 25 Jul 2020 03:44:32 +0000 (20:44 -0700)
The CGI module (used by mkurl()) does not like it
if we have two slashes in a URL sort/of/like//this.
Things work but the path portion of the URL is doubled
each time mkurl is used on it. This branch fixes 2
causes in the staff OPAC.

Signed-off-by: Jason Boyer <JBoyer@eoli.info>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 68f387e..c3b6b1f 100644 (file)
@@ -1944,13 +1944,13 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         // A record ID in the path indicates a request for the record-
         // specific page.
         if ($routeParams.record_id) {
-            url = url.replace(/advanced/, '/record/' + $scope.record_id);
+            url = url.replace(/\/advanced/, '/record/' + $scope.record_id);
         }
 
         // Jumping directly to the results page by passing a search
         // query via the URL.  Copy all URL params to the iframe url.
         if ($location.path().match(/catalog\/results/)) {
-            url = url.replace(/advanced/, '/results?');
+            url = url.replace(/\/advanced/, '/results?');
             var first = true;
             angular.forEach($location.search(), function(val, key) {
                 if (!first) url += '&';