File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 16451645 var jsonObj = args . context . instances [ 0 ] ;
16461646 args . response . success ( {
16471647 data : {
1648- totalCPU : _s ( jsonObj . cpunumber ) + " x " + cloudStack . converters . convertHz ( jsonObj . cpuspeed ) ,
1648+ totalCPU : jsonObj . cpunumber + " x " + cloudStack . converters . convertHz ( jsonObj . cpuspeed ) ,
16491649 cpuused : jsonObj . cpuused ,
16501650 networkkbsread : ( jsonObj . networkkbsread == null || jsonObj . networkkbsread == 0 ) ? "N/A" : cloudStack . converters . convertBytes ( jsonObj . networkkbsread * 1024 ) ,
16511651 networkkbswrite : ( jsonObj . networkkbswrite == null || jsonObj . networkkbswrite == 0 ) ? "N/A" : cloudStack . converters . convertBytes ( jsonObj . networkkbswrite * 1024 )
Original file line number Diff line number Diff line change 56955695 var jsonObj = args . context . hosts [ 0 ] ;
56965696 args . response . success ( {
56975697 data : {
5698- totalCPU : _s ( jsonObj . cpunumber ) + " x " + cloudStack . converters . convertHz ( jsonObj . cpuspeed ) ,
5698+ totalCPU : jsonObj . cpunumber + " x " + cloudStack . converters . convertHz ( jsonObj . cpuspeed ) ,
56995699 cpuused : jsonObj . cpuused ,
57005700 cpuallocated : ( jsonObj . cpuallocated == null || jsonObj . cpuallocated == 0 ) ? "N/A" : jsonObj . cpuallocated ,
57015701 memorytotal : ( jsonObj . memorytotal == null || jsonObj . memorytotal == 0 ) ? "N/A" : cloudStack . converters . convertBytes ( jsonObj . memorytotal * 1024 ) ,
Original file line number Diff line number Diff line change 6060 *
6161 * Strip unwanted characters from user-based input
6262 */
63- cloudStack . sanitize = window . _s = function ( str ) {
64- if ( ! str ) return '' ;
65-
66- var sanitized = str
63+ cloudStack . sanitize = window . _s = function ( value ) {
64+ if ( typeof ( value ) == "number" ) {
65+ //alert("number does not need to be sanitized. Only string needs to be sanitized.");
66+ return value ;
67+ }
68+ else if ( typeof ( value ) == "boolean" ) {
69+ //alert("boolean does not need to be sanitized. Only string needs to be sanitized.");
70+ return value ;
71+ }
72+ else if ( typeof ( value ) == "object" ) {
73+ //alert("object cant not be sanitized. Only string can be sanitized.");
74+ return value ;
75+ }
76+ else if ( typeof ( value ) == null || typeof ( value ) == "undefined" ) {
77+ return '' ;
78+ }
79+
80+ var sanitized = value
6781 . replace ( / & / g, "&" )
6882 . replace ( / < / g, "<" )
6983 . replace ( / > / g, ">" ) ;
You can’t perform that action at this time.
0 commit comments