#65913 closed defect (bug) (duplicate)
Fix trailing space in 'width ' key in WP_Site_Icon::additional_sizes()
| Reported by: | analogstudio | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Media | Version: | |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
There is a typo in the array key returned by WP_Site_Icon::additional_sizes().
Problem
In wp-admin/includes/class-wp-site-icon.php:L174, a trailing space is accidentally included in the 'width ' key:
<?php $only_crop_sizes[ 'site_icon-' .$size ] = array( 'width ' => $size, // Trailing space in key 'height' => $size, 'crop' => true, );
While WordPress core itself does not directly reference $datawidth from this specific return value, plugins or third-party developers inspecting image sizes via the intermediate_image_sizes_advanced filter or accessing this array will encounter null or undefined index errors when attempting to read $sizewidth.
Proposed Fix
Remove the trailing space from 'width ' so it becomes 'width'.
<?php $only_crop_sizes[ 'site_icon-' .$size ] = array( 'width' => $size, // Fixed key 'height' => $size, 'crop' => true, );
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #65345.