C:\xampp\htdocs\landing\wp-content\plugins\better-wp-security\core\lib\form.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
<?php

use iThemesSecurity\User_Groups\Matchables_Source;

final class 
ITSEC_Form {
    private 
$options = array();
    private 
$tracked_booleans = array();
    private 
$tracked_strings = array();
    private 
$tracked_arrays = array();
    private 
$input_group '';
    private 
$input_group_stack = array();

    public function 
__construct$options = array() ) {
        
$this->options =& $options;
    }

    public static function 
get_post_data$desired_inputs false ) {
        
$remove_vars = array( 'itsec-nonce''_wp_http_referer' );
        
$data $_POST;

        foreach ( 
$remove_vars as $var ) {
            unset( 
$_POST[$var] );
        }

        
$data stripslashes_deep$data );

        if ( isset( 
$data['data'] ) && isset( $data['data']['--itsec-form-serialized-data'] ) ) {
            
parse_str$data['data']['--itsec-form-serialized-data'], $data );
        }

        
$defaults = array(
            
'booleans' => false,
            
'strings'  => '',
            
'arrays'   => array(),
        );

        foreach ( 
$defaults as $name => $default ) {
            if ( ! isset( 
$data["--itsec-form-tracked-$name"] ) || ! is_array$data["--itsec-form-tracked-$name"] ) ) {
                continue;
            }

            foreach ( 
$data["--itsec-form-tracked-$name"] as $index ) {
                
$value ITSEC_Form::get_array_value$data$index );

                if ( 
false === $default ) {
                    
$value = ( $value ) ? true false;
                    
ITSEC_Form::add_array_value$data$index$value );
                } else if ( 
'' === $default ) {
                    if ( 
is_null$value ) ) {
                        
ITSEC_Form::add_array_value$data$index$default );
                    }
                } else if ( ! 
is_array$value ) ) {
                    
ITSEC_Form::add_array_value$data$index$default );
                }
            }

            unset( 
$data["--itsec-form-tracked-$name"] );
        }

        if ( isset( 
$data['--itsec-form-convert-to-array'] ) && is_array$data['--itsec-form-convert-to-array'] ) ) {
            foreach ( 
$data['--itsec-form-convert-to-array'] as $index ) {
                
$value ITSEC_Form::get_array_value$data$index );

                if ( 
is_array$value ) ) {
                    continue;
                } else if ( ! 
is_string$value ) ) {
                    
ITSEC_Form::add_array_value$data$index, array() );
                }

                
$lines preg_split"/[\r\n]+/"$value );

                foreach ( 
$lines as $key => $val ) {
                    
$val trim$val );

                    if ( empty( 
$val ) ) {
                        unset( 
$lines[$key] );
                    } else {
                        
$lines[$key] = $val;
                    }
                }

                
ITSEC_Form::add_array_value$data$index$lines );
            }

            unset( 
$data['--itsec-form-convert-to-array'] );
        }

        if ( 
is_array$desired_inputs ) ) {
            foreach ( 
array_keys$data ) as $key ) {
                if ( ! 
in_array$key$desired_inputs ) ) {
                    unset( 
$data[$key] );
                }
            }
        }

        return 
$data;
    }

    public static function 
parse_values$values = array(), $args = array() ) {
        
$new_values = array();

        foreach ( (array) 
$values as $var => $val ) {
            
$new_values[$var] = $val;
        }

        return 
$new_values;
    }

    public function 
start_form$options = array() ) {
        if ( isset( 
$_REQUEST['page'] ) ) {
            list ( 
$location$query ) = explode'?'$_SERVER['REQUEST_URI'] );
            
$file basename$location );

            if ( 
'admin.php' == $file ) {
                
$default_action "$location?page={$_REQUEST['page']}";
            } else if ( ( 
'edit.php' == $file ) && isset( $_REQUEST['post_type'] ) ) {
                
$default_action "$location?post_type={$_REQUEST['post_type']}&page={$_REQUEST['page']}";
            }
        }

        if ( ! isset( 
$default_action ) ) {
            
$default_action $_SERVER['REQUEST_URI'];
        }


        
$defaults = array(
            
'enctype' => 'multipart/form-data',
            
'method'  => 'post',
            
'action'  => $default_action,
        );

        if ( 
is_string$options ) ) {
            
$options = array(
                
'id' => $options,
            );
        } else if ( ! 
is_array$options ) ) {
            
$options = array();
        }

        
$options array_merge$defaults$options );

        echo 
'<form';

        foreach ( (array) 
$options as $var => $val ) {
            if ( ! 
is_array$val ) ) {
                
$val str_replace'"''&quot;'$val );
                echo 
$var=\"$val\"";
            }
        }

        echo 
">\n";
    }

    public function 
end_form() {
        echo 
"</form>\n";

        
$this->new_form();
    }

    public function 
set_input_group() {
        
$this->remove_all_input_groups();

        
$args func_get_args();

        
call_user_func_array( array( &$this'add_input_group' ), $args );
    }

    public function 
add_input_group() {
        
$args func_get_args();

        
$this->input_group '';

        if ( 
is_array$args[0] ) ) {
            
$args $args[0];
        }

        if ( ( 
=== count$args ) ) && ! is_string$args[0] ) && ! is_numeric$args[0] ) ) {
            
$args = array();
        }

        
$this->input_group_stack array_merge$this->input_group_stack$args );

        
$this->generate_input_group();
    }

    public function 
remove_input_group() {
        
array_pop$this->input_group_stack );
        
$this->generate_input_group();
    }

    public function 
remove_all_input_groups() {
        
$this->input_group_stack = array();
        
$this->generate_input_group();
    }

    public function 
push_input_groups() {
        if ( ! isset( 
$this->input_group_stack_cache ) || ! is_array$this->input_group_stack_cache ) ) {
            
$this->input_group_stack_cache = array();
        }

        
array_push$this->input_group_stack_cache$this->input_group_stack );
    }

    public function 
pop_input_groups() {
        if ( ! 
is_array$this->input_group_stack_cache ) || empty( $this->input_group_stack_cache ) ) {
            return;
        }

        
$this->input_group_stack array_pop$this->input_group_stack_cache );

        
$this->generate_input_group();
    }

    private function 
generate_input_group() {
        
$args $this->input_group_stack;

        
$this->input_group '';

        if ( ! empty( 
$args ) ) {
            
$this->input_group $args[0];

            for ( 
$x 1$x count$args ); $x++ ) {
                if ( ! 
is_array$args[$x] ) && ! is_object$args[$x] ) ) {
                    
$this->input_group .= '[' . ( (string) $args[$x] ) . ']';
                }
            }
        }
    }

    public function 
get_option$name ) {
        if ( ! empty( 
$this->input_group ) ) {
            if ( 
false === strpos$name'[' ) ) {
                
$name "[$name]";
            } else {
                
$name preg_replace'/^([^\[]+)\[/''[$1]['$name );
            }

            
$name "{$this->input_group}$name";
        }

        return 
ITSEC_Form::get_array_value$this->options$name );
    }

    public function 
get_options() {
        if ( ! empty( 
$this->input_group ) ) {
            return 
ITSEC_Form::get_array_value$this->options$this->input_group );
        }

        return 
$this->options;
    }

    public function 
get_all_options() {
        return 
$this->options;
    }

    public function 
set_option$name$value ) {
        if ( ! empty( 
$this->input_group ) ) {
            if ( 
false === strpos$name'[' ) ) {
                
$name "[$name]";
            } else {
                
$name preg_replace'/^([^\[]+)\[/''[$1]['$name );
            }

            
$name "{$this->input_group}$name";
        }

        
ITSEC_Form::add_array_value$this->options$name$value );
    }

    public function 
set_options$values ) {
        foreach ( 
$values as $name => $value ) {
            
$this->set_option$name$value );
        }
    }

    public function 
set_default$name$value ) {
        if ( 
is_null$this->get_option$name ) ) ) {
            
$this->set_option$name$value );
        }
    }

    public function 
set_defaults$values ) {
        foreach ( 
$values as $name => $value ) {
            
$this->set_default$name$value );
        }
    }

    public function 
clear_options() {
        
$this->options = array();
    }

    public function 
push_options() {
        if ( ! isset( 
$this->options_cache ) || ! is_array$this->options_cache ) ) {
            
$this->options_cache = array();
        }

        
array_push$this->options_cache$this->options );
    }

    public function 
pop_options() {
        if ( ! 
is_array$this->options_cache ) || empty( $this->options_cache ) ) {
            return;
        }

        
$this->options array_pop$this->options_cache );
    }

    public static function 
add_nonce$name null ) {
        
wp_nonce_field$name'itsec-nonce' );
    }

    public static function 
check_nonce$name null ) {
        
check_admin_referer$name'itsec-nonce' );
    }

    public function 
new_form() {
        
$this->input_group '';
        
$this->input_group_stack = array();
    }

    public function 
add_submit$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'submit';
        
$options['class'] = ( empty( $options['class'] ) ) ? 'button-primary' $options['class'];

        
$this->add_custom_input$var$options );
    }

    public function 
add_button$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'button';

        
$this->add_custom_input$var$options );
    }

    public function 
add_text$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'text';

        
$this->add_custom_input$var$options );
    }

    public function 
add_html5_input$var$type$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = $type;

        
$this->add_custom_input$var$options );
    }

    public function 
add_textarea$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'textarea';

        
$this->add_custom_input$var$options );
    }

    public function 
add_password$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'password';

        
$this->add_custom_input$var$options );
    }

    public function 
add_file$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'file';

        
$this->add_custom_input$var$options );
    }

    public function 
add_checkbox$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'checkbox';

        if ( empty( 
$options['value'] ) ) {
            
$options['value'] = '1';
        }

        
$this->add_custom_input$var$options );
    }

    public function 
add_multi_checkbox$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'checkbox';
        
$options['append_val_to_id'] = true;
        
$var $var '[]';

        
$this->add_custom_input$var$options );
    }

    public function 
add_radio$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'radio';
        
$options['append_val_to_id'] = true;

        
$this->add_custom_input$var$options );
    }

    public function 
add_select$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array();
        } else if ( ! isset( 
$options['value'] ) || ! is_array$options['value'] ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'select';

        
$this->add_custom_input$var$options );
    }

    public function 
add_multi_select$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array();
        } else if ( ! isset( 
$options['value'] ) || ! is_array$options['value'] ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'select';
        
$options['multiple'] = 'multiple';
        
$var $var '[]';

        
$this->add_custom_input$var$options );
    }

    public function 
add_number$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'number';

        
$this->add_custom_input$var$options );
    }

    public function 
add_hidden$var$options = array() ) {
        if ( ! 
is_array$options ) ) {
            
$options = array( 'value' => $options );
        }

        
$options['type'] = 'hidden';

        
$this->add_custom_input$var$options );
    }

    public function 
add_canonical_roles$var$options = array() ) {
        
$roles = array(
            
'administrator' => translate_user_role'Administrator' ),
            
'editor'        => translate_user_role'Editor' ),
            
'author'        => translate_user_role'Author' ),
            
'contributor'   => translate_user_role'Contributor' ),
            
'subscriber'    => translate_user_role'Subscriber' ),
        );

        if ( isset( 
$options['value'] ) ) {
            
$options['value'] = wp_parse_args$options['value'], $roles );
        } else {
            
$options['value'] = $roles;
        }

        
$this->add_select$var$options );
    }

    public function 
add_user_group$var$options = array() ) {
        
$source  ITSEC_Modules::get_container()->getMatchables_Source::class );

        
$user_groups = [];
        foreach ( 
$source->all() as $matchable ) {
            
$user_groups$matchable->get_id() ] = $matchable->get_label();
        }

        if ( isset( 
$options['value'] ) ) {
            
$options['value'] = wp_parse_args$options['value'], $user_groups );
        } else {
            
$options['value'] = $user_groups;
        }

        
$this->add_select$var$options );
    }

    public function 
add_user_groups$var$module$setting ''$options = array() ) {
        
$source  ITSEC_Modules::get_container()->getMatchables_Source::class );

        
$user_groups = [];
        foreach ( 
$source->all() as $matchable ) {
            
$user_groups$matchable->get_id() ] = $matchable->get_label();
        }

        if ( isset( 
$options['value'] ) ) {
            
$options['value'] = wp_parse_args$options['value'], $user_groups );
        } else {
            
$options['value'] = $user_groups;
        }

        
$options['data-module'] = $module;
        
$options['data-setting'] = $setting ?: $var;

        
$options['class'] = 'itsec-form-input--type-user-groups';

        
$this->add_multi_select$var$options );
        
wp_enqueue_script'itsec-form-user-groups' );
        
wp_enqueue_style'itsec-jquery-multi-select' );
    }

    public function 
get_dotted_var$var ) {
        
$dot   $this->input_group_stack;
        
$dot[] = $var;

        return 
implode'.'$dot );
    }

    public function 
get_clean_var$var ) {
        
$clean_var trimpreg_replace'/[^a-z0-9_]+/i''-'$var ), '-' );

        if ( ! empty( 
$this->input_group ) ) {
            if ( 
false === strpos$var'[' ) ) {
                
$var "[{$var}]";
            } else {
                
$var preg_replace'/^([^\[]+)\[/''[$1]['$var );
            }

            
$var "{$this->input_group}{$var}";

            
$clean_var trimpreg_replace'/[^a-z0-9_]+/i''-'$var ), '-' );
        }

        return 
"itsec-$clean_var";
    }

    private function 
add_custom_input$var$options ) {
        if ( empty( 
$options['type'] ) ) {
            
trigger_error'add_custom_input called without a type option set' );
        }

        
$scrub_list['textarea']['value'] = true;
        
$scrub_list['file']['value'] = true;
        
$scrub_list['select']['value'] = true;
        
$scrub_list['select']['type'] = true;

        
$defaults = array(
            
'name' => $var,
        );

        
$input_group_name $defaults['name'];

        
$var str_replace'[]'''$var );

        
$clean_var trimpreg_replace'/[^a-z0-9_]+/i''-'$var ), '-' );

        if ( ! empty( 
$this->input_group ) ) {
            if ( 
false === strpos$defaults['name'], '[' ) ) {
                
$defaults['name'] = "[{$defaults['name']}]";
            } else {
                
$defaults['name'] = preg_replace'/^([^\[]+)\[/''[$1]['$defaults['name'] );
            }

            
$input_group_name $defaults['name'];

            
$defaults['name'] = "{$this->input_group}{$defaults['name']}";

            
$clean_var trimpreg_replace'/[^a-z0-9_]+/i''-'$defaults['name'] ), '-' );
        }

        
$val $this->get_option$var );

        
$defaults['id'] = "itsec-$clean_var";

        if ( ! empty( 
$options['append_val_to_id'] ) && ( true === $options['append_val_to_id'] ) && ! empty( $options['value'] ) ) {
            unset( 
$options['append_val_to_id'] );
            
$defaults['id'] .= '-' trimpreg_replace'/[^a-z0-9_]+/i''-'$options['value'] ), '-' );
        }

        
$options ITSEC_Form::merge_defaults$options$defaults );

        if ( ! 
is_null$val ) ) {
            if ( 
in_array$options['type'], array( 'checkbox''radio' ) ) ) {
                if ( ( 
is_array$val ) && in_array$options['value'], $val ) ) || ( ! is_array$val ) && ( (string) $val === (string) $options['value'] ) ) ) {
                    
$options['checked'] = 'checked';
                }
            } else if ( 
'select' !== $options['type'] ) {
                
$options['value'] = $val;
            }
        }


        
$attributes '';

        if ( 
false !== $options ) {
            foreach ( (array) 
$options as $name => $content ) {
                if ( ! 
is_array$content ) && ( ! isset( $scrub_list[$options['type']][$name] ) || ( true !== $scrub_list[$options['type']][$name] ) ) ) {
                    if ( 
'value' == $name ) {
                        
$content ITSEC_Form::esc_value_attr$content );
                    } else if ( ! 
in_array$options['type'], array( 'submit''button' ) ) ) {
                        
$content esc_attr$content );
                    }

                    
$attributes .= "$name=\"$content\" ";
                }
            }
        }


        if ( 
'textarea' === $options['type'] ) {
            if ( ! isset( 
$options['value'] ) ) {
                
$options['value'] = '';
            } else if ( 
is_array$options['value'] ) ) {
                
$options['value'] = implode"\n"$options['value'] );
                echo 
'<input type="hidden" name="--itsec-form-convert-to-array[]" value="' esc_attr$options['name'] ) . '" />' "\n";
            }

            echo 
"<textarea $attributes >" ITSEC_Form::esc_value_attr$options['value'] ) . '</textarea>';
        } else if ( 
'select' === $options['type'] ) {
            echo 
"<select $attributes>\n";

            if ( isset( 
$options['value'] ) && is_array$options['value'] ) ) {
                foreach ( (array) 
$options['value'] as $content => $name ) {
                    if ( 
is_array$name ) ) {
                        if ( 
preg_match'/^__optgroup_\d+$/'$content ) ) {
                            echo 
"<optgroup class='it-classes-optgroup-separator'>\n";
                        } else {
                            echo 
"<optgroup label='" esc_attr$content ) . "'>\n";
                        }

                        foreach ( (array) 
$name as $content => $sub_name ) {
                            if ( 
is_array$val ) ) {
                                
$selected '';

                                foreach ( 
$val as $set_val ) {
                                    if ( (string) 
$set_val === (string) $content ) {
                                        
$selected ' selected="selected"';
                                    }
                                }
                            } else {
                                
$selected = ( ! is_null$val ) && ( (string) $val === (string) $content ) ) ? ' selected="selected"' '';
                            }

                            echo 
"<option value=\"" ITSEC_Form::esc_value_attr$content ) . "\"$selected>$sub_name</option>\n";
                        }

                        echo 
"</optgroup>\n";
                    } else {
                        if ( 
is_array$val ) ) {
                            
$selected '';

                            foreach ( 
$val as $set_val ) {
                                if ( (string) 
$set_val === (string) $content ) {
                                    
$selected ' selected="selected"';
                                }
                            }
                        } else {
                            
$selected = ( ! is_null$val ) && ( (string) $val === (string) $content ) ) ? ' selected="selected"' '';
                        }

                        echo 
"<option value=\"" ITSEC_Form::esc_value_attr$content ) . "\"$selected>$name</option>\n";
                    }
                }
            }

            echo 
"</select>\n";
        } else {
            echo 
'<input ' $attributes '/>' "\n";
        }


        if ( 
'[]' === substr$options['name'], -) ) {
            if ( ! isset( 
$this->tracked_arrays[$options['name']] ) ) {
                echo 
'<input type="hidden" name="--itsec-form-tracked-arrays[]" value="' esc_attrsubstr$options['name'], 0, -) ) . '" />' "\n";
                
$this->tracked_arrays[$options['name']] = true;
            }
        } else if ( 
'checkbox' === $options['type'] ) {
            if ( ! isset( 
$this->tracked_booleans[$options['name']] ) ) {
                echo 
'<input type="hidden" name="--itsec-form-tracked-booleans[]" value="' esc_attr$options['name'] ) . '" />' "\n";
                
$this->tracked_booleans[$options['name']] = true;
            }
        } else if ( 
'radio' === $options['type'] ) {
            if ( ! isset( 
$this->tracked_strings[$options['name']] ) ) {
                echo 
'<input type="hidden" name="--itsec-form-tracked-strings[]" value="' esc_attr$options['name'] ) . '" />' "\n";
                
$this->tracked_strings[$options['name']] = true;
            }
        }
    }

    private static function 
esc_value_attr$text ) {
        
$text wp_check_invalid_utf8$text );
        
$text htmlspecialcharshtmlspecialchars_decodehtmlspecialchars_decode$text ) ), ENT_QUOTES );

        return 
$text;
    }

    private static function 
get_array_value$array$index ) {
        if ( 
is_string$index ) ) {
            if ( 
false === strpos$index'[' ) ) {
                
$index = array( $index );
            } else {
                
$index rtrim$index'[]' );
                
$index preg_split'/[\[\]]+/'$index );
            }
        }

        while ( 
count$index ) > ) {
            if ( isset( 
$array[$index[0]] ) ) {
                
$array $array[$index[0]];
                
array_shift$index );
            } else {
                return 
null;
            }
        }

        if ( isset( 
$array[$index[0]] ) ) {
            return 
$array[$index[0]];
        }

        return 
null;
    }

    private static function 
add_array_value( &$array$index$val ) {
        if ( 
is_string$index ) ) {
            if ( 
false === strpos$index'[' ) ) {
                
$index = array( $index );
            } else {
                
$index rtrim$index'[]' );
                
$index preg_split'/[\[\]]+/'$index );
            }
        }

        
$cur_array =& $array;

        while ( 
count$index ) > ) {
            if ( ! isset( 
$cur_array[$index[0]] ) || ! is_array$cur_array[$index[0]] ) ) {
                
$cur_array[$index[0]] = array();
            }

            
$cur_array =& $cur_array[$index[0]];
            
array_shift$index );
        }

        
$cur_array[$index[0]] = $val;
    }

    private static function 
merge_defaults$values$defaults$force false ) {
        if ( ! 
ITSEC_Form::is_associative_array$defaults ) ) {
            if ( ! isset( 
$values ) ) {
                return 
$defaults;
            }

            if ( 
false === $force ) {
                return 
$values;
            }

            if ( isset( 
$values ) || is_array$values ) ) {
                return 
$values;
            }

            return 
$defaults;
        }

        foreach ( (array) 
$defaults as $key => $val ) {
            if ( ! isset( 
$values[$key] ) ) {
                
$values[$key] = null;
            }

            
$values[$key] = ITSEC_Form::merge_defaults$values[$key], $val$force );
        }

        return 
$values;
    }

    private static function 
is_associative_array( &$array ) {
        if ( ! 
is_array$array ) || empty( $array ) ) {
            return 
false;
        }

        
$next 0;

        foreach ( 
$array as $k => $v ) {
            if ( 
$k !== $next++ ) {
                return 
true;
            }
        }

        return 
false;
    }
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586