@@ -158,7 +158,7 @@ public function maybe_process_update() {
158158 if ( ! isset ( $ _POST ['_wpnonce ' ] ) ) {
159159 return false ;
160160 }
161- $ wpnonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? filter_input ( INPUT_POST , '_wpnonce ' ) : null ;
161+ $ wpnonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? sanitize_text_field ( $ _POST [ '_wpnonce ' ] ) : null ;
162162
163163 // Only allow class to be used by panel OR encrypted pwds never updated after insert.
164164 if ( empty ( $ wpnonce ) || wp_verify_nonce ( $ wpnonce ) ) {
@@ -251,15 +251,15 @@ public function input_value( $type, $established_data, $use_data_value = false )
251251 * @return bool|string
252252 */
253253 public function run_save_process () {
254- $ nonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? filter_input ( INPUT_POST , '_wpnonce ' ) : null ;
254+ $ nonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? sanitize_text_field ( $ _POST [ '_wpnonce ' ] ) : null ;
255255 $ page_slug_as_action = $ this ->section ->panel ->page ->slug ;
256256 if ( empty ( $ nonce ) || false === wp_verify_nonce ( $ nonce , $ page_slug_as_action ) ) {
257257 return false ; // Only run logic if asked to run & auth'd by nonce.
258258 }
259259
260260 $ type = ( ! empty ( $ this ->field_type ) ) ? $ this ->field_type : $ this ->input_type ;
261261
262- $ field_input = isset ( $ _POST [ $ this ->id ] ) ? filter_input ( INPUT_POST , $ this ->id ) : false ;
262+ $ field_input = isset ( $ _POST [ $ this ->id ] ) ? sanitize_text_field ( $ _POST [ $ this ->id ] ) : false ;
263263
264264 $ sanitize_input = $ this ->sanitize_data_input ( $ type , $ this ->id , $ field_input );
265265
@@ -311,7 +311,7 @@ protected function sanitize_data_input( $input_type, $id, $value ) {
311311 if ( ! isset ( $ _POST ['_wpnonce ' ] ) ) {
312312 return false ;
313313 }
314- $ wpnonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? filter_input ( INPUT_POST , '_wpnonce ' ) : null ;
314+ $ wpnonce = ( isset ( $ _POST ['submit ' ] ) && isset ( $ _POST ['_wpnonce ' ] ) ) ? sanitize_text_field ( $ _POST [ '_wpnonce ' ] ) : null ;
315315
316316 // Only allow class to be used by panel OR encrypted pwds never updated after insert.
317317 if ( empty ( $ wpnonce ) || wp_verify_nonce ( $ wpnonce ) ) {
@@ -320,7 +320,7 @@ protected function sanitize_data_input( $input_type, $id, $value ) {
320320
321321 switch ( $ input_type ) {
322322 case 'password ' :
323- $ hidden_pwd_field = isset ( $ _POST [ 'stored_ ' . $ id ] ) ? filter_input ( INPUT_POST , 'stored_ ' . $ id ) : null ;
323+ $ hidden_pwd_field = isset ( $ _POST [ 'stored_ ' . $ id ] ) ? sanitize_text_field ( $ _POST [ 'stored_ ' . $ id ] ) : null ;
324324
325325 if ( $ hidden_pwd_field === $ value && ! empty ( $ value ) ) {
326326 return '### wpop-encrypted-pwd-field-val-unchanged ### ' ;
0 commit comments