Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20915] trunk/wp-includes/class-wp-customize-manager.php: Theme Customizer: Allow sanitize_hexcolor to accept the empty string. Date:Fri, 25 May 2012 20:58:49 +0000 (UTC)
 

Revision
20915
Author
koopersmith
Date
2012-05-25 20:58:49 +0000 (Fri, 25 May 2012)

Log Message

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.

Modified Paths

Diff

Modified: trunk/wp-includes/class-wp-customize-manager.php (20914 => 20915)


--- trunk/wp-includes/class-wp-customize-manager.php	2012-05-25 20:58:23 UTC (rev 20914)
+++ trunk/wp-includes/class-wp-customize-manager.php	2012-05-25 20:58:49 UTC (rev 20915)
@@ -860,8 +860,8 @@
 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;