@@ -524,6 +524,7 @@ public static function get( string $name ) {
524
524
if ( $ option ) {
525
525
$ option ->unfiltered_value = $ option ->value ;
526
526
$ option ->value = apply_filters ( (string ) $ opt_spec ['filter_name ' ], $ option ->value );
527
+ /** @phpstan-ignore-next-line */
527
528
} elseif ( $ opt_spec ) {
528
529
$ opt = array_merge ( $ opt_spec ); // Make a copy so we don't modify $cached_option_specs
529
530
$ opt ['unfiltered_value ' ] = $ opt_spec ['default_value ' ];
@@ -599,11 +600,16 @@ public static function getAll() {
599
600
public static function encrypt_decrypt ( string $ action , string $ string ) : string {
600
601
$ encrypt_method = 'AES-256-CBC ' ;
601
602
603
+ /**
604
+ * @var string $secret_key
605
+ */
602
606
$ secret_key =
603
607
defined ( 'AUTH_KEY ' ) ?
604
608
constant ( 'AUTH_KEY ' ) :
605
609
'LC>_cVZv34+W.P&_8d|ejfr]d31h)J?z5n(LB6iY=;P@?5/qzJSyB3qctr,.D$[L ' ;
606
-
610
+ /**
611
+ * @var string $secret_iv
612
+ */
607
613
$ secret_iv =
608
614
defined ( 'AUTH_SALT ' ) ?
609
615
constant ( 'AUTH_SALT ' ) :
@@ -665,13 +671,21 @@ public static function savePosted( string $screen = 'core' ) : void {
665
671
666
672
$ wpdb ->update (
667
673
$ table_name ,
668
- [ 'value ' => esc_url_raw ( $ _POST ['deploymentURL ' ] ) ],
674
+ [
675
+ 'value ' =>
676
+ esc_url_raw ( strval ( filter_input ( INPUT_POST , 'deploymentURL ' ) ) ),
677
+ ],
669
678
[ 'name ' => 'deploymentURL ' ]
670
679
);
671
680
672
681
$ wpdb ->update (
673
682
$ table_name ,
674
- [ 'value ' => sanitize_text_field ( $ _POST ['basicAuthUser ' ] ) ],
683
+ [
684
+ 'value ' =>
685
+ sanitize_text_field (
686
+ strval ( filter_input ( INPUT_POST , 'basicAuthUser ' ) )
687
+ ),
688
+ ],
675
689
[ 'name ' => 'basicAuthUser ' ]
676
690
);
677
691
@@ -681,7 +695,9 @@ public static function savePosted( string $screen = 'core' ) : void {
681
695
'value ' =>
682
696
self ::encrypt_decrypt (
683
697
'encrypt ' ,
684
- sanitize_text_field ( $ _POST ['basicAuthPassword ' ] )
698
+ sanitize_text_field (
699
+ strval ( filter_input ( INPUT_POST , 'basicAuthPassword ' ) )
700
+ )
685
701
),
686
702
],
687
703
[ 'name ' => 'basicAuthPassword ' ]
@@ -695,19 +711,32 @@ public static function savePosted( string $screen = 'core' ) : void {
695
711
696
712
$ wpdb ->update (
697
713
$ table_name ,
698
- [ 'value ' => sanitize_email ( $ _POST ['completionEmail ' ] ) ],
714
+ [
715
+ 'value ' =>
716
+ sanitize_text_field (
717
+ strval ( filter_input ( INPUT_POST , 'completionEmail ' ) )
718
+ ),
719
+ ],
699
720
[ 'name ' => 'completionEmail ' ]
700
721
);
701
722
702
723
$ wpdb ->update (
703
724
$ table_name ,
704
- [ 'value ' => esc_url_raw ( $ _POST ['completionWebhook ' ] ) ],
725
+ [
726
+ 'value ' =>
727
+ esc_url_raw ( strval ( filter_input ( INPUT_POST , 'completionWebhook ' ) ) ),
728
+ ],
705
729
[ 'name ' => 'completionWebhook ' ]
706
730
);
707
731
708
732
$ wpdb ->update (
709
733
$ table_name ,
710
- [ 'value ' => sanitize_text_field ( $ _POST ['completionWebhookMethod ' ] ) ],
734
+ [
735
+ 'value ' =>
736
+ sanitize_text_field (
737
+ strval ( filter_input ( INPUT_POST , 'completionWebhookMethod ' ) )
738
+ ),
739
+ ],
711
740
[ 'name ' => 'completionWebhookMethod ' ]
712
741
);
713
742
@@ -735,6 +764,9 @@ public static function savePosted( string $screen = 'core' ) : void {
735
764
[ 'name ' => 'processQueueImmediately ' ]
736
765
);
737
766
767
+ /**
768
+ * @var int $process_queue_interval
769
+ */
738
770
$ process_queue_interval =
739
771
isset ( $ _POST ['processQueueInterval ' ] ) ?
740
772
$ _POST ['processQueueInterval ' ] : 0 ;
@@ -783,7 +815,7 @@ public static function savePosted( string $screen = 'core' ) : void {
783
815
$ file_extensions_to_ignore = preg_replace (
784
816
'/^\s+|\s+$/m ' ,
785
817
'' ,
786
- $ _POST [ 'fileExtensionsToIgnore ' ]
818
+ strval ( filter_input ( INPUT_POST , 'fileExtensionsToIgnore ' ) )
787
819
);
788
820
$ wpdb ->update (
789
821
$ table_name ,
@@ -794,7 +826,7 @@ public static function savePosted( string $screen = 'core' ) : void {
794
826
$ filenames_to_ignore = preg_replace (
795
827
'/^\s+|\s+$/m ' ,
796
828
'' ,
797
- $ _POST [ 'filenamesToIgnore ' ]
829
+ strval ( filter_input ( INPUT_POST , 'filenamesToIgnore ' ) )
798
830
);
799
831
$ wpdb ->update (
800
832
$ table_name ,
@@ -805,7 +837,7 @@ public static function savePosted( string $screen = 'core' ) : void {
805
837
$ hosts_to_rewrite = preg_replace (
806
838
'/^\s+|\s+$/m ' ,
807
839
'' ,
808
- $ _POST [ 'hostsToRewrite ' ]
840
+ strval ( filter_input ( INPUT_POST , 'hostsToRewrite ' ) )
809
841
);
810
842
$ wpdb ->update (
811
843
$ table_name ,
0 commit comments