Make WordPress Core

Changeset 8671


Ignore:
Timestamp:
08/19/2008 06:43:21 PM (18 years ago)
Author:
ryan
Message:

Apply kses bad-protocol checks only to URI typed attributes. Props takayukister. fixes #5917 #6888 #6910 #7512

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/kses.php

    r8572 r8671  
    552552        $mode = 0;
    553553        $attrname = '';
     554        $uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
    554555
    555556        # Loop through the whole attribute list
    … …  
    596597                                        # "value"
    597598                                        {
    598                                         $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols);
     599                                        $thisval = $match[1];
     600                                        if ( in_array($attrname, $uris) )               
     601                                                $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    599602
    600603                                        if(FALSE === array_key_exists($attrname, $attrarr)) {
    … …  
    610613                                        # 'value'
    611614                                        {
    612                                         $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols);
     615                                        $thisval = $match[1];
     616                                        if ( in_array($attrname, $uris) )               
     617                                                $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    613618
    614619                                        if(FALSE === array_key_exists($attrname, $attrarr)) {
    … …  
    624629                                        # value
    625630                                        {
    626                                         $thisval = wp_kses_bad_protocol($match[1], $allowed_protocols);
     631                                        $thisval = $match[1];
     632                                        if ( in_array($attrname, $uris) )               
     633                                                $thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
    627634
    628635                                        if(FALSE === array_key_exists($attrname, $attrarr)) {
Note: See TracChangeset for help on using the changeset viewer.