File tree Expand file tree Collapse file tree
client/WEB-INF/classes/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ label.disk.iops.min=Min IOPS
2222label.disk.iops.max =Max IOPS
2323label.disk.iops.total =IOPS Total
2424label.view.secondary.ips =View secondary IPs
25+ message.validate.invalid.characters =Invalid characters found; please correct.
2526message.acquire.ip.nic =Please confirm that you would like to acquire a new secondary IP for this NIC.<br/>NOTE: You need to manually configure the newly-acquired secondary IP inside the virtual machine.
2627message.select.affinity.groups =Please select any affinity groups you want this VM to belong to:
2728message.no.affinity.groups =You do not have any affinity groups. Please continue to the next step.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ under the License.
2525<% long now = System . currentTimeMillis(); % >
2626<script language =" javascript" >
2727dictionary = {
28+ ' message.validate.invalid.characters' : ' <fmt:message key="message.validate.invalid.characters" />' ,
2829' label.about' : ' <fmt:message key="label.about" />' ,
2930' label.about.app' : ' <fmt:message key="label.about.app" />' ,
3031' label.app.name' : ' <fmt:message key="label.app.name" />' ,
Original file line number Diff line number Diff line change @@ -298,7 +298,7 @@ under the License.
298298 <div class =" field name hide-if-unselected" >
299299 <div class =" name" > <span class =" field-required" >*</span > <fmt:message key =" label.name" /></div >
300300 <div class =" value" >
301- <input type =" text" class =" required" name =" new-network-name" />
301+ <input type =" text" class =" required disallowSpecialCharacters " name =" new-network-name" />
302302 </div >
303303 </div >
304304
@@ -348,7 +348,7 @@ under the License.
348348 <span ><fmt:message key =" label.name" /> (<fmt:message key =" label.optional" />)</span >
349349 </div >
350350 <div class =" value" >
351- <input type =" text" name =" displayname" />
351+ <input type =" text" name =" displayname" class = " disallowSpecialCharacters " />
352352 </div >
353353 </div >
354354 <!-- Add to group -->
@@ -357,7 +357,7 @@ under the License.
357357 <span ><fmt:message key =" label.add.to.group" /> (<fmt:message key =" label.optional" />)</span >
358358 </div >
359359 <div class =" value" >
360- <input type =" text" name =" groupname" />
360+ <input type =" text" name =" groupname" class = " disallowSpecialCharacters " />
361361 </div >
362362 </div >
363363 <!-- Zone -->
Original file line number Diff line number Diff line change 588588 $ ( '<div>' ) . addClass ( 'value' ) . append (
589589 $ ( '<input>' ) . attr ( {
590590 type : 'text'
591- } ) . addClass ( 'required' )
591+ } ) . addClass ( 'required disallowSpecialCharacters ' )
592592 )
593593 ) ;
594594
Original file line number Diff line number Diff line change 588588 type : 'text' ,
589589 value : data
590590 } )
591- . data ( 'original-value' , data )
591+ . addClass ( 'disallowSpecialCharacters' ) . data ( 'original-value' , data )
592592 ) ;
593593
594594 // Make option values from given array
617617 name : name ,
618618 type : 'text' ,
619619 value : data
620- } ) . data ( 'original-value' , data )
620+ } ) . addClass ( 'disallowSpecialCharacters' ) . data ( 'original-value' , data )
621621 ) ;
622622 }
623623
Original file line number Diff line number Diff line change 529529 if ( ! $editInput . is ( ':visible' ) || ! ( typeof ( args . action ) == 'undefined' ) ) { //click Edit button
530530 showEditField ( ) ;
531531 } else if ( $editInput . val ( ) != $label . html ( ) ) { //click Save button with changed value
532+ if ( $editInput . val ( ) . match ( / < | > / ) ) {
533+ cloudStack . dialog . notice ( { message : 'message.validate.invalid.characters' } ) ;
534+ return false ;
535+ }
536+
532537 $edit . animate ( {
533538 opacity : 0.5
534539 } ) ;
Original file line number Diff line number Diff line change 918918
919919 $ ( field . range ) . each ( function ( ) { //e.g. field.range = ['privateport', 'privateendport'];
920920 var $input = $ ( '<input>' )
921+ . addClass ( 'disallowSpecialCharacters' )
921922 . attr ( {
922923 name : this ,
923924 type : 'text'
941942 name : fieldName ,
942943 type : field . isPassword ? 'password' : 'text'
943944 } )
944- . addClass ( ! field . isOptional ? 'required' : null )
945+ . addClass ( ! field . isOptional ? 'required' : null )
946+ . addClass ( 'disallowSpecialCharacters' )
945947 . attr ( 'disabled' , field . isDisabled ? 'disabled' : false )
946948 . appendTo ( $td ) ;
947949
You can’t perform that action at this time.
0 commit comments