From a3a76fe665dfb62508a66542390a93445f1f7a59 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 27 Apr 2015 17:10:29 +0000 Subject: [PATCH] 4.2: When upgrading, remove any suspicious comments. Built from https://develop.svn.wordpress.org/branches/4.2@32311 git-svn-id: http://core.svn.wordpress.org/branches/4.2@32282 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- readme.html | 2 +- wp-admin/about.php | 8 ++++++++ wp-admin/includes/upgrade.php | 30 ++++++++++++++++++++++++++++++ wp-includes/version.php | 4 ++-- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/readme.html b/readme.html index f09135ac51..1aea37e067 100644 --- a/readme.html +++ b/readme.html @@ -9,7 +9,7 @@

WordPress -
Version 4.2 +
Version 4.2.1

Semantic Personal Publishing Platform

diff --git a/wp-admin/about.php b/wp-admin/about.php index 57c00d0cd7..a1f16d3e29 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -40,6 +40,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); +
+

+

Version %1$s addressed a security issue.', + 'Version %1$s addressed some security issues.', 1 ), '4.2.1' ); ?> + the release notes.' ), 'http://codex.wordpress.org/Version_4.2.1' ); ?> +

+
+
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index b1c4bc28fa..9803f88b42 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -527,6 +527,9 @@ function upgrade_all() { if ( $wp_current_db_version < 31351 ) upgrade_420(); + if ( $wp_current_db_version < 31533 ) + upgrade_421(); + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -1435,6 +1438,33 @@ function upgrade_420() { } } +/** + * Execute changes made in WordPress 4.2.1. + * + * @since 4.2.1 + */ +function upgrade_421() { + global $wp_current_db_version, $wpdb; + + if ( $wp_current_db_version < 31533 ) { + $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' ); + if ( ! $content_length ) { + $content_length = 65535; + } + + $comments = $wpdb->get_results( + "SELECT comment_ID FROM $wpdb->comments + WHERE comment_date_gmt > '2015-04-26' + AND CHAR_LENGTH( comment_content ) >= $content_length + AND ( comment_content LIKE '%<%' OR comment_content LIKE '%>%' )" + ); + + foreach ( $comments as $comment ) { + wp_delete_comment( $comment->comment_ID, true ); + } + } +} + /** * Executes network-level upgrade routines. * diff --git a/wp-includes/version.php b/wp-includes/version.php index cdd4d0a90d..61d686739c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,14 +4,14 @@ * * @global string $wp_version */ -$wp_version = '4.2.1-alpha'; +$wp_version = '4.2.1'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ -$wp_db_version = 31532; +$wp_db_version = 31533; /** * Holds the TinyMCE version