File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,10 @@ function start_test() {
9595
9696 $ wpephpc = new WPEPHPCompat ( dirname ( __FILE__ ) );
9797
98+ $ test_data = array ();
9899 foreach ( array ( 'test_version ' , 'only_active ' ) as $ key ) {
99100 if ( isset ( $ _POST [ $ key ] ) ) {
100- $ $ key = sanitize_text_field ( $ _POST [ $ key ] );
101+ $ test_data [ $ key ] = sanitize_text_field ( $ _POST [ $ key ] );
101102 }
102103 }
103104
@@ -106,14 +107,16 @@ function start_test() {
106107 // Make sure we clean up after the last test.
107108 $ wpephpc ->clean_after_scan ();
108109
109- $ test_version = sanitize_text_field ( $ _POST ['test_version ' ] );
110- $ only_active = sanitize_text_field ( $ _POST ['only_active ' ] );
111-
112110 // Fork so we can close the connection.
113- $ this ->fork_scan ( $ test_version , $ only_active );
111+ $ this ->fork_scan ( $ test_data [ ' test_version ' ] , $ test_data [ ' only_active ' ] );
114112 } else {
115- $ wpephpc ->test_version = $ test_version ;
116- $ wpephpc ->only_active = $ only_active ;
113+ if ( isset ( $ test_data ['test_version ' ] ) ) {
114+ $ wpephpc ->test_version = $ test_data ['test_version ' ];
115+ }
116+
117+ if ( isset ( $ test_data ['only_active ' ] ) ) {
118+ $ wpephpc ->only_active = $ test_data ['only_active ' ];
119+ }
117120
118121 $ wpephpc ->start_test ();
119122 }
You can’t perform that action at this time.
0 commit comments