Skip to content

Commit 4a9a6c1

Browse files
committed
Ensure strtoupper is not called with '' argument.
1 parent bdd215f commit 4a9a6c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/Generator/CustomerInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CustomerInfo {
1616
* @return string|\WP_Error
1717
*/
1818
public static function get_valid_country_code( ?string $country_code = '' ) {
19-
$country_code = strtoupper( $country_code );
19+
$country_code = !empty( $country_code ) ? strtoupper( $country_code ) : '';
2020

2121
if ( $country_code && ! WC()->countries->country_exists( $country_code ) ) {
2222
$country_code = new \WP_Error(

0 commit comments

Comments
 (0)