[Templating] fixed 'scheme://' not detected as absolute path
This commit is contained in:
parent
e6f2687107
commit
600066eda4
@ -115,6 +115,7 @@ class FilesystemLoader extends Loader
|
||||
&& $file[1] == ':'
|
||||
&& ($file[2] == '\\' || $file[2] == '/')
|
||||
)
|
||||
|| null !== parse_url($file, PHP_URL_SCHEME)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ class FilesystemLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(ProjectTemplateLoader2::isAbsolutePath('c:\\\\foo.xml'), '->isAbsolutePath() returns true if the path is an absolute path');
|
||||
$this->assertTrue(ProjectTemplateLoader2::isAbsolutePath('c:/foo.xml'), '->isAbsolutePath() returns true if the path is an absolute path');
|
||||
$this->assertTrue(ProjectTemplateLoader2::isAbsolutePath('\\server\\foo.xml'), '->isAbsolutePath() returns true if the path is an absolute path');
|
||||
$this->assertTrue(ProjectTemplateLoader2::isAbsolutePath('https://server/foo.xml'), '->isAbsolutePath() returns true if the path is an absolute path');
|
||||
$this->assertTrue(ProjectTemplateLoader2::isAbsolutePath('phar://server/foo.xml'), '->isAbsolutePath() returns true if the path is an absolute path');
|
||||
}
|
||||
|
||||
public function testLoad()
|
||||
|
Reference in New Issue
Block a user