@@ -561,7 +561,7 @@ public function update_single_currency_settings( string $currency_code, string $
561
561
if ( ! is_numeric ( $ manual_rate ) || 0 >= $ manual_rate ) {
562
562
$ message = 'Invalid manual currency rate passed to update_single_currency_settings: ' . $ manual_rate ;
563
563
Logger::error ( $ message );
564
- throw new InvalidCurrencyRateException ( $ message , 'wcpay_multi_currency_invalid_currency_rate ' , 500 );
564
+ throw new InvalidCurrencyRateException ( esc_html ( $ message ) , 'wcpay_multi_currency_invalid_currency_rate ' , 500 );
565
565
}
566
566
update_option ( 'wcpay_multi_currency_manual_rate_ ' . $ currency_code , $ manual_rate );
567
567
}
@@ -935,7 +935,7 @@ public function get_raw_conversion( float $amount, string $to_currency, string $
935
935
if ( 0 >= $ from_currency_rate ) {
936
936
$ message = 'Invalid rate for from_currency in get_raw_conversion: ' . $ from_currency_rate ;
937
937
Logger::error ( $ message );
938
- throw new InvalidCurrencyRateException ( $ message , 'wcpay_multi_currency_invalid_currency_rate ' , 500 );
938
+ throw new InvalidCurrencyRateException ( esc_html ( $ message ) , 'wcpay_multi_currency_invalid_currency_rate ' , 500 );
939
939
}
940
940
941
941
$ amount = $ amount * ( $ to_currency_rate / $ from_currency_rate );
@@ -1019,6 +1019,8 @@ public function display_geolocation_currency_update_notice() {
1019
1019
$ notice_id = md5 ( $ message );
1020
1020
1021
1021
echo '<p class="woocommerce-store-notice demo_store" data-notice-id=" ' . esc_attr ( $ notice_id . 2 ) . '" style="display:none;"> ' ;
1022
+ // No need to escape here as the function called handles it.
1023
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1022
1024
echo \WC_Payments_Utils::esc_interpolated_html (
1023
1025
$ message ,
1024
1026
[
@@ -1624,7 +1626,7 @@ public function is_initialized(): bool {
1624
1626
private function log_and_throw_invalid_currency_exception ( $ method , $ currency_code , $ code = 500 ) {
1625
1627
$ message = 'Invalid currency passed to ' . $ method . ': ' . $ currency_code ;
1626
1628
Logger::error ( $ message );
1627
- throw new InvalidCurrencyException ( $ message , 'wcpay_multi_currency_invalid_currency ' , $ code );
1629
+ throw new InvalidCurrencyException ( esc_html ( $ message ) , 'wcpay_multi_currency_invalid_currency ' , esc_html ( $ code ) );
1628
1630
}
1629
1631
1630
1632
/**
0 commit comments