Changeset 46490
- Timestamp:
- 10/14/2019 06:16:02 PM (6 years ago)
- Location:
- branches/5.1
- Files:
-
- 8 edited
-
src/wp-includes/class-wp-query.php (modified) (2 diffs)
-
src/wp-includes/class-wp.php (modified) (1 diff)
-
src/wp-includes/functions.php (modified) (1 diff)
-
src/wp-includes/http.php (modified) (1 diff)
-
src/wp-includes/pluggable.php (modified) (2 diffs)
-
src/wp-includes/rest-api.php (modified) (1 diff)
-
tests/phpunit/tests/auth.php (modified) (1 diff)
-
tests/phpunit/tests/query/vars.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.1/src/wp-includes/class-wp-query.php
r44518 r46490 530 530 'attachment_id', 531 531 'name', 532 'static',533 532 'pagename', 534 533 'page_id', … … 794 793 // post is being queried. 795 794 $this->is_single = true; 796 } elseif ( '' != $qv[' static'] || '' != $qv['pagename'] || ! empty( $qv['page_id'] ) ) {795 } elseif ( '' != $qv['pagename'] || ! empty( $qv['page_id'] ) ) { 797 796 $this->is_page = true; 798 797 $this->is_single = false; -
branches/5.1/src/wp-includes/class-wp.php
r44048 r46490 15 15 * @var string[] 16 16 */ 17 public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', ' static', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );17 public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' ); 18 18 19 19 /** -
branches/5.1/src/wp-includes/functions.php
r44831 r46490 1786 1786 if ( file_exists( $target ) ) { 1787 1787 return @is_dir( $target ); 1788 } 1789 1790 // Do not allow path traversals. 1791 if ( false !== strpos( $target, '../' ) || false !== strpos( $target, '..' . DIRECTORY_SEPARATOR ) ) { 1792 return false; 1788 1793 } 1789 1794 -
branches/5.1/src/wp-includes/http.php
r42894 r46490 556 556 $ip = gethostbyname( $host ); 557 557 if ( $ip === $host ) { // Error condition for gethostbyname() 558 $ip =false;558 return false; 559 559 } 560 560 } -
branches/5.1/src/wp-includes/pluggable.php
r45973 r46490 1093 1093 */ 1094 1094 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 1095 if ( -1 == $action ) {1095 if ( -1 === $action ) { 1096 1096 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1097 1097 } … … 1112 1112 do_action( 'check_admin_referer', $action, $result ); 1113 1113 1114 if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {1114 if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { 1115 1115 wp_nonce_ays( $action ); 1116 1116 die(); -
branches/5.1/src/wp-includes/rest-api.php
r44698 r46490 588 588 header( 'Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, PATCH, DELETE' ); 589 589 header( 'Access-Control-Allow-Credentials: true' ); 590 header( 'Vary: Origin' ); 590 header( 'Vary: Origin', false ); 591 } elseif ( ! headers_sent() && 'GET' === $_SERVER['REQUEST_METHOD'] && ! is_user_logged_in() ) { 592 header( 'Vary: Origin', false ); 591 593 } 592 594 -
branches/5.1/tests/phpunit/tests/auth.php
r43571 r46490 166 166 } 167 167 168 public function test_check_admin_referer_with_default_action_as_string_not_doing_it_wrong() { 169 // A valid nonce needs to be set so the check doesn't die() 170 $_REQUEST['_wpnonce'] = wp_create_nonce( '-1' ); 171 $result = check_admin_referer( '-1' ); 172 $this->assertSame( 1, $result ); 173 174 unset( $_REQUEST['_wpnonce'] ); 175 } 176 168 177 /** 169 178 * @ticket 36361 -
branches/5.1/tests/phpunit/tests/query/vars.php
r43571 r46490 52 52 'feed', 53 53 'author_name', 54 'static',55 54 'pagename', 56 55 'page_id',
Note: See TracChangeset
for help on using the changeset viewer.