Make WordPress Core

Changeset 58338


Ignore:
Timestamp:
06/04/2024 07:32:36 PM (11 months ago)
Author:
joemcgill
Message:

Site Health: Ensure each alloptions value is serialized.

This adds additional hardening to the Autoload options Health Check to avoid potential bugs when extenders return unserialzed values from wp_load_alloptions().

Follow-up to [58332].

Props mukesh27, joemcgill, westonruter.
Fixes #61276.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r58332 r58338  
    25992599        $total_length = 0;
    26002600
    2601         foreach ( $alloptions as $option_name => $option_value ) {
    2602             $total_length += strlen( $option_value );
     2601        foreach ( $alloptions as $option_value ) {
     2602            if ( is_array( $option_value ) || is_object( $option_value ) ) {
     2603                $option_value = maybe_serialize( $option_value );
     2604            }
     2605            $total_length += strlen( (string) $option_value );
    26032606        }
    26042607
Note: See TracChangeset for help on using the changeset viewer.