1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 16:50:09 +01:00

Escape file paths

Use escapeshellarg to make file paths safe to use in shell command
This commit is contained in:
mattdfloyd
2016-05-09 12:06:24 -04:00
parent c1f33d3861
commit c6a73e49aa

View File

@@ -148,6 +148,10 @@
$app->command('logs', function () {
$files = Site::logs(Configuration::read()['paths']);
$files = collect($files)->transform(function ($file) {
return escapeshellarg($file);
})->all();
if (count($files) > 0) {
passthru('tail -f '.implode(' ', $files));
} else {