Convert html entities in script localization strings, see #11520
git-svn-id: https://develop.svn.wordpress.org/trunk@18804 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c9c3eb7a6d
commit
440ea79d5e
@ -62,7 +62,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
$after = $data['l10n_print_after'];
|
$after = $data['l10n_print_after'];
|
||||||
unset($data['l10n_print_after']);
|
unset($data['l10n_print_after']);
|
||||||
}
|
}
|
||||||
$output = "var $name = " . json_encode($data) . "; $after\n";
|
$output = "var $name = " . json_encode( html_entity_decode($data, ENT_QUOTES, 'UTF-8') ) . "; $after\n";
|
||||||
} else {
|
} else {
|
||||||
$data = $this->get_data( $handle, 'data' );
|
$data = $this->get_data( $handle, 'data' );
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class WP_Scripts extends WP_Dependencies {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach ( (array) $data as $name => $data ) {
|
foreach ( (array) $data as $name => $data ) {
|
||||||
$output = "var $name = " . json_encode($data) . ";\n";
|
$output = "var $name = " . json_encode( html_entity_decode($data, ENT_QUOTES, 'UTF-8') ) . ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user