Changeset 46987
- Timestamp:
- 12/18/2019 12:26:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/redirect.php
r46649 r46987 36 36 public function get_bad_status_codes() { 37 37 return array( 38 // Tests for bad arguments 38 // Tests for bad arguments. 39 39 array( '/wp-admin', 404 ), 40 40 array( '/wp-admin', 410 ), … … 53 53 $this->assertEquals( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay', wp_sanitize_redirect( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay' ) ); 54 54 $this->assertEquals( 'http://example.com/watchtheutf8convert%F0%9D%8C%86', wp_sanitize_redirect( "http://example.com/watchtheutf8convert\xf0\x9d\x8c\x86" ) ); 55 // Nesting checks55 // Nesting checks. 56 56 $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) ); 57 57 $this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) ); … … 102 102 function invalid_url_provider() { 103 103 return array( 104 // parse_url() fails 104 // parse_url() fails. 105 105 array( '' ), 106 106 array( 'http://:' ), 107 107 108 // non-safelisted domain108 // Non-safelisted domain. 109 109 array( 'http://non-safelisted.example/' ), 110 110 111 // non-safelisted domain (leading whitespace)111 // Non-safelisted domain (leading whitespace). 112 112 array( " \t\n\r\0\x08\x0Bhttp://non-safelisted.example.com" ), 113 113 array( " \t\n\r\0\x08\x0B//non-safelisted.example.com" ), 114 114 115 // unsupported schemes115 // Unsupported schemes. 116 116 array( 'data:text/plain;charset=utf-8,Hello%20World!' ), 117 117 array( 'file:///etc/passwd' ), 118 118 array( 'ftp://example.com/' ), 119 119 120 // malformed input120 // Malformed input. 121 121 array( 'http:example.com' ), 122 122 array( 'http:80' ),
Note: See TracChangeset
for help on using the changeset viewer.