Skip to content

Commit

Permalink
Improve external URL performance
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Sep 4, 2018
1 parent 76ac7b6 commit e243a27
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ public function getResourceUri($filename, $path = null, $extension = null)
*/
private function isExternalUrl($path)
{
return (strlen($path) > 8) && Strings::startsWithAny(
$path,
['http://', 'https://', '//']
return strlen($path) > 8 && (
Strings::startsWith($path, 'http://', true, 7) ||
Strings::startsWith($path, 'https://', true, 8) ||
Strings::startsWith($path, '//', true, 2)
);
}

Expand Down

0 comments on commit e243a27

Please sign in to comment.