8282 reqParams = [ ]
8383 var allowTag = true ;
8484 if ( access_type . length ) {
85- reqParams . push ( "accessTag=" + access_type )
86- reqParams . push ( "accessTagExact=" + access_type )
85+ reqParams . push ( "accessTag=" + encodeURIComponent ( access_type ) )
86+ reqParams . push ( "accessTagExact=" + encodeURIComponent ( access_type ) )
8787 allowTag = false
8888 }
8989 for ( var i = 0 ; i < fields . length ; i ++ ) {
9090 if ( fields [ i ] . value && fields [ i ] . value . trim ( ) . length )
9191 if ( fields [ i ] . id != "accessTag" || allowTag ) {
92- reqParams . push ( fields [ i ] . id + "=" + fields [ i ] . value )
92+ reqParams . push ( fields [ i ] . id + "=" + encodeURIComponent ( fields [ i ] . value ) )
9393 }
9494 }
95- reqParams . push ( "responseType=" + contentType )
95+ reqParams . push ( "responseType=" + encodeURIComponent ( contentType ) )
9696 reqParams . push ( "page=" + String ( page_number ) )
9797 url = new URL ( window . location . href )
9898 if ( url . searchParams . get ( "username" ) ) {
99- reqParams . push ( "username=" + url . searchParams . get ( "username" ) )
99+ reqParams . push ( "username=" + encodeURIComponent ( url . searchParams . get ( "username" ) ) )
100100 }
101101 urlBuilder = "userAccesses?" + reqParams . join ( "&" ) ;
102102 return urlBuilder ;
@@ -171,7 +171,7 @@ <h4 id="header-title">`+access_type+` Accesses for User {{username}}</h4>`
171171 html_string += "<td>" + record [ "offboarding_date" ] + "</td>"
172172 html_string += "<td>" + record [ "grantOwner" ] + "</td>"
173173 html_string += "<td>" + record [ "revokeOwner" ] + "</td>"
174- html_string += "<td>{% if is_ops %} <a class=\"btn btn-primary\" target=\"_blank\" href=\"/individual_resolve?requestId=" + record [ "requestId" ] + "&ops_resolve=true\">ReGrant</a></td>{% endif %}"
174+ html_string += "<td>{% if is_ops %} <a class=\"btn btn-primary\" target=\"_blank\" href=\"/individual_resolve?requestId=" + encodeURIComponent ( record [ "requestId" ] ) + "&ops_resolve=true\">ReGrant</a></td>{% endif %}"
175175 html_string += "<td>" + record [ "type" ] + "</td>"
176176 html_string += "</tr>"
177177 }
@@ -191,7 +191,7 @@ <h4 id="header-title">`+access_type+` Accesses for User {{username}}</h4>`
191191
192192 $ ( document ) . on ( 'click' , '.revoke-button' , function ( ) {
193193 id = $ ( this ) . attr ( "id" ) ;
194- urlBuilder = "/access/markRevoked?requestId=" + id + "&username=" + current_username
194+ urlBuilder = "/access/markRevoked?requestId=" + encodeURIComponent ( id ) + "&username=" + encodeURIComponent ( current_username )
195195 $ . ajax ( { url : urlBuilder ,
196196 success : function ( result ) {
197197 console . log ( "yes" , id + "-revoke-button" , id + "-access-status" )
@@ -333,7 +333,7 @@ <h4 id="header-title">Access List for User {{username}}</h4>
333333 < td > {{item.grantOwner}}</ td >
334334 < td > {{item.revokeOwner}}</ td >
335335 < td > {% if is_ops %}
336- < a class ="btn btn-primary " target ="_blank " href ="/individual_resolve?requestId={{ item.requestId }}&ops_resolve=true "> ReGrant</ a > </ td >
336+ < a class ="btn btn-primary " target ="_blank " href ="/individual_resolve?requestId={{ item.requestId|urlencode }}&ops_resolve=true "> ReGrant</ a > </ td >
337337 {% endif %}
338338 < td > {{item.access_type}}</ td >
339339 </ tr >
0 commit comments