Sanitize and unslash all inputs
This commit is contained in:
@@ -267,10 +267,10 @@ class SP_Admin_Taxonomies {
|
||||
if ( isset( $_POST['term_meta'] ) ) {
|
||||
$t_id = $term_id;
|
||||
$term_meta = get_option( "taxonomy_$t_id" );
|
||||
$cat_keys = array_keys( $_POST['term_meta'] );
|
||||
$cat_keys = array_keys( wp_unslash( $_POST['term_meta'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
|
||||
foreach ( $cat_keys as $key ) {
|
||||
if ( isset( $_POST['term_meta'][ $key ] ) ) {
|
||||
$term_meta[ $key ] = sanitize_text_field( $_POST['term_meta'][ $key ] );
|
||||
$term_meta[ $key ] = sanitize_text_field( wp_unslash( $_POST['term_meta'][ $key ] ) );
|
||||
}
|
||||
}
|
||||
update_option( "taxonomy_$t_id", $term_meta );
|
||||
|
||||
Reference in New Issue
Block a user