diff --git a/guacamole/src/main/frontend/src/app/index/filters/escapeFilter.js b/guacamole/src/main/frontend/src/app/index/filters/escapeFilter.js new file mode 100644 index 000000000..c1ec4e010 --- /dev/null +++ b/guacamole/src/main/frontend/src/app/index/filters/escapeFilter.js @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * A filter for making sure that a string is URI-encoded and + * that any characters with special meaning for URIs are escaped. + */ +angular.module('index').filter('escape', [function escapeFilter() { + + return function escapeFilter(input) { + + if (input) + return window.encodeURIComponent(input); + + return ''; + + }; + +}]); diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsConnections.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsConnections.html index 6b890d162..ca7bc30df 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsConnections.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsConnections.html @@ -11,11 +11,11 @@ {{'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION' | translate}} + href="#/manage/{{dataSource | escape}}/connections/">{{'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION' | translate}} {{'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION_GROUP' | translate}} + href="#/manage/{{dataSource | escape}}/connectionGroups/">{{'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION_GROUP' | translate}} diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html index 19437731b..ccb534e65 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsUserGroups.html @@ -10,7 +10,7 @@
{{'SETTINGS_USER_GROUPS.ACTION_NEW_USER_GROUP' | translate}} + href="#/manage/{{getDefaultDataSource() | escape}}/userGroups/">{{'SETTINGS_USER_GROUPS.ACTION_NEW_USER_GROUP' | translate}}
@@ -32,7 +32,7 @@ - +
{{manageableUserGroup.userGroup.identifier}}
diff --git a/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html b/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html index 232a1f252..18a043782 100644 --- a/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html +++ b/guacamole/src/main/frontend/src/app/settings/templates/settingsUsers.html @@ -10,7 +10,7 @@
{{'SETTINGS_USERS.ACTION_NEW_USER' | translate}} + href="#/manage/{{getDefaultDataSource() | escape}}/users/">{{'SETTINGS_USERS.ACTION_NEW_USER' | translate}}
@@ -41,7 +41,7 @@ - +
{{manageableUser.user.username}}