Formatting: Avoid a PHP 7.2 warning in wp_kses_attr() when one of $allowedtags elements is an uncountable value.

Props andrei0x309, soulseekah, SergeyBiryukov.
Merges [42860] to the 4.9 branch.
Fixes #43312.
Built from https://develop.svn.wordpress.org/branches/4.9@42861


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-03-20 21:37:41 +00:00
parent 6d16a905b8
commit 8fae65141a
2 changed files with 3 additions and 2 deletions

View File

@ -827,7 +827,8 @@ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
$xhtml_slash = ' /';
// Are any attributes allowed at all for this element?
if ( ! isset( $allowed_html[ strtolower( $element ) ] ) || true === $allowed_html[ strtolower( $element ) ] || count( $allowed_html[ strtolower( $element ) ] ) == 0 ) {
$element_low = strtolower( $element );
if ( empty( $allowed_html[ $element_low ] ) || true === $allowed_html[ $element_low ] ) {
return "<$element$xhtml_slash>";
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.5-alpha-42859';
$wp_version = '4.9.5-alpha-42861';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.