The MU forums have moved to WordPress.org

Hacking kses.php but problems with span style and color:#FFF tags in the Widgets (5 posts)

  1. ppriede
    Member
    Posted 16 years ago #

    I have my site with WordpressMU but closed for other people to create blog.

    So, i find the way to enable javascript and enable som other tags i want (like iframe, style, span, and some others)

    I want to enable this tags because i write my own blog system in the past, but now i like to change theme and things like that so i adopt Wordpress ... and select MU for futures blogs i want to make in the same domain

    THE PROBLEM:
    Well, i change some lines in the kses.php file like

    if (!CUSTOM_TAGS) {
    	$allowedposttags = array(
    		'script' => array(
    			'type' => array(),
    			'src' => array()
    			),
    		'span' => array(
    			'style' => array(),
    			'class' => array(),
    			),

    etc...

    Now i don't know how to enable some internal tags, for example

    <span style="color:#FFF">AAA</span>

    Is transformed to this

    <span style="#FFF">AAA</span>

    So the "color:" part is erased

    This happen when i save a Widget, but works OK in the normal post

    I hope someone can guide my

    Thank you very much.

    PD: Also i comment the last 2 lines of the kses.php file

    //add_action('init', 'kses_init');
    //add_action('set_current_user', 'kses_init');

    (I hope this is usefull for someone)

  2. ppriede
    Member
    Posted 16 years ago #

    I found the solution

    Open
    wp-includes/widgets.php

    And comments this lines

    //if ( !current_user_can('unfiltered_html') )
    //$newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text']));

    Is not a very good way, but is a way.

  3. ladynada
    Member
    Posted 16 years ago #

    how about a way that fixes the kludge in kses.php?

    I am trying to fix the same thing now, the color: is stripped

    nada

  4. Farms
    Member
    Posted 16 years ago #

    Yep, a Site Admin option to add things to kses.php would be a very appreciated feature.

  5. ladynada
    Member
    Posted 16 years ago #

About this Topic

  • Started 16 years ago by ppriede
  • Latest reply from ladynada