Changeset 32316
- Timestamp:
- 04/27/2015 06:29:08 PM (9 years ago)
- Location:
- branches/3.9
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/package.json
r32284 r32316 1 1 { 2 2 "name": "WordPress", 3 "version": "3.9. 5",3 "version": "3.9.6", 4 4 "description": "WordPress is web software you can use to create a beautiful website or blog.", 5 5 "repository": { -
branches/3.9/src/readme.html
r32284 r32316 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 3.9. 512 <br /> Version 3.9.6 13 13 </h1> 14 14 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
branches/3.9/src/wp-admin/about.php
r32284 r32316 40 40 41 41 <div class="changelog point-releases"> 42 <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 5 ); ?></h3> 42 <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 6 ); ?></h3> 43 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.', 44 '<strong>Version %1$s</strong> addressed some security issues.', 1 ), '3.9.6' ); ?> 45 <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.9.6' ); ?> 46 </p> 43 47 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.', 44 48 '<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '3.9.5', number_format_i18n( 1 ) ); ?> -
branches/3.9/src/wp-admin/includes/upgrade.php
r27998 r32316 431 431 upgrade_380(); 432 432 433 if ( $wp_current_db_version < 27917 ) 434 upgrade_396(); 435 433 436 maybe_disable_link_manager(); 434 437 … … 1271 1274 } 1272 1275 } 1276 1277 /** 1278 * Execute changes made in WordPress 3.9.6. 1279 * 1280 * @since 3.9.6 1281 */ 1282 function upgrade_396() { 1283 global $wp_current_db_version, $wpdb; 1284 1285 if ( $wp_current_db_version < 27917 ) { 1286 $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' ); 1287 if ( ! $content_length ) { 1288 $content_length = 65535; 1289 } 1290 1291 $comments = $wpdb->get_results( 1292 "SELECT comment_ID FROM $wpdb->comments 1293 WHERE comment_date_gmt > '2015-04-26' 1294 AND CHAR_LENGTH( comment_content ) >= $content_length 1295 AND ( comment_content LIKE '%<%' OR comment_content LIKE '%>%' )" 1296 ); 1297 1298 foreach ( $comments as $comment ) { 1299 wp_delete_comment( $comment->comment_ID, true ); 1300 } 1301 } 1302 } 1303 1273 1304 /** 1274 1305 * Execute network level changes -
branches/3.9/src/wp-includes/version.php
r32303 r32316 12 12 * @global int $wp_db_version 13 13 */ 14 $wp_db_version = 2791 6;14 $wp_db_version = 27917; 15 15 16 16 /** -
branches/3.9/src/wp-includes/wp-db.php
r32273 r32316 1894 1894 protected function process_fields( $table, $data, $format ) { 1895 1895 $data = $this->process_field_formats( $data, $format ); 1896 if ( false === $data ) { 1897 return false; 1898 } 1899 1896 1900 $data = $this->process_field_charsets( $data, $table ); 1901 if ( false === $data ) { 1902 return false; 1903 } 1904 1905 $data = $this->process_field_lengths( $data, $table ); 1897 1906 if ( false === $data ) { 1898 1907 return false; … … 1971 1980 // This isn't ASCII. Don't have strip_invalid_text() re-check. 1972 1981 $value['ascii'] = false; 1982 } 1983 1984 $data[ $field ] = $value; 1985 } 1986 1987 return $data; 1988 } 1989 1990 /** 1991 * For string fields, record the maximum string length that field can safely save. 1992 * 1993 * @since 4.2.1 1994 * @access protected 1995 * 1996 * @param array $data As it comes from the wpdb::process_field_charsets() method. 1997 * @param string $table Table name. 1998 * @return array|False The same array as $data with additional 'length' keys, or false if 1999 * any of the values were too long for their corresponding field. 2000 */ 2001 protected function process_field_lengths( $data, $table ) { 2002 foreach ( $data as $field => $value ) { 2003 if ( '%d' === $value['format'] || '%f' === $value['format'] ) { 2004 // We can skip this field if we know it isn't a string. 2005 // This checks %d/%f versus ! %s because it's sprintf() could take more. 2006 $value['length'] = false; 2007 } else { 2008 $value['length'] = $this->get_col_length( $table, $field ); 2009 if ( is_wp_error( $value['length'] ) ) { 2010 return false; 2011 } 2012 } 2013 2014 if ( false !== $value['length'] && strlen( $value['value'] ) > $value['length'] ) { 2015 return false; 1973 2016 } 1974 2017 … … 2300 2343 2301 2344 /** 2345 * Retrieve the maximum string length allowed in a given column. 2346 * 2347 * @since 4.2.1 2348 * @access public 2349 * 2350 * @param string $table Table name. 2351 * @param string $column Column name. 2352 * @return mixed Max column length as an int. False if the column has no 2353 * length. WP_Error object if there was an error. 2354 */ 2355 public function get_col_length( $table, $column ) { 2356 $tablekey = strtolower( $table ); 2357 $columnkey = strtolower( $column ); 2358 2359 // Skip this entirely if this isn't a MySQL database. 2360 if ( false === $this->is_mysql ) { 2361 return false; 2362 } 2363 2364 if ( empty( $this->col_meta[ $tablekey ] ) ) { 2365 // This primes column information for us. 2366 $table_charset = $this->get_table_charset( $table ); 2367 if ( is_wp_error( $table_charset ) ) { 2368 return $table_charset; 2369 } 2370 } 2371 2372 if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) { 2373 return false; 2374 } 2375 2376 $typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type ); 2377 2378 $type = strtolower( $typeinfo[0] ); 2379 if ( ! empty( $typeinfo[1] ) ) { 2380 $length = trim( $typeinfo[1], ')' ); 2381 } else { 2382 $length = false; 2383 } 2384 2385 switch( $type ) { 2386 case 'binary': 2387 case 'char': 2388 case 'varbinary': 2389 case 'varchar': 2390 return $length; 2391 break; 2392 case 'tinyblob': 2393 case 'tinytext': 2394 return 255; // 2^8 - 1 2395 break; 2396 case 'blob': 2397 case 'text': 2398 return 65535; // 2^16 - 1 2399 break; 2400 case 'mediumblob': 2401 case 'mediumtext': 2402 return 16777215; // 2^24 - 1 2403 break; 2404 case 'longblob': 2405 case 'longtext': 2406 return 4294967295; // 2^32 - 1 2407 break; 2408 default: 2409 return false; 2410 } 2411 2412 return false; 2413 } 2414 2415 /** 2302 2416 * Check if a string is ASCII. 2303 2417 * -
branches/3.9/tests/phpunit/tests/comment.php
r25002 r32316 15 15 $this->assertEquals( 0, $result ); 16 16 } 17 18 public function test_comment_content_length() { 19 // `wp_new_comment()` checks REMOTE_ADDR, so we fake it to avoid PHP notices. 20 if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { 21 $remote_addr = $_SERVER['REMOTE_ADDR']; 22 } else { 23 $_SERVER['REMOTE_ADDR'] = ''; 24 } 25 26 $post_id = $this->factory->post->create(); 27 28 $data = array( 29 'comment_post_ID' => $post_id, 30 'comment_author' => rand_str(), 31 'comment_author_url' => '', 32 'comment_author_email' => '', 33 'comment_type' => '', 34 'comment_content' => str_repeat( 'A', 65536 ), 35 'comment_date' => '2011-01-01 10:00:00', 36 'comment_date_gmt' => '2011-01-01 10:00:00', 37 ); 38 39 $id = wp_new_comment( $data ); 40 41 $this->assertFalse( $id ); 42 43 // Cleanup. 44 if ( isset( $remote_addr ) ) { 45 $_SERVER['REMOTE_ADDR'] = $remote_addr; 46 } else { 47 unset( $_SERVER['REMOTE_ADDR'] ); 48 } 49 } 17 50 } -
branches/3.9/tests/phpunit/tests/db.php
r32182 r32316 614 614 'charset' => $expected_charset, 615 615 'ascii' => false, 616 'length' => $wpdb->get_col_length( $wpdb->posts, 'post_content' ), 616 617 ) 617 618 );
Note: See TracChangeset
for help on using the changeset viewer.