Pledges: URL encode JSON data to avoid i18n character issues.

This commit is contained in:
Ian Dunn 2019-10-21 12:24:10 -07:00
parent 609ff42620
commit cc5303fa11
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB

View file

@ -60,7 +60,10 @@ function enqueue_scripts() {
);
}
$inline_script = sprintf( 'var fiveFutureCompanies = %s;', wp_json_encode( $companies ) );
$inline_script = sprintf(
'var fiveFutureCompanies = JSON.parse( decodeURIComponent( \'%s\' ) );',
rawurlencode( wp_json_encode( $companies ) )
);
wp_enqueue_style( '5ftf-front-end' );
wp_enqueue_script( '5ftf-list' );