AvalancheImagineBundle icon indicating copy to clipboard operation
AvalancheImagineBundle copied to clipboard

Check if path is a file (not a directory)

Open EricGrivilers opened this issue 12 years ago • 3 comments

Hello,

Since the CachePathResolver is unlinking file, is it possible to check first that the $cached is a file, not a directory, to avoid error on trying to unlink a directory ? add a

!is_dir($cached)
on
getBrowserPath()
public function getBrowserPath($path, $filter, $absolute = false) {
...
if (file_exists($cached) && !is_dir($cached) && filemtime($realPath) > filemtime($cached) ) ...

EricGrivilers avatar Mar 28 '13 10:03 EricGrivilers

@EricGrivilers I think it would be good as I have errors in this exact case! make a PR?

dupuchba avatar May 07 '13 12:05 dupuchba

@dupuchba PR done.

EricGrivilers avatar May 07 '13 13:05 EricGrivilers

@EricGrivilers good :), now we need @avalanche123 to merge it :D

dupuchba avatar May 07 '13 13:05 dupuchba