Changeset 46503
- Timestamp:
- 10/14/2019 07:26:08 PM (6 years ago)
- Location:
- branches/3.9
- Files:
-
- 7 edited
-
package.json (modified) (1 diff)
-
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) (4 diffs)
-
src/wp-includes/query.php (modified) (2 diffs)
-
tests/phpunit/tests/auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/package.json
r46033 r46503 21 21 "grunt-contrib-jshint": "~0.8.0", 22 22 "grunt-cssjanus": "~0.2.2", 23 "grunt-sass": "~ 0.10.0",23 "grunt-sass": "~1.0.0", 24 24 "grunt-autoprefixer": "~0.7.1", 25 25 "grunt-jsvalidate": "~0.2.2", -
branches/3.9/src/wp-includes/class-wp.php
r44071 r46503 16 16 * @var array 17 17 */ 18 var $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', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');18 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', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' ); 19 19 20 20 /** -
branches/3.9/src/wp-includes/functions.php
r44010 r46503 1420 1420 if ( file_exists( $target ) ) 1421 1421 return @is_dir( $target ); 1422 1423 // Do not allow path traversals. 1424 if ( false !== strpos( $target, '../' ) || false !== strpos( $target, '..' . DIRECTORY_SEPARATOR ) ) { 1425 return false; 1426 } 1422 1427 1423 1428 // We need to find the permissions of the parent folder that exists and inherit that. -
branches/3.9/src/wp-includes/http.php
r37121 r46503 477 477 } else { 478 478 $ip = gethostbyname( $host ); 479 if ( $ip === $host ) // Error condition for gethostbyname() 480 $ip = false; 479 if ( $ip === $host ) { // Error condition for gethostbyname() 480 return false; 481 } 481 482 } 482 483 if ( $ip ) { -
branches/3.9/src/wp-includes/pluggable.php
r45986 r46503 1007 1007 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5) 1008 1008 */ 1009 function check_admin_referer( $action = -1, $query_arg = '_wpnonce') {1010 if ( -1 == $action )1011 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2 ' );1009 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 1010 if ( -1 === $action ) 1011 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1012 1012 1013 1013 $adminurl = strtolower(admin_url()); … … 1028 1028 */ 1029 1029 do_action( 'check_admin_referer', $action, $result ); 1030 1031 if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { 1032 wp_nonce_ays( $action ); 1033 die(); 1034 } 1035 1030 1036 return $result; 1031 1037 } … … 1042 1048 */ 1043 1049 function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { 1050 if ( -1 === $action ) 1051 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1052 1044 1053 $nonce = ''; 1045 1054 … … 2220 2229 } 2221 2230 endif; 2222 2223 if ( ! function_exists( 'hash_equals' ) ) :2224 /**2225 * Compare two strings in constant time.2226 *2227 * This function is NOT pluggable. It is in this file (in addition to2228 * compat.php) to prevent errors if, during an update, pluggable.php2229 * copies over but compat.php does not.2230 *2231 * This function was added in PHP 5.6.2232 * It can leak the length of a string.2233 *2234 * @since 3.9.22235 *2236 * @param string $a Expected string.2237 * @param string $b Actual string.2238 * @return bool Whether strings are equal.2239 */2240 function hash_equals( $a, $b ) {2241 $a_length = strlen( $a );2242 if ( $a_length !== strlen( $b ) ) {2243 return false;2244 }2245 $result = 0;2246 2247 // Do not attempt to "optimize" this.2248 for ( $i = 0; $i < $a_length; $i++ ) {2249 $result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );2250 }2251 2252 return $result === 0;2253 }2254 endif; -
branches/3.9/src/wp-includes/query.php
r39964 r46503 1399 1399 , 'attachment_id' 1400 1400 , 'name' 1401 , 'static'1402 1401 , 'pagename' 1403 1402 , 'page_id' … … 1507 1506 // post is being queried. 1508 1507 $this->is_single = true; 1509 } elseif ( '' != $qv[' static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {1508 } elseif ( '' != $qv['pagename'] || !empty($qv['page_id']) ) { 1510 1509 $this->is_page = true; 1511 1510 $this->is_single = false; -
branches/3.9/tests/phpunit/tests/auth.php
r30468 r46503 94 94 } 95 95 96 /** 97 * @ticket 29217 98 */ 99 function test_wp_verify_nonce_with_empty_arg() { 100 $this->assertFalse( wp_verify_nonce( '' ) ); 101 $this->assertFalse( wp_verify_nonce( null ) ); 102 } 103 104 /** 105 * @ticket 29542 106 */ 107 function test_wp_verify_nonce_with_integer_arg() { 108 $this->assertFalse( wp_verify_nonce( 1 ) ); 109 } 110 111 /** 112 * @ticket 36361 113 */ 114 public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() { 115 $this->setExpectedIncorrectUsage( 'check_admin_referer' ); 116 117 // A valid nonce needs to be set so the check doesn't die() 118 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 119 $result = check_admin_referer(); 120 $this->assertSame( 1, $result ); 121 122 unset( $_REQUEST['_wpnonce'] ); 123 } 124 125 /** 126 * @ticket 36361 127 */ 128 public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() { 129 $this->setExpectedIncorrectUsage( 'check_ajax_referer' ); 130 131 // A valid nonce needs to be set so the check doesn't die() 132 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 133 $result = check_ajax_referer(); 134 $this->assertSame( 1, $result ); 135 136 unset( $_REQUEST['_wpnonce'] ); 137 } 138 96 139 function test_password_length_limit() { 97 140 $passwords = array(
Note: See TracChangeset
for help on using the changeset viewer.