• Lisa Clarke

    (@polkadotcreations)


    I just upgraded from 3.0 to 3.0.1 and am getting this error:
    Wrong datatype for second argument in kses.php

    I believe the same thing happened to me when I upgraded to 3.0, but I can’t for the life of me remember how I fixed it.

    The problem appears to be with wp_kses_named_entities() on the line that calls in_array().

    Any insight?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Lisa Clarke

    (@polkadotcreations)

    I just noticed it only seems to be happening when I view a single post. The site index, and pages are not giving me any grief.

    Thread Starter Lisa Clarke

    (@polkadotcreations)

    I figured out how I worked around it last time – here it is, in case anyone else has the same problem:

    Replace

    function wp_kses_named_entities($matches) {
    	global $allowedentitynames;
    
    	if ( empty($matches[1]) )
    		return '';
    
    	$i = $matches[1];
    	return ( ( ! in_array($i, $allowedentitynames) ) ? "&$i;" : "&$i;" );
    }

    with

    function my_in_array( $needle, $haystack ){
          if (sizeof($haystack) > 0){return in_array($needle, $haystack);}
          return false;
    }
    
    function wp_kses_named_entities($matches) {
    	global $allowedentitynames;
    
    	if ( empty($matches[1]) )
    		return '';
    
    	$i = $matches[1];
    	return ( ( ! my_in_array($i, $allowedentitynames) ) ? "&$i;" : "&$i;" );
    }

    I doubt this fixes the underlying problem, but it gets the error message off of my screen, and I haven’t noticed any ill-effects.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong datatype for second argument in kses’ is closed to new replies.