Make WordPress Core


Ignore:
Timestamp:
01/06/2022 05:26:43 PM (3 years ago)
Author:
desrosj
Message:

Upgrade/Install: Avoid using unserialize() unnecessarily.

Merges [52456] to the 5.9 branch.
Props vortfu, xknown, dd32.

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

  • branches/5.9/src/wp-admin/includes/upgrade.php

    r52360 r52462  
    16221622        while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) {
    16231623            foreach ( $rows as $row ) {
    1624                 $value = $row->option_value;
    1625                 if ( ! @unserialize( $value ) ) {
     1624                $value = maybe_unserialize( $row->option_value );
     1625                if ( $value === $row->option_value ) {
    16261626                    $value = stripslashes( $value );
    16271627                }
Note: See TracChangeset for help on using the changeset viewer.