Plugin Updates

This commit is contained in:
Tony Volpe
2024-04-02 20:23:21 +00:00
parent 96800520e8
commit 94170ec2c4
1514 changed files with 133309 additions and 105985 deletions

View File

@@ -232,7 +232,7 @@ function wc_trim_zeros( $price ) {
* @return float
*/
function wc_round_tax_total( $value, $precision = null ) {
$precision = is_null( $precision ) ? wc_get_price_decimals() : intval( $precision );
$precision = is_null( $precision ) ? wc_get_price_decimals() : intval( $precision );
$rounded_tax = NumberUtil::round( $value, $precision, wc_get_tax_rounding_mode() ); // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctionParameters.round_modeFound
return apply_filters( 'wc_round_tax_total', $rounded_tax, $value, $precision, WC_TAX_ROUNDING_MODE );
@@ -371,15 +371,17 @@ function wc_format_coupon_code( $value ) {
/**
* Sanitize a coupon code.
*
* Uses sanitize_post_field since coupon codes are stored as
* post_titles - the sanitization and escaping must match.
* Uses sanitize_post_field since coupon codes are stored as post_titles - the sanitization and escaping must match.
*
* Due to the unfiltered_html captability that some (admin) users have, we need to account for slashes.
*
* @since 3.6.0
* @param string $value Coupon code to format.
* @return string
*/
function wc_sanitize_coupon_code( $value ) {
return wp_filter_kses( sanitize_post_field( 'post_title', $value ?? '', 0, 'db' ) );
$value = wp_kses( sanitize_post_field( 'post_title', $value ?? '', 0, 'db' ), 'entities' );
return current_user_can( 'unfiltered_html' ) ? $value : stripslashes( $value );
}
/**