|
15 | 15 | $error_log_filesize = false;
|
16 | 16 |
|
17 | 17 | $args = array(
|
18 |
| - 'enable_purge' => FILTER_SANITIZE_STRING, |
19 |
| - 'enable_stamp' => FILTER_SANITIZE_STRING, |
20 |
| - 'purge_method' => FILTER_SANITIZE_STRING, |
21 |
| - 'is_submit' => FILTER_SANITIZE_STRING, |
22 |
| - 'redis_hostname' => FILTER_SANITIZE_STRING, |
23 |
| - 'redis_port' => FILTER_SANITIZE_STRING, |
24 |
| - 'redis_prefix' => FILTER_SANITIZE_STRING, |
25 |
| - 'purge_homepage_on_edit' => FILTER_SANITIZE_STRING, |
26 |
| - 'purge_homepage_on_del' => FILTER_SANITIZE_STRING, |
27 |
| - 'purge_url' => FILTER_SANITIZE_STRING, |
28 |
| - 'log_level' => FILTER_SANITIZE_STRING, |
29 |
| - 'log_filesize' => FILTER_SANITIZE_STRING, |
30 |
| - 'smart_http_expire_save' => FILTER_SANITIZE_STRING, |
31 |
| - 'cache_method' => FILTER_SANITIZE_STRING, |
32 |
| - 'enable_map' => FILTER_SANITIZE_STRING, |
33 |
| - 'enable_log' => FILTER_SANITIZE_STRING, |
34 |
| - 'purge_archive_on_edit' => FILTER_SANITIZE_STRING, |
35 |
| - 'purge_archive_on_del' => FILTER_SANITIZE_STRING, |
36 |
| - 'purge_archive_on_new_comment' => FILTER_SANITIZE_STRING, |
37 |
| - 'purge_archive_on_deleted_comment' => FILTER_SANITIZE_STRING, |
38 |
| - 'purge_page_on_mod' => FILTER_SANITIZE_STRING, |
39 |
| - 'purge_page_on_new_comment' => FILTER_SANITIZE_STRING, |
40 |
| - 'purge_page_on_deleted_comment' => FILTER_SANITIZE_STRING, |
41 |
| - 'smart_http_expire_form_nonce' => FILTER_SANITIZE_STRING, |
| 18 | + 'enable_purge', |
| 19 | + 'enable_stamp', |
| 20 | + 'purge_method', |
| 21 | + 'is_submit', |
| 22 | + 'redis_hostname', |
| 23 | + 'redis_port', |
| 24 | + 'redis_prefix', |
| 25 | + 'purge_homepage_on_edit', |
| 26 | + 'purge_homepage_on_del', |
| 27 | + 'purge_url', |
| 28 | + 'log_level', |
| 29 | + 'log_filesize', |
| 30 | + 'smart_http_expire_save', |
| 31 | + 'cache_method', |
| 32 | + 'enable_map', |
| 33 | + 'enable_log', |
| 34 | + 'purge_archive_on_edit', |
| 35 | + 'purge_archive_on_del', |
| 36 | + 'purge_archive_on_new_comment', |
| 37 | + 'purge_archive_on_deleted_comment', |
| 38 | + 'purge_page_on_mod', |
| 39 | + 'purge_page_on_new_comment', |
| 40 | + 'purge_page_on_deleted_comment', |
| 41 | + 'smart_http_expire_form_nonce', |
42 | 42 | );
|
43 | 43 |
|
44 |
| -$all_inputs = filter_input_array( INPUT_POST, $args ); |
| 44 | +$all_inputs = array(); |
| 45 | + |
| 46 | +foreach ( $args as $val ) { |
| 47 | + if ( isset( $_POST[ $val ] ) ) { |
| 48 | + $all_inputs[ $val ] = wp_strip_all_tags( $_POST[ $val ] ); |
| 49 | + } |
| 50 | +} |
45 | 51 |
|
46 | 52 | if ( isset( $all_inputs['smart_http_expire_save'] ) && wp_verify_nonce( $all_inputs['smart_http_expire_form_nonce'], 'smart-http-expire-form-nonce' ) ) {
|
47 | 53 | unset( $all_inputs['smart_http_expire_save'] );
|
|
720 | 726 | </table>
|
721 | 727 | </div> <!-- End of .inside -->
|
722 | 728 | </div>
|
723 |
| - <input type="hidden" name="smart_http_expire_form_nonce" value="<?php echo wp_create_nonce('smart-http-expire-form-nonce'); ?>"/> |
| 729 | + <input type="hidden" name="smart_http_expire_form_nonce" value="<?php echo esc_attr( wp_create_nonce( 'smart-http-expire-form-nonce' ) ); ?>" /> |
724 | 730 | <?php
|
725 | 731 | submit_button( __( 'Save All Changes', 'nginx-helper' ), 'primary large', 'smart_http_expire_save', true );
|
726 | 732 | ?>
|
|
0 commit comments