fix: remove the function sanitize_theme #447

This commit is contained in:
vnmedeiros 2021-03-23 14:19:03 -03:00
parent 59c0a9e658
commit 0c1a624188
2 changed files with 5 additions and 14 deletions

View File

@ -923,7 +923,10 @@ abstract class Repository {
return $content;
}
return sanitize_theme($content);
$allowed_html = wp_kses_allowed_html('post');
unset($allowed_html["a"]);
return trim(wp_kses($content, $allowed_html));
}
}

View File

@ -39,16 +39,4 @@ add_action('init', ['Tainacan\Migrations', 'run_migrations']);
//https://core.trac.wordpress.org/ticket/23022#comment:13
add_filter( 'wp_untrash_post_status', function( $new_status, $post_id, $previous_status ) {
return $previous_status;
}, 10, 3 );
add_action('the_post', function($post){
$post->post_content = sanitize_theme($post->post_content);
$post->post_title = sanitize_theme($post->post_title);
}, 10, 2);
function sanitize_theme($content) {
$allowed_html = wp_kses_allowed_html('post');
unset($allowed_html["a"]);
return trim(wp_kses($content, $allowed_html));
}
}, 10, 3 );