Skip to content

Commit 6a2e115

Browse files
Merge branch '2.8' into 3.1
* 2.8: Compatibility with Twig 1.27 [VarDumper] Fix dumping Twig source in stack traces Enhance GAE compat by removing some realpath() bumped Symfony version to 2.8.14 updated VERSION for 2.8.13 updated CHANGELOG for 2.8.13 bumped Symfony version to 2.7.21 updated VERSION for 2.7.20 update CONTRIBUTORS for 2.7.20 updated CHANGELOG for 2.7.20 [SecurityBundle] Fix twig-bridge lowest dep
2 parents 949e7e8 + f0bfc98 commit 6a2e115

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Resource/DirectoryResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable
3131
*/
3232
public function __construct($resource, $pattern = null)
3333
{
34-
$this->resource = realpath($resource);
34+
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
3535
$this->pattern = $pattern;
3636

3737
if (false === $this->resource || !is_dir($this->resource)) {

Resource/FileResource.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ class FileResource implements SelfCheckingResourceInterface, \Serializable
3434
*/
3535
public function __construct($resource)
3636
{
37-
$this->resource = realpath($resource);
38-
39-
if (false === $this->resource && file_exists($resource)) {
40-
$this->resource = $resource;
41-
}
37+
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
4238

4339
if (false === $this->resource) {
4440
throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $resource));

0 commit comments

Comments
 (0)