Changes in branches/4.2 [32300:32311]
- Location:
- branches/4.2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/package.json
r32300 r32311 1 1 { 2 2 "name": "WordPress", 3 "version": "4.2. 0",3 "version": "4.2.1", 4 4 "description": "WordPress is web software you can use to create a beautiful website or blog.", 5 5 "repository": { -
branches/4.2/src/readme.html
r32300 r32311 10 10 <h1 id="logo"> 11 11 <a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a> 12 <br /> Version 4.2 12 <br /> Version 4.2.1 13 13 </h1> 14 14 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
branches/4.2/src/wp-admin/about.php
r32300 r32311 40 40 </a> 41 41 </h2> 42 43 <div class="changelog point-releases"> 44 <h3><?php echo _n( 'Security Release', 'Security Releases', 1 ); ?></h3> 45 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.', 46 '<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.2.1' ); ?> 47 <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.2.1' ); ?> 48 </p> 49 </div> 42 50 43 51 <div class="headline-feature feature-video"> -
branches/4.2/src/wp-admin/includes/upgrade.php
r32300 r32311 527 527 if ( $wp_current_db_version < 31351 ) 528 528 upgrade_420(); 529 530 if ( $wp_current_db_version < 31533 ) 531 upgrade_421(); 529 532 530 533 maybe_disable_link_manager(); … … 1437 1440 1438 1441 /** 1442 * Execute changes made in WordPress 4.2.1. 1443 * 1444 * @since 4.2.1 1445 */ 1446 function upgrade_421() { 1447 global $wp_current_db_version, $wpdb; 1448 1449 if ( $wp_current_db_version < 31533 ) { 1450 $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' ); 1451 if ( ! $content_length ) { 1452 $content_length = 65535; 1453 } 1454 1455 $comments = $wpdb->get_results( 1456 "SELECT comment_ID FROM $wpdb->comments 1457 WHERE comment_date_gmt > '2015-04-26' 1458 AND CHAR_LENGTH( comment_content ) >= $content_length 1459 AND ( comment_content LIKE '%<%' OR comment_content LIKE '%>%' )" 1460 ); 1461 1462 foreach ( $comments as $comment ) { 1463 wp_delete_comment( $comment->comment_ID, true ); 1464 } 1465 } 1466 } 1467 1468 /** 1439 1469 * Executes network-level upgrade routines. 1440 1470 * -
branches/4.2/src/wp-includes/version.php
r32300 r32311 5 5 * @global string $wp_version 6 6 */ 7 $wp_version = '4.2.1- alpha-src';7 $wp_version = '4.2.1-src'; 8 8 9 9 /** … … 12 12 * @global int $wp_db_version 13 13 */ 14 $wp_db_version = 3153 2;14 $wp_db_version = 31533; 15 15 16 16 /** -
branches/4.2/src/wp-includes/wp-db.php
r32300 r32311 1947 1947 protected function process_fields( $table, $data, $format ) { 1948 1948 $data = $this->process_field_formats( $data, $format ); 1949 if ( false === $data ) { 1950 return false; 1951 } 1952 1949 1953 $data = $this->process_field_charsets( $data, $table ); 1954 if ( false === $data ) { 1955 return false; 1956 } 1957 1958 $data = $this->process_field_lengths( $data, $table ); 1950 1959 if ( false === $data ) { 1951 1960 return false; … … 2024 2033 // This isn't ASCII. Don't have strip_invalid_text() re-check. 2025 2034 $value['ascii'] = false; 2035 } 2036 2037 $data[ $field ] = $value; 2038 } 2039 2040 return $data; 2041 } 2042 2043 /** 2044 * For string fields, record the maximum string length that field can safely save. 2045 * 2046 * @since 4.2.1 2047 * @access protected 2048 * 2049 * @param array $data As it comes from the wpdb::process_field_charsets() method. 2050 * @param string $table Table name. 2051 * @return array|False The same array as $data with additional 'length' keys, or false if 2052 * any of the values were too long for their corresponding field. 2053 */ 2054 protected function process_field_lengths( $data, $table ) { 2055 foreach ( $data as $field => $value ) { 2056 if ( '%d' === $value['format'] || '%f' === $value['format'] ) { 2057 // We can skip this field if we know it isn't a string. 2058 // This checks %d/%f versus ! %s because it's sprintf() could take more. 2059 $value['length'] = false; 2060 } else { 2061 $value['length'] = $this->get_col_length( $table, $field ); 2062 if ( is_wp_error( $value['length'] ) ) { 2063 return false; 2064 } 2065 } 2066 2067 if ( false !== $value['length'] && mb_strlen( $value['value'] ) > $value['length'] ) { 2068 return false; 2026 2069 } 2027 2070 … … 2363 2406 2364 2407 /** 2408 * Retrieve the maximum string length allowed in a given column. 2409 * 2410 * @since 4.2.1 2411 * @access public 2412 * 2413 * @param string $table Table name. 2414 * @param string $column Column name. 2415 * @return mixed Max column length as an int. False if the column has no 2416 * length. WP_Error object if there was an error. 2417 */ 2418 public function get_col_length( $table, $column ) { 2419 $tablekey = strtolower( $table ); 2420 $columnkey = strtolower( $column ); 2421 2422 // Skip this entirely if this isn't a MySQL database. 2423 if ( false === $this->is_mysql ) { 2424 return false; 2425 } 2426 2427 if ( empty( $this->col_meta[ $tablekey ] ) ) { 2428 // This primes column information for us. 2429 $table_charset = $this->get_table_charset( $table ); 2430 if ( is_wp_error( $table_charset ) ) { 2431 return $table_charset; 2432 } 2433 } 2434 2435 if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) { 2436 return false; 2437 } 2438 2439 $typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type ); 2440 2441 $type = strtolower( $typeinfo[0] ); 2442 if ( ! empty( $typeinfo[1] ) ) { 2443 $length = trim( $typeinfo[1], ')' ); 2444 } else { 2445 $length = false; 2446 } 2447 2448 switch( $type ) { 2449 case 'binary': 2450 case 'char': 2451 case 'varbinary': 2452 case 'varchar': 2453 return $length; 2454 break; 2455 case 'tinyblob': 2456 case 'tinytext': 2457 return 255; // 2^8 - 1 2458 break; 2459 case 'blob': 2460 case 'text': 2461 return 65535; // 2^16 - 1 2462 break; 2463 case 'mediumblob': 2464 case 'mediumtext': 2465 return 16777215; // 2^24 - 1 2466 break; 2467 case 'longblob': 2468 case 'longtext': 2469 return 4294967295; // 2^32 - 1 2470 break; 2471 default: 2472 return false; 2473 } 2474 2475 return false; 2476 } 2477 2478 /** 2365 2479 * Check if a string is ASCII. 2366 2480 * -
branches/4.2/tests/phpunit/tests/comment.php
r32300 r32311 113 113 } 114 114 } 115 116 public function test_comment_content_length() { 117 // `wp_new_comment()` checks REMOTE_ADDR, so we fake it to avoid PHP notices. 118 if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { 119 $remote_addr = $_SERVER['REMOTE_ADDR']; 120 } else { 121 $_SERVER['REMOTE_ADDR'] = ''; 122 } 123 124 $post_id = $this->factory->post->create(); 125 126 $data = array( 127 'comment_post_ID' => $post_id, 128 'comment_author' => rand_str(), 129 'comment_author_url' => '', 130 'comment_author_email' => '', 131 'comment_type' => '', 132 'comment_content' => str_repeat( 'A', 65536 ), 133 'comment_date' => '2011-01-01 10:00:00', 134 'comment_date_gmt' => '2011-01-01 10:00:00', 135 ); 136 137 $id = wp_new_comment( $data ); 138 139 $this->assertFalse( $id ); 140 141 // Cleanup. 142 if ( isset( $remote_addr ) ) { 143 $_SERVER['REMOTE_ADDR'] = $remote_addr; 144 } else { 145 unset( $_SERVER['REMOTE_ADDR'] ); 146 } 147 } 115 148 } -
branches/4.2/tests/phpunit/tests/db.php
r32300 r32311 748 748 'charset' => $expected_charset, 749 749 'ascii' => false, 750 'length' => $wpdb->get_col_length( $wpdb->posts, 'post_content' ), 750 751 ) 751 752 );
Note: See TracChangeset
for help on using the changeset viewer.