File tree Expand file tree Collapse file tree 5 files changed +21
-11
lines changed
Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ function getResults() {
5050 if ( res . aps [ i ] . se == 1 ) tr += '<tr class="selected">' ;
5151 else tr += '<tr>' ;
5252 tr += '<td>' + res . aps [ i ] . c + '</td>' ;
53- tr += '<td>' + res . aps [ i ] . ss + '</td>' ;
53+ tr += '<td>' + escapeHTML ( res . aps [ i ] . ss ) + '</td>' ;
5454 tr += '<td>' + getEncryption ( res . aps [ i ] . e ) + '</td>' ;
5555 //tr += '<td>' + res.aps[i].r + ' <meter value="' + res.aps[i].r + '" max="-30" min="-100" low="-80" high="-60" optimum="-50"></meter></td>';
5656 var _width = res . aps [ i ] . r + 130 ;
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ function getResults() {
1818 var aps = "" ;
1919 var clients = "" ;
2020 var tr = "<tr><th>Attack</th><th>Status</th><th>Start/Stop</th></tr>" ;
21- for ( var i = 0 ; i < res . aps . length ; i ++ ) aps += "<li>" + res . aps [ i ] + "</li>" ;
22- for ( var i = 0 ; i < res . clients . length ; i ++ ) clients += "<li>" + res . clients [ i ] + "</li>" ;
21+ for ( var i = 0 ; i < res . aps . length ; i ++ ) aps += "<li>" + escapeHTML ( res . aps [ i ] ) + "</li>" ;
22+ for ( var i = 0 ; i < res . clients . length ; i ++ ) clients += "<li>" + escapeHTML ( res . clients [ i ] ) + "</li>" ;
2323
2424 selectedAPs . innerHTML = aps ;
2525 selectedClients . innerHTML = clients ;
@@ -48,7 +48,7 @@ function getResults() {
4848 var tr = "<tr><th>Name</th><th></th><th>Del.</th></tr>" ;
4949 for ( var i = 0 ; i < data . length ; i ++ ) {
5050 tr += "<tr>" ;
51- tr += "<td>" + data [ i ] [ 0 ] + "</td>" ;
51+ tr += "<td>" + escapeHTML ( data [ i ] [ 0 ] ) + "</td>" ;
5252 if ( data [ i ] [ 1 ] == 1 ) tr += "<td>🔒</td>" ;
5353 else tr += "<td></td>" ;
5454 tr += '<td><button class="button-warn" onclick="deleteSSID(' + i + ')">x</button></td>' ;
Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ function getE(name){
22 return document . getElementById ( name ) ;
33}
44
5+ function escapeHTML ( str ) {
6+ return str
7+ . replace ( / & / g, '&' )
8+ . replace ( / < / g, '<' )
9+ . replace ( / > / g, '>' )
10+ . replace ( / \" / g, '"' )
11+ . replace ( / \' / g, ''' )
12+ . replace ( / \/ / g, '/' )
13+ }
14+
515function showMessage ( msg , closeAfter ) {
616 var errorE = getE ( "error" ) ;
717 errorE . innerHTML = msg ;
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ function getResults() {
4242 if ( res . clients [ i ] . s == 1 ) tr += '<tr class="selected">' ;
4343 else tr += '<tr>' ;
4444 tr += '<td>' + res . clients [ i ] . p + '</td>' ;
45- if ( res . clients [ i ] . l >= 0 ) tr += '<td>' + res . clients [ i ] . n + ' <a onclick="editNameList(' + res . clients [ i ] . l + ')"></a></td>' ;
45+ if ( res . clients [ i ] . l >= 0 ) tr += '<td>' + escapeHTML ( res . clients [ i ] . n ) + ' <a onclick="editNameList(' + res . clients [ i ] . l + ')"></a></td>' ;
4646 else tr += '<td><a onclick="setName(' + res . clients [ i ] . i + ')">set</a></td>' ;
4747 if ( res . clients [ i ] . v . length > 1 ) tr += '<td>' + res . clients [ i ] . v + res . clients [ i ] . m . substring ( 8 , 20 ) + '</td>' ;
4848 else tr += '<td>' + res . clients [ i ] . m + '</td>' ;
49- tr += '<td>' + res . clients [ i ] . a + '</td>' ;
49+ tr += '<td>' + escapeHTML ( res . clients [ i ] . a ) + '</td>' ;
5050
5151 if ( res . clients [ i ] . s == 1 ) tr += '<td><button class="marginNull select" onclick="select(' + res . clients [ i ] . i + ')">deselect</button></td>' ;
5252 else tr += '<td><button class="marginNull select" onclick="select(' + res . clients [ i ] . i + ')">select</button></td>' ;
@@ -63,7 +63,7 @@ function getResults() {
6363
6464 tr += '<tr>' ;
6565 tr += '<td>' + res . nameList [ i ] . m + '</td>' ;
66- tr += '<td>' + res . nameList [ i ] . n + ' <a onclick="editNameList(' + i + ')">edit</a></td>' ;
66+ tr += '<td>' + escapeHTML ( res . nameList [ i ] . n ) + ' <a onclick="editNameList(' + i + ')">edit</a></td>' ;
6767 tr += '<td><button class="marginNull button-warn" onclick="deleteName(' + i + ')">x</button></td>' ;
6868 tr += '<td><button class="marginNull button-primary" onclick="add(' + i + ')">add</button></td>' ;
6969 tr += '</tr>' ;
You can’t perform that action at this time.
0 commit comments