From bc34e6fb13cc3d1e78a182c021760c12604dc591 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 6 Jan 2022 17:04:51 +0000 Subject: [PATCH] Upgrade/Install: Avoid using `unserialize()` unnecessarily. Props vortfu, xknown, dd32. git-svn-id: https://develop.svn.wordpress.org/trunk@52456 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index f00595a55b..96997518a1 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/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 ) {