1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-12 00:43:59 +02:00

security patch in manipulation route

This commit is contained in:
Oliver Vogel
2014-08-19 18:03:43 +02:00
parent 2fb5e286e4
commit 92a9968876

View File

@@ -46,7 +46,8 @@ class ImageServiceProvider extends ServiceProvider
// find file // find file
foreach ($config->get('imagecache::paths') as $path) { foreach ($config->get('imagecache::paths') as $path) {
$image_path = $path.'/'.$filename; // don't allow '..' in filenames
$image_path = $path.'/'.str_replace('..', '', $filename);
if (file_exists($image_path) && is_file($image_path)) { if (file_exists($image_path) && is_file($image_path)) {
break; break;
} else { } else {