Docs: Improve comments in tests/formatting/redirect.php
per the documentation standards.
See #48303. git-svn-id: https://develop.svn.wordpress.org/trunk@46987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0d81dcbfb1
commit
c8ac42b3dd
@ -35,7 +35,7 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase {
|
||||
|
||||
public function get_bad_status_codes() {
|
||||
return array(
|
||||
// Tests for bad arguments
|
||||
// Tests for bad arguments.
|
||||
array( '/wp-admin', 404 ),
|
||||
array( '/wp-admin', 410 ),
|
||||
array( '/wp-admin', 500 ),
|
||||
@ -52,7 +52,7 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase {
|
||||
$this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0dgo' ) );
|
||||
$this->assertEquals( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay', wp_sanitize_redirect( 'http://example.com/watchtheallowedcharacters-~+_.?#=&;,/:%!*stay' ) );
|
||||
$this->assertEquals( 'http://example.com/watchtheutf8convert%F0%9D%8C%86', wp_sanitize_redirect( "http://example.com/watchtheutf8convert\xf0\x9d\x8c\x86" ) );
|
||||
//Nesting checks
|
||||
// Nesting checks.
|
||||
$this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0ddgo' ) );
|
||||
$this->assertEquals( 'http://example.com/watchthecarriagereturngo', wp_sanitize_redirect( 'http://example.com/watchthecarriagereturn%0%0DDgo' ) );
|
||||
$this->assertEquals( 'http://example.com/whyisthisintheurl/?param[1]=foo', wp_sanitize_redirect( 'http://example.com/whyisthisintheurl/?param[1]=foo' ) );
|
||||
@ -101,23 +101,23 @@ class Tests_Formatting_Redirect extends WP_UnitTestCase {
|
||||
|
||||
function invalid_url_provider() {
|
||||
return array(
|
||||
// parse_url() fails
|
||||
// parse_url() fails.
|
||||
array( '' ),
|
||||
array( 'http://:' ),
|
||||
|
||||
// non-safelisted domain
|
||||
// Non-safelisted domain.
|
||||
array( 'http://non-safelisted.example/' ),
|
||||
|
||||
// non-safelisted domain (leading whitespace)
|
||||
// Non-safelisted domain (leading whitespace).
|
||||
array( " \t\n\r\0\x08\x0Bhttp://non-safelisted.example.com" ),
|
||||
array( " \t\n\r\0\x08\x0B//non-safelisted.example.com" ),
|
||||
|
||||
// unsupported schemes
|
||||
// Unsupported schemes.
|
||||
array( 'data:text/plain;charset=utf-8,Hello%20World!' ),
|
||||
array( 'file:///etc/passwd' ),
|
||||
array( 'ftp://example.com/' ),
|
||||
|
||||
// malformed input
|
||||
// Malformed input.
|
||||
array( 'http:example.com' ),
|
||||
array( 'http:80' ),
|
||||
array( 'http://example.com:1234:5678/' ),
|
||||
|
Loading…
Reference in New Issue
Block a user