Make WordPress Core

Changeset 35141


Ignore:
Timestamp:
10/13/2015 05:17:13 PM (11 years ago)
Author:
wonderboymusic
Message:

KSES: have you ever heard of the <bdo> HTML tag? Same. ​http://www.w3schools.com/tags/tag_bdo.asp

Adds unit test.

Props iandunn.
Fixes #34063.

Location:
trunk
Files:
2 edited

Legend:

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

    r33739 r35141  
    9898                ),
    9999                'b' => array(),
     100                'bdo' => array(
     101                        'dir' => true,
     102                ),
    100103                'big' => array(),
    101104                'blockquote' => array(
  • trunk/tests/phpunit/tests/kses.php

    r33359 r35141  
    375375                $this->assertEquals( '&there4;', wp_kses_normalize_entities( '&there4;' ) );
    376376        }
    377        
     377
    378378        /**
    379379         * Test removal of invalid binary data for HTML.
    … …  
    412412                );
    413413        }
    414        
     414
    415415        /**
    416416         * Test removal of '\0' strings.
    … …  
    424424                return $this->assertEquals( $output, wp_kses( $input, $allowedposttags ) );
    425425        }
    426        
     426
    427427        function data_slash_zero_removal() {
    428428                return array(
    … …  
    643643                );
    644644        }
     645
     646        /**
     647         * @ticket 34063
     648         */
     649        function test_bdo() {
     650                global $allowedposttags;
     651
     652                $input = '<p>This is <bdo dir="rtl">a BDO tag</bdo>. Weird, <bdo dir="ltr">right?</bdo></p>';
     653
     654                $this->assertEquals( $input, wp_kses( $input, $allowedposttags ) );
     655        }
    645656}
Note: See TracChangeset for help on using the changeset viewer.