Bug #21794 fixed, folder names were not URI encoded

Bug/21794
Massimiliano Assante 3 years ago
parent fa373c0ff7
commit 0acb08f4ba

@ -4,9 +4,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.5.1] - 2021-05-25 ## [v1.5.1-SNAPSHOT] - 2021-05-25
- Feature #21507 support new UMATokensProvider class - Feature #21507 support new UMATokensProvider class
- Bug #21794 folder names were not URI encoded
## [v1.5.0] - 2021-04-06 ## [v1.5.0] - 2021-04-06

@ -13,7 +13,7 @@
<artifactId>workspace-widget-portlet</artifactId> <artifactId>workspace-widget-portlet</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>workspace-widget-portlet Portlet</name> <name>workspace-widget-portlet Portlet</name>
<version>1.5.1</version> <version>1.5.1-SNAPSHOT</version>
<description> <description>
Workspace Widget Portlet is a small Front-end component looking like G Drive which exposes the content of the user's workspace or VRE Folders in read only mode. Workspace Widget Portlet is a small Front-end component looking like G Drive which exposes the content of the user's workspace or VRE Folders in read only mode.
</description> </description>

@ -104,9 +104,7 @@ public class WorkspaceWidget extends MVCPortlet {
} catch (StorageHubException e) { } catch (StorageHubException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (! (item instanceof ExternalURL || item instanceof ExternalLink)) { if (! (item instanceof ExternalURL || item instanceof ExternalLink)) {
ServletResponseUtil.sendFile(httpReq,httpRes, streamDescr.getFileName(), streamDescr.getStream(), "application/download"); ServletResponseUtil.sendFile(httpReq,httpRes, streamDescr.getFileName(), streamDescr.getStream(), "application/download");
streamDescr.getStream().close(); streamDescr.getStream().close();
} }
@ -116,6 +114,7 @@ public class WorkspaceWidget extends MVCPortlet {
String cmd = ParamUtil.getString(resourceRequest, "cmd", ""); String cmd = ParamUtil.getString(resourceRequest, "cmd", "");
String selectedItemId = "root"; String selectedItemId = "root";
String selectedItemName = ""; String selectedItemName = "";
System.out.println("****\n\n\n*** String cmd2 ="+cmd);
if (cmd != null && cmd.split("_selectedName").length > 1) { if (cmd != null && cmd.split("_selectedName").length > 1) {
String[] splits = cmd.split("_selectedName"); String[] splits = cmd.split("_selectedName");
selectedItemId = splits[0].split("=")[1]; selectedItemId = splits[0].split("=")[1];

@ -91,7 +91,7 @@ $.fn.dataTable.ext.errMode = 'none';
function loadItemsListIntoTable(itemId, itemName, hideVreFolders) { function loadItemsListIntoTable(itemId, itemName, hideVreFolders) {
var table = $('#userTable').DataTable(); var table = $('#userTable').DataTable();
table.ajax.url('<%=usersCustomDataSourceURL%>'+itemId+'_selectedName='+itemName).load(); table.ajax.url('<%=usersCustomDataSourceURL%>'+itemId+'_selectedName='+encodeURIComponent(itemName)).load();
if (hideVreFolders) { if (hideVreFolders) {
$('#vreFoldersDiv').hide(); $('#vreFoldersDiv').hide();
} else { } else {
@ -103,7 +103,7 @@ function loadItemsListIntoTable(itemId, itemName, hideVreFolders) {
function loadRecentItemsListIntoTable(itemId, itemName) { function loadRecentItemsListIntoTable(itemId, itemName) {
var table = $('#userTable').DataTable(); var table = $('#userTable').DataTable();
table.ajax.url('<%=usersCustomDataSourceURL%>'+itemId+'_selectedName='+itemName).load(); table.ajax.url('<%=usersCustomDataSourceURL%>'+itemId+'_selectedName='+encodeURIComponent(itemName)).load();
$('#userTable_info').hide(); $('#userTable_info').hide();
$('#userTable_length').hide(); $('#userTable_length').hide();
} }

Loading…
Cancel
Save