Skip to content

Commit

Permalink
Update UrlValidator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
salmanalee authored Oct 25, 2023
1 parent 501815f commit cb00f24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/PayPal/Validation/UrlValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UrlValidator
*/
public static function validate($url, $urlName = null)
{
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
if (!is_null($url) && !empty($url) && filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new \InvalidArgumentException("$urlName is not a fully qualified URL");
}
}
Expand Down

0 comments on commit cb00f24

Please sign in to comment.