Ticket #50731: 50731.diff
File 50731.diff, 1.2 KB (added by , 4 years ago) |
---|
-
src/wp-includes/kses.php
230 230 'border' => true, 231 231 'height' => true, 232 232 'hspace' => true, 233 'loading' => true, 233 234 'longdesc' => true, 234 235 'vspace' => true, 235 236 'src' => true, -
tests/phpunit/tests/kses.php
767 767 ), 768 768 array( 769 769 'img', 770 'loading="lazy"', 771 'loading="lazy"', 772 ), 773 array( 774 'img', 770 775 'onerror=alert(1)', 771 776 '', 772 777 ), … … 1352 1357 ), 1353 1358 ); 1354 1359 } 1360 1361 /** 1362 * Test filtering a standard img tag. 1363 * 1364 * @ticket 50731 1365 */ 1366 function test_wp_kses_img_tag_standard_attributes() { 1367 $html = array( 1368 '<img', 1369 'loading="lazy"', 1370 'src="https://example.com/img.jpg"', 1371 'width="1000"', 1372 'height="1000"', 1373 'alt=""', 1374 'class="wp-image-1000"', 1375 '/>', 1376 ); 1377 1378 $html = implode( ' ', $html ); 1379 1380 $this->assertSame( $html, wp_kses_post( $html ) ); 1381 } 1355 1382 }