Add kses_init_filters(). Call it when running importers.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-10-05 23:58:16 +00:00
parent 4ffa89daa7
commit e56c5d190d
2 changed files with 9 additions and 5 deletions

View File

@ -88,6 +88,7 @@ if (isset($_GET['page'])) {
require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
define('WP_IMPORTING', true);
kses_init_filters(); // Always filter imported data with kses.
call_user_func($wp_importers[$importer][2]);

View File

@ -513,15 +513,18 @@ function wp_filter_post_kses($data) {
return addslashes ( wp_kses(stripslashes( $data ), $allowedposttags) );
}
function kses_init() {
global $current_user;
get_currentuserinfo(); // set $current_user
if (current_user_can('unfiltered_html') == false) {
function kses_init_filters() {
add_filter('pre_comment_author', 'wp_filter_kses');
add_filter('pre_comment_content', 'wp_filter_kses');
add_filter('content_save_pre', 'wp_filter_post_kses');
}
function kses_init() {
global $current_user;
get_currentuserinfo(); // set $current_user
if (current_user_can('unfiltered_html') == false)
kses_init_filters();
}
add_action('init', 'kses_init');
?>