| | 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' /> |
| | 68 | EOF; |
| | 69 | |
| | 70 | $expected = <<<EOF |
| | 71 | <img src='foo' width='500' /> |
| | 72 | EOF; |
| | 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 | |
| | 84 | $content = <<<EOF |
| | 85 | <img src='foo' width='500' height='300'/> |
| | 86 | EOF; |
| | 87 | |
| | 88 | $expected = <<<EOF |
| | 89 | <img src='foo' width='500' height='300' /> |
| | 90 | EOF; |
| | 91 | |
| | 92 | $id = $this->_insert_quick_post(__FUNCTION__, $content); |
| | 93 | $post = get_post($id); |
| | 94 | |
| | 95 | $this->assertEquals( $expected, $post->post_content ); |
| | 96 | } |
| | 97 | |