mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Sanitization: when falling back to (wait for it...) $fallback in sanitize_html_class(), sanitize it as well.
Props MikeHansenMe, wonderboymusic. Fixes #30967. git-svn-id: https://develop.svn.wordpress.org/trunk@34377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
90fb9480d1
commit
fc1980e369
@ -1600,9 +1600,9 @@ function sanitize_html_class( $class, $fallback = '' ) {
|
||||
//Limit to A-Z,a-z,0-9,_,-
|
||||
$sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized );
|
||||
|
||||
if ( '' == $sanitized )
|
||||
$sanitized = $fallback;
|
||||
|
||||
if ( '' == $sanitized && $fallback ) {
|
||||
return sanitize_html_class( $fallback );
|
||||
}
|
||||
/**
|
||||
* Filter a sanitized HTML class string.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user