Charset: Allow `_canonical_charset()` to handle mixed-case strings.
Add improved unit tests, and collect existing unit tests together. Props pbearne. Fixes #38337. Built from https://develop.svn.wordpress.org/trunk@38809 git-svn-id: http://core.svn.wordpress.org/trunk@38752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f76fa00288
commit
f6d85de626
|
@ -5250,13 +5250,15 @@ function get_tag_regex( $tag ) {
|
|||
* @return string The canonical form of the charset.
|
||||
*/
|
||||
function _canonical_charset( $charset ) {
|
||||
if ( 'UTF-8' === $charset || 'utf-8' === $charset || 'utf8' === $charset ||
|
||||
'UTF8' === $charset )
|
||||
return 'UTF-8';
|
||||
if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset) ) {
|
||||
|
||||
return 'UTF-8';
|
||||
}
|
||||
|
||||
if ( 'iso-8859-1' === strtolower( $charset ) || 'iso8859-1' === strtolower( $charset ) ) {
|
||||
|
||||
if ( 'ISO-8859-1' === $charset || 'iso-8859-1' === $charset ||
|
||||
'iso8859-1' === $charset || 'ISO8859-1' === $charset )
|
||||
return 'ISO-8859-1';
|
||||
}
|
||||
|
||||
return $charset;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-alpha-38808';
|
||||
$wp_version = '4.7-alpha-38809';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue