Merge pull request #6228 from woothemes/tax-settings-escape
Escape js array labels.
This commit is contained in:
commit
f72d041167
|
@ -480,7 +480,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
||||||
var availableCountries = [<?php
|
var availableCountries = [<?php
|
||||||
$countries = array();
|
$countries = array();
|
||||||
foreach ( WC()->countries->get_allowed_countries() as $value => $label )
|
foreach ( WC()->countries->get_allowed_countries() as $value => $label )
|
||||||
$countries[] = '{ label: "' . $label . '", value: "' . $value . '" }';
|
$countries[] = '{ label: "' . esc_attr( $label ) . '", value: "' . $value . '" }';
|
||||||
echo implode( ', ', $countries );
|
echo implode( ', ', $countries );
|
||||||
?>];
|
?>];
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
||||||
$countries = array();
|
$countries = array();
|
||||||
foreach ( WC()->countries->get_allowed_country_states() as $value => $label )
|
foreach ( WC()->countries->get_allowed_country_states() as $value => $label )
|
||||||
foreach ( $label as $code => $state )
|
foreach ( $label as $code => $state )
|
||||||
$countries[] = '{ label: "' . $state . '", value: "' . $code . '" }';
|
$countries[] = '{ label: "' . esc_attr( $state ) . '", value: "' . $code . '" }';
|
||||||
echo implode( ', ', $countries );
|
echo implode( ', ', $countries );
|
||||||
?>];
|
?>];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue