Skip to content

Commit

Permalink
Use pattern in favor of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
atanas-dev committed Apr 16, 2019
1 parent 74fcbca commit 1eb96e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protected function removeProtocol( $url ) {
*/
protected function isExternalUrl( $url, $home_url ) {
$delimiter = '~';
$regex_home_url = preg_quote( $home_url, $delimiter );
$regex = $delimiter . '^' . $regex_home_url . $delimiter . 'i';
return ! preg_match( $regex, $url );
$pattern_home_url = preg_quote( $home_url, $delimiter );
$pattern = $delimiter . '^' . $pattern_home_url . $delimiter . 'i';
return ! preg_match( $pattern, $url );
}

/**
Expand Down

0 comments on commit 1eb96e1

Please sign in to comment.