From 9037f65f7ab314897eb9bf29c91080807c18fafd Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 27 Apr 2015 17:13:24 +0000 Subject: [PATCH] 4.1: When upgrading, remove any suspicious comments. Built from https://develop.svn.wordpress.org/branches/4.1@32312 git-svn-id: http://core.svn.wordpress.org/branches/4.1@32283 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- readme.html | 2 +- wp-admin/about.php | 6 +++++- wp-admin/includes/upgrade.php | 30 ++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/readme.html b/readme.html index 09f0376eb2..0d2eac701b 100644 --- a/readme.html +++ b/readme.html @@ -9,7 +9,7 @@

WordPress -
Version 4.1.3 +
Version 4.1.4

Semantic Personal Publishing Platform

diff --git a/wp-admin/about.php b/wp-admin/about.php index b0ec9a4366..04dc411c49 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -42,7 +42,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
-

+

+

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

Version %1$s addressed %2$s bug.', 'Version %1$s addressed %2$s bugs.', 1 ), '4.1.3', number_format_i18n( 1 ) ); ?> the release notes.' ), 'http://codex.wordpress.org/Version_4.1.3' ); ?> diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 15a1097fe8..b8e3701158 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -442,6 +442,9 @@ function upgrade_all() { if ( $wp_current_db_version < 29630 ) upgrade_400(); + if ( $wp_current_db_version < 30134 ) + upgrade_414(); + maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -1328,6 +1331,33 @@ function upgrade_400() { } } +/** + * Execute changes made in WordPress 4.1.4. + * + * @since 4.1.3 + */ +function upgrade_414() { + global $wp_current_db_version, $wpdb; + + if ( $wp_current_db_version < 30134 ) { + $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 ); + } + } +} + /** * Execute network level changes * diff --git a/wp-includes/version.php b/wp-includes/version.php index 230e1715ab..0684eb84c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -11,7 +11,7 @@ $wp_version = '4.1.4'; * * @global int $wp_db_version */ -$wp_db_version = 30133; +$wp_db_version = 30134; /** * Holds the TinyMCE version