mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
Hardening: Add escaping to the language attributes used on html
elements.
Merges [42259] to the 4.3 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.3@42289 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9ecf1ec6ba
commit
ef20417bf3
@ -2627,12 +2627,14 @@ function get_language_attributes( $doctype = 'html' ) {
|
||||
if ( function_exists( 'is_rtl' ) && is_rtl() )
|
||||
$attributes[] = 'dir="rtl"';
|
||||
|
||||
if ( $lang = get_bloginfo('language') ) {
|
||||
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
|
||||
$attributes[] = "lang=\"$lang\"";
|
||||
if ( $lang = get_bloginfo( 'language' ) ) {
|
||||
if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
|
||||
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
|
||||
if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
|
||||
$attributes[] = "xml:lang=\"$lang\"";
|
||||
if ( get_option( 'html_type' ) != 'text/html' || $doctype == 'xhtml' ) {
|
||||
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
}
|
||||
|
||||
$output = implode(' ', $attributes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user