This is an automated email from the ASF dual-hosted git repository.

skylark17 pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new b8dc9b5  Improvements in handling messages from URL query strings
b8dc9b5 is described below

commit b8dc9b5c11d3d4779388614991f668af59281ceb
Author: Matteo Alessandroni <[email protected]>
AuthorDate: Fri Nov 29 14:20:56 2019 +0100

    Improvements in handling messages from URL query strings
---
 .../src/main/resources/META-INF/resources/app/js/app.js     | 13 ++++++-------
 .../META-INF/resources/app/js/controllers/UserController.js |  8 +++++---
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js 
b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
index 742cfe7..ba3b1cf 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
@@ -67,7 +67,7 @@ app.config(['$stateProvider', '$urlRouterProvider', 
'$httpProvider', '$translate
       'ja_*': 'ja',
       '*': 'en'
     }).fallbackLanguage('en').
-       determinePreferredLanguage();
+            determinePreferredLanguage();
     /*
      * State provider
      */
@@ -414,7 +414,7 @@ app.controller('ApplicationController', ['$scope', 
'$rootScope', '$translate', '
           {id: '4', name: '日本語', code: 'ja', format: 'yyyy/MM/dd HH:mm'}
         ]
       };
-      $rootScope.languages.selectedLanguage = 
$rootScope.languages.availableLanguages.filter(function(obj) {
+      $rootScope.languages.selectedLanguage = 
$rootScope.languages.availableLanguages.filter(function (obj) {
         return obj.code === $translate.preferredLanguage();
       })[0];
       /*
@@ -594,7 +594,6 @@ app.controller('ApplicationController', ['$scope', 
'$rootScope', '$translate', '
        
|--------------------------------------------------------------------------
        */
       $scope.notificationSuccessTimeout = 4000;
-//      $scope.notification = 
$('#notifications').kendoNotification().data("kendoNotification");
       $scope.notification = $("#notifications").kendoNotification({
         stacking: "down",
         hideOnClick: true,
@@ -603,18 +602,18 @@ app.controller('ApplicationController', ['$scope', 
'$rootScope', '$translate', '
       $scope.notification.options.position["top"] = 20;
       $scope.showSuccess = function (message, component) {
         if (!$scope.notificationExists(message)) {
-          //forcing scrollTo since kendo doesn't disable scrollTop if pinned 
is true
+          // forcing scrollTo since kendo doesn't disable scrollTop if pinned 
is true
           window.scrollTo(0, 0);
           component.options.autoHideAfter = $scope.notificationSuccessTimeout;
-          component.show(message, "success");
+          component.show(String(message).replace(/<[^>]+>/gm, ''), "success");
         }
       };
       $scope.showError = function (message, component) {
         if (!$scope.notificationExists(message)) {
-          //forcing scrollTo since kendo doesn't disable scrollTop if pinned 
is true
+          // forcing scrollTo since kendo doesn't disable scrollTop if pinned 
is true
           window.scrollTo(0, 0);
           component.options.autoHideAfter = 0;
-          component.show(message, "error");
+          component.show(String(message).replace(/<[^>]+>/gm, ''), "error");
         }
       };
       $scope.hideError = function (message, component) {
diff --git 
a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
 
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
index d4e7022..0d90c7c 100644
--- 
a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
+++ 
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js
@@ -25,7 +25,7 @@ angular.module("self").controller("UserController", 
['$scope', '$rootScope', '$l
   'UserSelfService', 'SchemaService', 'RealmService', 'ResourceService', 
'SecurityQuestionService',
   'GroupService', 'AnyService', 'UserUtil', 'GenericUtil', 
'ValidationExecutor', '$translate', '$filter',
   function ($scope, $rootScope, $location, $state, UserSelfService, 
SchemaService, RealmService,
-          ResourceService, SecurityQuestionService, GroupService, AnyService, 
UserUtil, GenericUtil, 
+          ResourceService, SecurityQuestionService, GroupService, AnyService, 
UserUtil, GenericUtil,
           ValidationExecutor, $translate, $filter) {
 
     $scope.user = {};
@@ -646,7 +646,8 @@ angular.module("self").controller("UserController", 
['$scope', '$rootScope', '$l
       $translate.use($scope.languages.selectedLanguage.code);
       $rootScope.endReached = false;
       var destination = params && params.successMessage
-              ? 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout?successMessage='
 + params.successMessage
+              ? 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout?successMessage='
 +
+              params.successMessage
               : 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout';
       window.location.href = destination;
     };
@@ -654,7 +655,8 @@ angular.module("self").controller("UserController", 
['$scope', '$rootScope', '$l
     $scope.success = function (params) {
       $rootScope.endReached = false;
       var destination = params && params.successMessage
-              ? 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage?successMessage='
 + params.successMessage
+              ? 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage?successMessage='
 +
+              params.successMessage
               : 
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage';
       window.location.href = destination;
     };

Reply via email to