wordpress-develop
wordpress-develop copied to clipboard
Fix: Default to UTF-8 for empty blog_charset values
Trac ticket: https://core.trac.wordpress.org/ticket/25693
Changes Made
- Added a new function
_wp_ensure_blog_charsetinwp-includes/option.phpthat returns 'UTF-8' when the charset is empty - Registered this function as a filter on
'option_blog_charset'with priority 9 in default-filters.php to ensure it runs before other charset-handling functions - Modified
is_utf8_charsetand_canonical_charsetfunctions infunctions.phpto properly handle empty values - Added comprehensive unit tests to verify the changes
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.