Ticket #23605: 23605.diff
File 23605.diff, 1.8 KB (added by , 9 years ago) |
---|
-
src/wp-includes/formatting.php
3274 3274 3275 3275 if ( '' == $url ) 3276 3276 return $url; 3277 $url = str_replace(' ', '%20', $url); 3277 3278 $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); 3278 3279 if ( 0 !== stripos( $url, 'mailto:' ) ) { 3279 3280 $strip = array('%0d', '%0a', '%0D', '%0A'); 3280 3281 $url = _deep_replace($strip, $url); 3281 3282 } 3283 3282 3284 $url = str_replace(';//', '://', $url); 3283 3285 /* If the URL doesn't appear to contain a scheme, we 3284 3286 * presume it needs http:// appended (unless a relative -
tests/phpunit/tests/formatting/EscUrl.php
5 5 */ 6 6 class Tests_Formatting_EscUrl extends WP_UnitTestCase { 7 7 function test_spaces() { 8 $this->assertEquals('http://example.com/Mr WordPress', esc_url('http://example.com/Mr WordPress'));8 $this->assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr WordPress')); 9 9 $this->assertEquals('http://example.com/Mr%20WordPress', esc_url('http://example.com/Mr%20WordPress')); 10 10 } 11 11 -
tests/phpunit/tests/formatting/GetUrlInContent.php
34 34 ), // multiple links 35 35 array ( 36 36 'ABC<div><a href="http://example.com/Mr%20WordPress 2">LINK</a> CONTENT </div>', 37 "http://example.com/Mr%20WordPress 2"37 "http://example.com/Mr%20WordPress%202" 38 38 ), // escape link 39 39 ); 40 40 }