@@ -573,7 +573,7 @@ function form_actions() {
573573 <input type='hidden' name='action' value='actions'>
574574 <input type='hidden' name='save_list' value='1'>
575575 <input type='hidden' name='selected_items' value=' " . (isset ($ array ) ? serialize ($ array ) : '' ) . "'>
576- <input type='hidden' name='drp_action' value=' " . get_request_var ('drp_action ' ) . "'>
576+ <input type='hidden' name='drp_action' value=' " . html_escape ( get_request_var ('drp_action ' ) ) . "'>
577577 $ save_html
578578 </td>
579579 </tr> " ;
@@ -648,10 +648,10 @@ function form_actions() {
648648 print " <tr>
649649 <td class='saveRow'>
650650 <input type='hidden' name='action' value='actions'>
651- <input type='hidden' name='id' value=' " . get_request_var ('id ' ) . "'>
651+ <input type='hidden' name='id' value=' " . html_escape ( get_request_var ('id ' ) ) . "'>
652652 <input type='hidden' name='save_templates' value='1'>
653653 <input type='hidden' name='selected_items' value=' " . (isset ($ array ) ? serialize ($ array ) : '' ) . "'>
654- <input type='hidden' name='drp_action' value=' " . get_request_var ('drp_action ' ) . "'>
654+ <input type='hidden' name='drp_action' value=' " . html_escape ( get_request_var ('drp_action ' ) ) . "'>
655655 $ save_html
656656 </td>
657657 </tr> " ;
@@ -726,10 +726,10 @@ function form_actions() {
726726 print " <tr>
727727 <td class='saveRow'>
728728 <input type='hidden' name='action' value='actions'>
729- <input type='hidden' name='id' value=' " . get_request_var ('id ' ) . "'>
729+ <input type='hidden' name='id' value=' " . html_escape ( get_request_var ('id ' ) ) . "'>
730730 <input type='hidden' name='save_tholds' value='1'>
731731 <input type='hidden' name='selected_items' value=' " . (isset ($ array ) ? serialize ($ array ) : '' ) . "'>
732- <input type='hidden' name='drp_action' value=' " . get_request_var ('drp_action ' ) . "'>
732+ <input type='hidden' name='drp_action' value=' " . html_escape ( get_request_var ('drp_action ' ) ) . "'>
733733 $ save_html
734734 </td>
735735 </tr> " ;
@@ -811,10 +811,10 @@ function form_actions() {
811811 print "<tr>
812812 <td class='saveRow'>
813813 <input type='hidden' name='action' value='actions'>
814- <input type='hidden' name='id' value=' " . get_request_var ('id ' ) . "'>
814+ <input type='hidden' name='id' value=' " . html_escape ( get_request_var ('id ' ) ) . "'>
815815 <input type='hidden' name='save_associate' value='1'>
816816 <input type='hidden' name='selected_items' value=' " . (isset ($ array ) ? serialize ($ array ) : '' ) . "'>
817- <input type='hidden' name='drp_action' value=' " . get_request_var ('drp_action ' ) . "'>
817+ <input type='hidden' name='drp_action' value=' " . html_escape ( get_request_var ('drp_action ' ) ) . "'>
818818 $ save_html
819819 </td>
820820 </tr> " ;
@@ -1121,7 +1121,7 @@ function hosts($header_label) {
11211121 <script type='text/javascript'>
11221122
11231123 function applyFilter() {
1124- strURL = '?header=false&action=edit&id=<?php print get_request_var ('id ' ); ?> '
1124+ strURL = '?header=false&action=edit&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> '
11251125 strURL += '&rows=' + $('#rows').val();
11261126 strURL += '&host_template_id=' + $('#host_template_id').val();
11271127 strURL += '&site_id=' + $('#site_id').val();
@@ -1131,12 +1131,12 @@ function applyFilter() {
11311131 }
11321132
11331133 function clearFilter() {
1134- strURL = 'notify_lists.php?header=false&action=edit&id=<?php print get_request_var ('id ' ); ?> &clear=true'
1134+ strURL = 'notify_lists.php?header=false&action=edit&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> &clear=true'
11351135 loadPageNoHeader(strURL);
11361136 }
11371137
11381138 $(function() {
1139- $('#form_devices').submit( function(event) {
1139+ $('#form_devices').on('submit', function(event) {
11401140 event.preventDefault();
11411141 applyFilter();
11421142 });
@@ -1224,7 +1224,7 @@ function clearFilter() {
12241224
12251225 $ hosts = db_fetch_assoc_prepared ($ sql_query , $ sql_params );
12261226
1227- $ nav = html_nav_bar ('notify_lists.php?action=edit&id= ' . get_request_var ('id ' ), MAX_DISPLAY_PAGES , get_request_var ('page ' ), $ rows , $ total_rows , 10 , __ ('Devices ' , 'thold ' ), 'page ' , 'main ' );
1227+ $ nav = html_nav_bar ('notify_lists.php?action=edit&id= ' . ( int ) get_request_var ('id ' ), MAX_DISPLAY_PAGES , get_request_var ('page ' ), $ rows , $ total_rows , 10 , __ ('Devices ' , 'thold ' ), 'page ' , 'main ' );
12281228
12291229 form_start ('notify_lists.php ' , 'chk ' );
12301230
@@ -1370,15 +1370,15 @@ function tholds($header_label) {
13701370 $ limit = ($ rows * (intval (get_request_var ('page ' )) - 1 )) . ", $ rows " ;
13711371
13721372 if (!isempty_request_var ('template ' ) && get_request_var ('template ' ) != '-1 ' ) {
1373- $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . 'td.data_template_id = ' . get_request_var ('template ' );
1373+ $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . 'td.data_template_id = ' . ( int ) get_request_var ('template ' );
13741374 }
13751375
13761376 if (get_request_var ('site_id ' ) == '-1 ' ) {
13771377 // Show all items
13781378 } elseif (get_request_var ('site_id ' ) == '0 ' ) {
13791379 $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . ' h.site_id=0 ' ;
13801380 } elseif (!isempty_request_var ('site_id ' )) {
1381- $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . ' h.site_id= ' . get_request_var ('site_id ' );
1381+ $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . ' h.site_id= ' . ( int ) get_request_var ('site_id ' );
13821382 }
13831383
13841384 if (strlen (get_request_var ('rfilter ' ))) {
@@ -1390,7 +1390,7 @@ function tholds($header_label) {
13901390 }
13911391
13921392 if (get_request_var ('associated ' ) == 'true ' ) {
1393- $ sql_where .= (!strlen ($ sql_where ) ? '' : ' AND ' ) . '(td.notify_warning= ' . get_request_var ('id ' ) . ' OR td.notify_alert= ' . get_request_var ('id ' ) . ') ' ;
1393+ $ sql_where .= (!strlen ($ sql_where ) ? '' : ' AND ' ) . '(td.notify_warning= ' . ( int ) get_request_var ('id ' ) . ' OR td.notify_alert= ' . ( int ) get_request_var ('id ' ) . ') ' ;
13941394 }
13951395
13961396 $ result = get_allowed_thresholds ($ sql_where , $ sort , $ limit , $ total_rows );
@@ -1490,7 +1490,7 @@ function tholds($header_label) {
14901490 <script type='text/javascript'>
14911491
14921492 function applyFilter() {
1493- strURL = 'notify_lists.php?header=false&action=edit&tab=tholds&id=<?php print get_request_var ('id ' ); ?> '
1493+ strURL = 'notify_lists.php?header=false&action=edit&tab=tholds&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> '
14941494 strURL += '&associated=' + $('#associated').is(':checked');
14951495 strURL += '&state=' + $('#state').val();
14961496 strURL += '&site_id=' + $('#site_id').val();
@@ -1501,12 +1501,12 @@ function applyFilter() {
15011501 }
15021502
15031503 function clearFilter() {
1504- strURL = 'notify_lists.php?header=false&action=edit&tab=tholds&id=<?php print get_request_var ('id ' ); ?> &clear=true'
1504+ strURL = 'notify_lists.php?header=false&action=edit&tab=tholds&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> &clear=true'
15051505 loadPageNoHeader(strURL);
15061506 }
15071507
15081508 $(function() {
1509- $('#listthold').submit( function(event) {
1509+ $('#listthold').on('submit', function(event) {
15101510 event.preventDefault();
15111511 applyFilter();
15121512 });
@@ -1781,20 +1781,20 @@ function templates($header_label) {
17811781 <script type='text/javascript'>
17821782
17831783 function applyFilter() {
1784- strURL = 'notify_lists.php?header=false&action=edit&tab=templates&id=<?php print get_request_var ('id ' ); ?> '
1784+ strURL = 'notify_lists.php?header=false&action=edit&tab=templates&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> '
17851785 strURL += '&associated=' + $('#associated').is(':checked');
17861786 strURL += '&rows=' + $('#rows').val();
17871787 strURL += '&rfilter=' + base64_encode($('#rfilter').val());
17881788 loadPageNoHeader(strURL);
17891789 }
17901790
17911791 function clearFilter() {
1792- strURL = 'notify_lists.php?header=false&action=edit&tab=templates&id=<?php print get_request_var ('id ' ); ?> &clear=true'
1792+ strURL = 'notify_lists.php?header=false&action=edit&tab=templates&id=<?php print ( int ) get_filter_request_var ('id ' ); ?> &clear=true'
17931793 loadPageNoHeader(strURL);
17941794 }
17951795
17961796 $(function() {
1797- $('#listthold').submit( function(event) {
1797+ $('#listthold').on('submit', function(event) {
17981798 event.preventDefault();
17991799 applyFilter();
18001800 });
@@ -2113,7 +2113,7 @@ function clearFilter() {
21132113 }
21142114
21152115 $(function() {
2116- $('#lists').submit( function(event) {
2116+ $('#lists').on('submit', function(event) {
21172117 event.preventDefault();
21182118 applyFilter();
21192119 });
0 commit comments