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:
Fabien Potencier
2021-05-16 14:07:24 +02:00
3 changed files with 2 additions and 16 deletions
+1 -1
View File
@@ -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)
-4
View File
@@ -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;
+1 -11
View File
@@ -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'],
];
}