mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Theme Customizer: Allow sanitize_hexcolor to accept the empty string. Fixes default assignment on save and bug where header textcolor would remain hidden if loaded hidden. see #19910.
git-svn-id: http://core.svn.wordpress.org/trunk@20915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fbcc2cb097
commit
ae0212699a
@ -860,8 +860,8 @@ function sanitize_header_textcolor( $color ) {
|
||||
function sanitize_hexcolor( $color ) {
|
||||
$color = preg_replace( '/[^0-9a-fA-F]/', '', $color );
|
||||
|
||||
// 3 or 6 hex digits.
|
||||
if ( preg_match('|^([A-Fa-f0-9]{3}){1,2}$|', $color ) )
|
||||
// 3 or 6 hex digits, or the empty string.
|
||||
if ( preg_match('|^([A-Fa-f0-9]{3}){0,2}$|', $color ) )
|
||||
return $color;
|
||||
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user