From 638ef7815ec29318434365ffde1d3cef7437b948 Mon Sep 17 00:00:00 2001 From: desrosj Date: Thu, 6 Jan 2022 17:07:03 +0000 Subject: [PATCH] Upgrade/Install: Avoid using `unserialize()` unnecessarily. Props vortfu, xknown, dd32. Built from https://develop.svn.wordpress.org/trunk@52456 git-svn-id: http://core.svn.wordpress.org/trunk@52048 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index f00595a55b..96997518a1 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1625,8 +1625,8 @@ function upgrade_280() { $start = 0; while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) { foreach ( $rows as $row ) { - $value = $row->option_value; - if ( ! @unserialize( $value ) ) { + $value = maybe_unserialize( $row->option_value ); + if ( $value === $row->option_value ) { $value = stripslashes( $value ); } if ( $value !== $row->option_value ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index a9ca645130..8db4c50615 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52455'; +$wp_version = '6.0-alpha-52456'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.