mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-05 15:07:11 +00:00
Merge branch '1.x' into 2.x
* 1.x: Update CHANGELOG Revert "bug #3499 Fix: A template name cannot be an absolute path (mvorisek)"
This commit is contained in:
@@ -351,7 +351,7 @@
|
||||
|
||||
# 1.44.4 (2021-XX-XX)
|
||||
|
||||
* n/a
|
||||
* Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)"
|
||||
|
||||
# 1.44.3 (2021-05-12)
|
||||
|
||||
|
||||
@@ -277,10 +277,6 @@ class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, Source
|
||||
throw new LoaderError('A template name cannot contain NUL bytes.');
|
||||
}
|
||||
|
||||
if ($this->isAbsolutePath($name)) {
|
||||
throw new LoaderError(sprintf('A template name cannot be an absolute path (%s).', $name));
|
||||
}
|
||||
|
||||
$name = ltrim($name, '/');
|
||||
$parts = explode('/', $name);
|
||||
$level = 0;
|
||||
|
||||
@@ -33,13 +33,11 @@ class FilesystemTest extends TestCase
|
||||
{
|
||||
$loader = new FilesystemLoader([__DIR__.'/../Fixtures']);
|
||||
|
||||
$this->expectException(LoaderError::class);
|
||||
try {
|
||||
$loader->getCacheKey($template);
|
||||
$this->fail();
|
||||
} catch (LoaderError $e) {
|
||||
$this->assertStringNotContainsString('Unable to find template', $e->getMessage());
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,14 +63,6 @@ class FilesystemTest extends TestCase
|
||||
['filters\\\\..\\\\..\\\\AutoloaderTest.php'],
|
||||
['filters\\//../\\/\\..\\AutoloaderTest.php'],
|
||||
['/../AutoloaderTest.php'],
|
||||
['/AutoloaderTest.php'],
|
||||
['\\AutoloaderTest.php'],
|
||||
['//AutoloaderTest.php'],
|
||||
['\\\\AutoloaderTest.php'],
|
||||
['/./AutoloaderTest.php'],
|
||||
['\\.\\AutoloaderTest.php'],
|
||||
['C:/AutoloaderTest.php'],
|
||||
['C:\\AutoloaderTest.php'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user