Make WordPress Core

Ticket #2661: 2661.diff

File 2661.diff, 1.8 KB (added by westi, 20 years ago)

Patch for kses.php to update to 0.2.2

  • wp-includes/kses.php

     
    11<?php
    22
    33// Added wp_ prefix to avoid conflicts with existing kses users
    4 # kses 0.2.1 - HTML/XHTML filter that only allows some elements and attributes
    5 # Copyright (C) 2002, 2003  Ulf Harnhammar
     4# kses 0.2.2 - HTML/XHTML filter that only allows some elements and attributes
     5# Copyright (C) 2002, 2003, 2005  Ulf Harnhammar
    66# *** CONTACT INFORMATION ***
    77#
    88# E-mail:      metaur at users dot sourceforge dot net
     
    113113        $elem = $matches[2];
    114114        $attrlist = $matches[3];
    115115
    116         if (!@ is_array($allowed_html[strtolower($elem)]))
     116        if (!@isset($allowed_html[strtolower($elem)]))
    117117                return '';
    118118        # They are using a not allowed HTML element
    119119
     
    366366###############################################################################
    367367{
    368368        $string = wp_kses_no_null($string);
     369        $string = preg_replace('/\xad+/', '', $string); # deals with Opera "feature"
    369370        $string2 = $string.'a';
    370371
    371372        while ($string != $string2) {
     
    378379
    379380function wp_kses_no_null($string)
    380381###############################################################################
    381 # This function removes any NULL or chr(173) characters in $string.
     382# This function removes any NULL characters in $string.
    382383###############################################################################
    383384{
    384385        $string = preg_replace('/\0+/', '', $string);
     
    454455        $string2 = wp_kses_decode_entities($string);
    455456        $string2 = preg_replace('/\s/', '', $string2);
    456457        $string2 = wp_kses_no_null($string2);
     458        $string2 = preg_replace('/\xad+/', '', $string2);
     459        # deals with Opera "feature"
    457460        $string2 = strtolower($string2);
    458461
    459462        $allowed = false;