diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php
index 7399e9c..2ccb3a9 100644
|
a
|
b
|
if ( ! CUSTOM_TAGS ) {
|
| 119 | 119 | 'valign' => true, |
| 120 | 120 | 'width' => true, |
| 121 | 121 | ), |
| 122 | | 'colgroup' => array( |
| | 122 | 'colgroup' => array( |
| 123 | 123 | 'align' => true, |
| 124 | 124 | 'char' => true, |
| 125 | 125 | 'charoff' => true, |
| … |
… |
if ( ! CUSTOM_TAGS ) {
|
| 227 | 227 | 'longdesc' => true, |
| 228 | 228 | 'vspace' => true, |
| 229 | 229 | 'src' => true, |
| | 230 | 'srcset' => true, |
| 230 | 231 | 'usemap' => true, |
| 231 | 232 | 'width' => true, |
| 232 | 233 | ), |
| … |
… |
if ( ! CUSTOM_TAGS ) {
|
| 264 | 265 | 'lang' => true, |
| 265 | 266 | 'xml:lang' => true, |
| 266 | 267 | ), |
| | 268 | 'picture' => array(), |
| 267 | 269 | 'pre' => array( |
| 268 | 270 | 'width' => true, |
| 269 | 271 | ), |
| … |
… |
if ( ! CUSTOM_TAGS ) {
|
| 286 | 288 | ), |
| 287 | 289 | 'small' => array(), |
| 288 | 290 | 'strike' => array(), |
| | 291 | 'source' => array( |
| | 292 | 'srcset' => true, |
| | 293 | 'type' => true, |
| | 294 | 'media' => true, |
| | 295 | 'sizes' => true, |
| | 296 | ), |
| 289 | 297 | 'strong' => array(), |
| 290 | 298 | 'sub' => array(), |
| 291 | 299 | 'summary' => array( |
diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php
index 657fb30..86d79a1 100644
|
a
|
b
|
|
| 1 | | <?php |
| | 1 | §<?php |
| 2 | 2 | /** |
| 3 | 3 | * Some simple test cases for KSES post content filtering |
| 4 | 4 | * |
| … |
… |
class Tests_Kses extends WP_UnitTestCase {
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
| | 59 | * @ticket 29807 |
| | 60 | */ |
| | 61 | function test_wp_filter_post_kses_img() { |
| | 62 | global $allowedposttags; |
| | 63 | |
| | 64 | $attributes = array( |
| | 65 | 'class' => 'classname', |
| | 66 | 'id' => 'idattr', |
| | 67 | 'style' => 'color: red;', |
| | 68 | 'alt' => 'alt', |
| | 69 | 'src' => '/test.png', |
| | 70 | 'srcset' => '/test.png 2x', |
| | 71 | 'width' => '100', |
| | 72 | 'height' => '100', |
| | 73 | 'usemap' => '#hash', |
| | 74 | 'ismap' => 'ismap', |
| | 75 | 'vspace' => '20', |
| | 76 | 'hspace' => '20', |
| | 77 | 'longdesc' => 'this is the longdesc', |
| | 78 | 'align' => 'middle', |
| | 79 | 'border' => '5', |
| | 80 | ); |
| | 81 | |
| | 82 | foreach ( $attributes as $name => $value ) { |
| | 83 | |
| | 84 | if ( $name === $value ) { |
| | 85 | $string = "<img $value />"; |
| | 86 | $expect_string = "<img " . trim( $value, ';' ) . " />"; |
| | 87 | } else { |
| | 88 | $string = "<img $name='$value' />"; |
| | 89 | $expect_string = "<img $name='" . trim( $value, ';' ) . "' />"; |
| | 90 | } |
| | 91 | |
| | 92 | $this->assertEquals( $expect_string, wp_kses( $string, $allowedposttags ) ); |
| | 93 | |
| | 94 | } |
| | 95 | } |
| | 96 | |
| | 97 | /** |
| | 98 | * @ticket 29807 |
| | 99 | */ |
| | 100 | function test_wp_filter_post_kses_picture() { |
| | 101 | global $allowedposttags; |
| | 102 | |
| | 103 | $html = '<picture><source srcset="pear-mobile.jpeg" media="(max-width: 720px)" type="image/png"><source srcset="pear-tablet.jpeg" media="(max-width: 1280px)" type="image/png"><img src="pear-desktop.jpeg" alt="The pear is juicy."></picture>'; |
| | 104 | $this->assertEquals( $html, wp_kses( $html, $allowedposttags ) ); |
| | 105 | |
| | 106 | } |
| | 107 | |
| | 108 | |
| | 109 | /** |
| 59 | 110 | * @ticket 20210 |
| 60 | 111 | */ |
| 61 | 112 | function test_wp_filter_post_kses_abbr() { |
| … |
… |
EOF;
|
| 374 | 425 | $this->assertEquals( '¾', wp_kses_normalize_entities( '¾' ) ); |
| 375 | 426 | $this->assertEquals( '∴', wp_kses_normalize_entities( '∴' ) ); |
| 376 | 427 | } |
| 377 | | |
| | 428 | |
| 378 | 429 | /** |
| 379 | 430 | * Test removal of invalid binary data for HTML. |
| 380 | 431 | * |