From a172e31c9e1d3cdd7ef9369cf0d09c092e6264e3 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 30 Jan 2024 14:23:06 +0000 Subject: [PATCH] Install: When populating options, maybe_serialize instead of always serialize. Props xknown, peterwilsoncc, jorbin, desrosj. git-svn-id: https://develop.svn.wordpress.org/trunk@57389 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/schema.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index d339af3b17..20648d7dde 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -599,14 +599,12 @@ function populate_options( array $options = array() ) { $autoload = 'yes'; } - if ( is_array( $value ) ) { - $value = serialize( $value ); - } - if ( ! empty( $insert ) ) { $insert .= ', '; } + $value = maybe_serialize( sanitize_option( $option, $value ) ); + $insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload ); }