Skip to content

Commit

Permalink
Merge pull request #137 from Nikschavan/fix/136-dont-urldecode-null
Browse files Browse the repository at this point in the history
fix: PHP warning when in Utils::mb_parse_url()
  • Loading branch information
GaryJones authored Sep 30, 2024
2 parents 69a7634 + 9990fea commit 32fc3eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function ( $matches ) {

$parts = wp_parse_url( $encoded_url, $component );

if ( null === $parts ) {
return null;
}

if ( false === $parts ) {
throw new \InvalidArgumentException( 'Malformed URL: ' . $url );
}
Expand Down

0 comments on commit 32fc3eb

Please sign in to comment.