WordPress.org

Make WordPress Core

Changeset 290 in tests for wp-testcase/test_post_filtering.php


Ignore:
Timestamp:
03/02/2010 10:03:37 PM (8 years ago)
Author:
westi
Message:

Add test cases for kses bug in WP#12394 props dougal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_post_filtering.php

    r174 r290  
    6161    }
    6262
     63    // test kses filtering of disallowed attribute
     64    function test_post_content_disallowed_attr() {
     65       
     66        $content = <<<EOF
     67<img src='foo' width='500' href='shlorp' />
     68EOF;
     69
     70        $expected = <<<EOF
     71<img src='foo' width='500' />
     72EOF;
     73
     74        $id = $this->_insert_quick_post(__FUNCTION__, $content);
     75        $post = get_post($id);
     76       
     77        $this->assertEquals( $expected, $post->post_content );
     78    }
     79
     80    // test kses bug. xhtml does not require space before closing
     81    // empty element
     82    function test_post_content_xhtml_empty_elem() {
     83        $this->knownWPBug( 12394 );     
     84        $content = <<<EOF
     85<img src='foo' width='500' height='300'/>
     86EOF;
     87
     88        $expected = <<<EOF
     89<img src='foo' width='500' height='300' />
     90EOF;
     91
     92        $id = $this->_insert_quick_post(__FUNCTION__, $content);
     93        $post = get_post($id);
     94       
     95        $this->assertEquals( $expected, $post->post_content );
     96    }
     97
    6398    // make sure unbalanced tags are fixed when they span a --more-- tag
    6499    function test_post_content_unbalanced_more() {
Note: See TracChangeset for help on using the changeset viewer.