diff --git a/src/Assets.php b/src/Assets.php index 0b84615..0959c6b 100644 --- a/src/Assets.php +++ b/src/Assets.php @@ -50,7 +50,7 @@ class Assets { /** * Regular expression to match an external url */ - const REGEX_EXTERNAL_URL = '/^((https?:)\/\/|data:)/i'; + const REGEX_EXTERNAL_URL = '/^((https?:)?\/\/|data:)/i'; /** * File type detection options diff --git a/tests/HelpersTest.php b/tests/HelpersTest.php index 7bd1a5f..bb60388 100644 --- a/tests/HelpersTest.php +++ b/tests/HelpersTest.php @@ -41,6 +41,7 @@ public function testIsAbsoluteUrl() { $this->assertTrue($assets->isAbsoluteUrl('http://example.com')); $this->assertTrue($assets->isAbsoluteUrl('https://example.com')); + $this->assertTrue($assets->isAbsoluteUrl('//example.com')); $this->assertTrue($assets->isAbsoluteUrl('data:some-encoded-data')); $this->assertFalse($assets->isAbsoluteUrl('unknown://example.com')); $this->assertFalse($assets->isAbsoluteUrl('http:/example.com'));