Skip to content

Commit

Permalink
Update vatchecker.php
Browse files Browse the repository at this point in the history
ltrim after checking it's not empty! (php 8.1 compatibility)
  • Loading branch information
NKoonen authored Dec 16, 2022
1 parent 0f9e520 commit efbbde9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vatchecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,13 @@ public function checkVat( $vatNumber, $countryCode )
return $return;
}

$vatNumber = ltrim( $vatNumber, $countryCode );

if ( ! $vatNumber ) {
$return['error'] = $this->l( 'Please provide a VAT number' );
self::$cache[ $cache_key ] = $return;
return $return;
}

$vatNumber = ltrim( $vatNumber, $countryCode );

if ( ! $this->isVatFormat( $vatNumber ) ) {
$return['error'] = $this->l( 'VAT number format invalid' );
Expand Down

0 comments on commit efbbde9

Please sign in to comment.