Merged in feature/280-dev-dev01 (pull request #21)
auto-patch 280-dev-dev01-2024-01-19T16_41_58 * auto-patch 280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
@@ -281,7 +281,7 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
|
||||
public function sanitize_cost( $value ) {
|
||||
$value = is_null( $value ) ? '' : $value;
|
||||
$value = wp_kses_post( trim( wp_unslash( $value ) ) );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ), wc_get_price_thousand_separator() ), '', $value );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ) ), '', $value );
|
||||
// Thrown an error on the front end if the evaluate_cost will fail.
|
||||
$dummy_cost = $this->evaluate_cost(
|
||||
$value,
|
||||
|
||||
@@ -94,9 +94,12 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
|
||||
public function sanitize_cost( $value ) {
|
||||
$value = is_null( $value ) ? '' : $value;
|
||||
$value = wp_kses_post( trim( wp_unslash( $value ) ) );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ), wc_get_price_thousand_separator() ), '', $value );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ) ), '', $value );
|
||||
|
||||
if ( ! is_numeric( $value ) ) {
|
||||
$test_value = str_replace( wc_get_price_decimal_separator(), '.', $value );
|
||||
$test_value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ), wc_get_price_thousand_separator() ), '', $test_value );
|
||||
|
||||
if ( $test_value && ! is_numeric( $test_value ) ) {
|
||||
throw new Exception( __( 'Please enter a valid number', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -90,9 +90,12 @@ class WC_Shipping_Local_Pickup extends WC_Shipping_Method {
|
||||
public function sanitize_cost( $value ) {
|
||||
$value = is_null( $value ) ? '' : $value;
|
||||
$value = wp_kses_post( trim( wp_unslash( $value ) ) );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ), wc_get_price_thousand_separator() ), '', $value );
|
||||
$value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ) ), '', $value );
|
||||
|
||||
if ( $value && ! is_numeric( $value ) ) {
|
||||
$test_value = str_replace( wc_get_price_decimal_separator(), '.', $value );
|
||||
$test_value = str_replace( array( get_woocommerce_currency_symbol(), html_entity_decode( get_woocommerce_currency_symbol() ), wc_get_price_thousand_separator() ), '', $test_value );
|
||||
|
||||
if ( $test_value && ! is_numeric( $test_value ) ) {
|
||||
throw new Exception( __( 'Please enter a valid number', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user