Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#64581 new feature request

Allow serialized options read-only view

Reported by: anatolinicolae's profile anatolinicolae Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: trunk
Component: Options, Meta APIs Keywords: has-patch
Focuses: ui, administration Cc:

Description

The options.php page currently overwrites an option value when it is serialized with 'SERIALIZED DATA'.

However, these values will most likely never be changed manually as it would require users to deserialize, edit and serialize it back via some manually crafted script, while it still does make sense to display the proper value regardless for i.e. debugging purposes without looking up keys in the DB.

Patch could be as simple as returning $value = $option->option_value; in options.php assuming there's no further concerns with this page scope. Keeping $disabled = true; would prevent manual editing, while having no impact on eventual save.

Permissions would still apply and this page would only remain visible to admins (not even linked anywhere AFAIK). There are no further security concerns about the option value, as non-serialized options already expose their values.

Change History (2)

This ticket was mentioned in PR #10853 on WordPress/wordpress-develop by @Presskopp.


5 weeks ago
#1

  • Keywords has-patch added

Fixes https://core.trac.wordpress.org/ticket/64581

This replaces the hard-coded "SERIALIZED DATA" placeholder in
wp-admin/options.php with a read-only display of the actual
unserialized option value.

#2 @Presskopp
5 weeks ago

When taking this change into account, we should be aware that the same code is present in network/site-settings.php. Note: Because it's a debug page, no i18n is taking place.

Note: See TracTickets for help on using tickets.