Skip to content

Commit

Permalink
Install: When populating options, maybe_serialize instead of always s…
Browse files Browse the repository at this point in the history
…erialize.

Props xknown, peterwilsoncc, jorbin, desrosj.


git-svn-id: https://develop.svn.wordpress.org/trunk@57389 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
aaronjorbin committed Jan 30, 2024
1 parent 9573b33 commit a172e31
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/wp-admin/includes/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit a172e31

Please sign in to comment.