Make WordPress Core

Changeset 52463


Ignore:
Timestamp:
01/06/2022 05:27:15 PM (2 years ago)
Author:
desrosj
Message:

Upgrade/Install: Avoid using unserialize() unnecessarily.

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

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

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

    r51088 r52463  
    16131613        while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) {
    16141614            foreach ( $rows as $row ) {
    1615                 $value = $row->option_value;
    1616                 if ( ! @unserialize( $value ) ) {
     1615                $value = maybe_unserialize( $row->option_value );
     1616                if ( $value === $row->option_value ) {
    16171617                    $value = stripslashes( $value );
    16181618                }
Note: See TracChangeset for help on using the changeset viewer.