= sanitize_text_field( $dirty[ $key ] ); } break; // @todo - validate domains in some way? case 'video_wistia_domain': if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) { $clean[ $key ] = sanitize_text_field( urldecode( $dirty[ $key ] ) ); $clean[ $key ] = preg_replace( [ '`^http[s]?://`', '`^//`', '`/$`' ], '', $clean[ $key ] ); } break; case 'video_embedly_api_key': if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' && preg_match( '`^[a-f0-9]{32}$`', $dirty[ $key ] ) ) { $clean[ $key ] = sanitize_text_field( $dirty[ $key ] ); } break; // Numeric text field - may not be in form. case 'video_content_width': if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== '' ) { $int = WPSEO_Video_Wrappers::yoast_wpseo_video_validate_int( $dirty[ $key ] ); if ( $int !== false && $int > 0 ) { $clean[ $key ] = $int; } } break; // Boolean (checkbox) field - may not be in form. case 'video_cloak_sitemap': case 'video_disable_rss': case 'video_facebook_embed': case 'video_fitvids': case 'video_youtube_faster_embed': $clean[ $key ] = false; if ( isset( $dirty[ $key ] ) ) { $clean[ $key ] = WPSEO_Video_Wrappers::validate_bool( $dirty[ $key ] ); } break; } } return $clean; } } }