Changeset 46505
- Timestamp:
- 10/14/2019 07:31:55 PM (6 years ago)
- Location:
- branches/3.7
- Files:
-
- 8 edited
-
. (modified) (1 prop)
-
src (modified) (1 prop)
-
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) (3 diffs)
-
src/wp-includes/query.php (modified) (2 diffs)
-
tests/phpunit/tests/auth.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/trunk merged: 46474-46478,46483,46485
- Property svn:mergeinfo changed
-
branches/3.7/src
- Property svn:mergeinfo changed
/trunk/src merged: 46474-46478,46483
- Property svn:mergeinfo changed
-
branches/3.7/src/wp-includes/class-wp.php
r44075 r46505 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.7/src/wp-includes/functions.php
r44012 r46505 1365 1365 if ( file_exists( $target ) ) 1366 1366 return @is_dir( $target ); 1367 1368 // Do not allow path traversals. 1369 if ( false !== strpos( $target, '../' ) || false !== strpos( $target, '..' . DIRECTORY_SEPARATOR ) ) { 1370 return false; 1371 } 1367 1372 1368 1373 // We need to find the permissions of the parent folder that exists and inherit that. -
branches/3.7/src/wp-includes/http.php
r37123 r46505 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.7/src/wp-includes/pluggable.php
r45988 r46505 809 809 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5) 810 810 */ 811 function check_admin_referer( $action = -1, $query_arg = '_wpnonce') {812 if ( -1 == $action )813 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2 ' );811 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 812 if ( -1 === $action ) 813 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 814 814 815 815 $adminurl = strtolower(admin_url()); 816 816 $referer = strtolower(wp_get_referer()); 817 817 $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false; 818 if ( !$result && !(-1 == $action && strpos($referer, $adminurl) === 0) ) { 819 wp_nonce_ays($action); 818 819 /** 820 * Fires once the admin request has been validated or not. 821 * 822 * @since 1.5.1 823 * 824 * @param string $action The nonce action. 825 * @param bool $result Whether the admin request nonce was validated. 826 */ 827 do_action( 'check_admin_referer', $action, $result ); 828 829 if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { 830 wp_nonce_ays( $action ); 820 831 die(); 821 832 } 822 do_action('check_admin_referer', $action, $result); 833 823 834 return $result; 824 835 } … … 835 846 */ 836 847 function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { 848 if ( -1 === $action ) 849 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 850 837 851 $nonce = ''; 838 852 … … 1812 1826 } 1813 1827 endif; 1814 1815 if ( ! function_exists( 'hash_equals' ) ) :1816 /**1817 * Compare two strings in constant time.1818 *1819 * This function is NOT pluggable. It is in this file (in addition to1820 * compat.php) to prevent errors if, during an update, pluggable.php1821 * copies over but compat.php does not.1822 *1823 * This function was added in PHP 5.6.1824 * It can leak the length of a string.1825 *1826 * @since 3.9.21827 *1828 * @param string $a Expected string.1829 * @param string $b Actual string.1830 * @return bool Whether strings are equal.1831 */1832 function hash_equals( $a, $b ) {1833 $a_length = strlen( $a );1834 if ( $a_length !== strlen( $b ) ) {1835 return false;1836 }1837 $result = 0;1838 1839 // Do not attempt to "optimize" this.1840 for ( $i = 0; $i < $a_length; $i++ ) {1841 $result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );1842 }1843 1844 return $result === 0;1845 }1846 endif; -
branches/3.7/src/wp-includes/query.php
r39966 r46505 1394 1394 , 'attachment_id' 1395 1395 , 'name' 1396 , 'static'1397 1396 , 'pagename' 1398 1397 , 'page_id' … … 1502 1501 // post is being queried. 1503 1502 $this->is_single = true; 1504 } elseif ( '' != $qv[' static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {1503 } elseif ( '' != $qv['pagename'] || !empty($qv['page_id']) ) { 1505 1504 $this->is_page = true; 1506 1505 $this->is_single = false; -
branches/3.7/tests/phpunit/tests/auth.php
r30470 r46505 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.