@@ -172,14 +172,14 @@ require('../services/Synchronize');
172172 }
173173 } ) ;
174174 modalInstance . result . then ( function ( targetForeignSource ) {
175- bootbox . confirm ( 'This action will override the existing foreign source definition for the requisition named ' + targetForeignSource + ', using ' + foreignSource + ' as a template. Are you sure you want to continue ? This cannot be undone.' , function ( ok ) {
175+ bootbox . confirm ( 'This action will override the existing foreign source definition for the requisition named ' + _ . escape ( targetForeignSource ) + ', using ' + _ . escape ( foreignSource ) + ' as a template. Are you sure you want to continue ? This cannot be undone.' , function ( ok ) {
176176 if ( ! ok ) {
177177 return ;
178178 }
179179 RequisitionsService . startTiming ( ) ;
180180 RequisitionsService . cloneForeignSourceDefinition ( foreignSource , targetForeignSource ) . then (
181181 function ( ) { // success
182- growl . success ( 'The foreign source definition for ' + foreignSource + ' has been cloned to ' + targetForeignSource ) ;
182+ growl . success ( 'The foreign source definition for ' + _ . escape ( foreignSource ) + ' has been cloned to ' + _ . escape ( targetForeignSource ) ) ;
183183 } ,
184184 $scope . errorHandler
185185 ) ;
@@ -201,18 +201,18 @@ require('../services/Synchronize');
201201 if ( foreignSource ) {
202202 // Validate Requisition
203203 if ( foreignSource . match ( / [ / \\ ? : & * ' " ] / ) ) {
204- bootbox . alert ( 'Cannot add the requisition ' + foreignSource + ' because the following characters are invalid:<br/>:, /, \\, ?, &, *, \', "' ) ;
204+ bootbox . alert ( 'Cannot add the requisition ' + _ . escape ( foreignSource ) + ' because the following characters are invalid:<br/>:, /, \\, ?, &, *, \', "' ) ;
205205 return ;
206206 }
207207 var r = $scope . requisitionsData . getRequisition ( foreignSource ) ;
208208 if ( r ) {
209- bootbox . alert ( 'Cannot add the requisition ' + foreignSource + ' because there is already a requisition with that name' ) ;
209+ bootbox . alert ( 'Cannot add the requisition ' + _ . escape ( foreignSource ) + ' because there is already a requisition with that name' ) ;
210210 return ;
211211 }
212212 // Create Requisition
213213 RequisitionsService . addRequisition ( foreignSource ) . then (
214214 function ( r ) { // success
215- growl . success ( 'The requisition ' + r . foreignSource + ' has been created.' ) ;
215+ growl . success ( 'The requisition ' + _ . escape ( r . foreignSource ) + ' has been created.' ) ;
216216 } ,
217217 $scope . errorHandler
218218 ) ;
@@ -271,7 +271,7 @@ require('../services/Synchronize');
271271 RequisitionsService . startTiming ( ) ;
272272 RequisitionsService . updateDeployedStatsForRequisition ( requisition ) . then (
273273 function ( ) { // success
274- growl . success ( 'The deployed statistics for ' + requisition . foreignSource + ' has been updated.' ) ;
274+ growl . success ( 'The deployed statistics for ' + _ . escape ( requisition . foreignSource ) + ' has been updated.' ) ;
275275 } ,
276276 $scope . errorHandler
277277 ) ;
@@ -286,12 +286,12 @@ require('../services/Synchronize');
286286 * @param {string } foreignSource The name of the requisition
287287 */
288288 $scope . removeAllNodes = function ( foreignSource ) {
289- bootbox . confirm ( 'Are you sure you want to remove all the nodes from ' + foreignSource + '?' , function ( ok ) {
289+ bootbox . confirm ( 'Are you sure you want to remove all the nodes from ' + _ . escape ( foreignSource ) + '?' , function ( ok ) {
290290 if ( ok ) {
291291 RequisitionsService . startTiming ( ) ;
292292 RequisitionsService . removeAllNodesFromRequisition ( foreignSource ) . then (
293293 function ( ) { // success
294- growl . success ( 'All the nodes from ' + foreignSource + ' have been removed, and the requisition has been synchronized.' ) ;
294+ growl . success ( 'All the nodes from ' + _ . escape ( foreignSource ) + ' have been removed, and the requisition has been synchronized.' ) ;
295295 var req = $scope . requisitionsData . getRequisition ( foreignSource ) ;
296296 req . reset ( ) ;
297297 } ,
@@ -310,12 +310,12 @@ require('../services/Synchronize');
310310 * @param {string } foreignSource The name of the requisition
311311 */
312312 $scope . delete = function ( foreignSource ) {
313- bootbox . confirm ( 'Are you sure you want to remove the requisition ' + foreignSource + '?' , function ( ok ) {
313+ bootbox . confirm ( 'Are you sure you want to remove the requisition ' + _ . escape ( foreignSource ) + '?' , function ( ok ) {
314314 if ( ok ) {
315315 RequisitionsService . startTiming ( ) ;
316316 RequisitionsService . deleteRequisition ( foreignSource ) . then (
317317 function ( ) { // success
318- growl . success ( 'The requisition ' + foreignSource + ' has been deleted.' ) ;
318+ growl . success ( 'The requisition ' + _ . escape ( foreignSource ) + ' has been deleted.' ) ;
319319 } ,
320320 $scope . errorHandler
321321 ) ;
0 commit comments