| @@ 140-150 (lines=11) @@ | ||
| 137 | /** |
|
| 138 | * @ticket 16859 |
|
| 139 | */ |
|
| 140 | function test_square_brackets() { |
|
| 141 | $this->assertEquals( '/example.php?one%5B%5D=two', esc_url( '/example.php?one[]=two' ) ); |
|
| 142 | $this->assertEquals( '?foo%5Bbar%5D=baz', esc_url( '?foo[bar]=baz' ) ); |
|
| 143 | $this->assertEquals( '//example.com/?foo%5Bbar%5D=baz', esc_url( '//example.com/?foo[bar]=baz' ) ); |
|
| 144 | $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'example.com/?foo[bar]=baz' ) ); |
|
| 145 | $this->assertEquals( 'http://localhost?foo%5Bbar%5D=baz', esc_url( 'localhost?foo[bar]=baz' ) ); |
|
| 146 | $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo[bar]=baz' ) ); |
|
| 147 | $this->assertEquals( 'http://example.com/?foo%5Bbar%5D=baz', esc_url( 'http://example.com/?foo%5Bbar%5D=baz' ) ); |
|
| 148 | $this->assertEquals( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo[bar]=baz' ) ); |
|
| 149 | $this->assertEquals( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz', esc_url( 'http://example.com/?baz=bar&foo%5Bbar%5D=baz' ) ); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * Courtesy of http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding |
|
| @@ 380-390 (lines=11) @@ | ||
| 377 | /** |
|
| 378 | * @ticket 26290 |
|
| 379 | */ |
|
| 380 | public function test_wp_kses_normalize_entities() { |
|
| 381 | $this->assertEquals( '♠', wp_kses_normalize_entities( '♠' ) ); |
|
| 382 | ||
| 383 | $this->assertEquals( '¹', wp_kses_normalize_entities( '¹' ) ); |
|
| 384 | $this->assertEquals( '²', wp_kses_normalize_entities( '²' ) ); |
|
| 385 | $this->assertEquals( '³', wp_kses_normalize_entities( '³' ) ); |
|
| 386 | $this->assertEquals( '¼', wp_kses_normalize_entities( '¼' ) ); |
|
| 387 | $this->assertEquals( '½', wp_kses_normalize_entities( '½' ) ); |
|
| 388 | $this->assertEquals( '¾', wp_kses_normalize_entities( '¾' ) ); |
|
| 389 | $this->assertEquals( '∴', wp_kses_normalize_entities( '∴' ) ); |
|
| 390 | } |
|
| 391 | ||
| 392 | /** |
|
| 393 | * Test removal of invalid binary data for HTML. |
|