Fixed FD-55839 - arbitrary file deletion
This commit is contained in:
@@ -443,7 +443,7 @@ class AssetsController extends Controller
|
||||
|
||||
if ($request->filled('image_delete')) {
|
||||
try {
|
||||
unlink(public_path().'/uploads/assets/'.$asset->image);
|
||||
unlink(public_path().'/uploads/assets/'.basename($asset->image));
|
||||
$asset->image = '';
|
||||
} catch (\Exception $e) {
|
||||
Log::info($e);
|
||||
@@ -549,7 +549,7 @@ class AssetsController extends Controller
|
||||
|
||||
if ($asset->image) {
|
||||
try {
|
||||
Storage::disk('public')->delete('assets'.'/'.$asset->image);
|
||||
Storage::disk('public')->delete('assets/'.basename($asset->image));
|
||||
} catch (\Exception $e) {
|
||||
Log::debug($e);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class AssetImporter extends ItemImporter
|
||||
}
|
||||
|
||||
$this->item['notes'] = trim($this->findCsvMatch($row, 'asset_notes'));
|
||||
$this->item['image'] = trim($this->findCsvMatch($row, 'image'));
|
||||
$this->item['image'] = basename(trim($this->findCsvMatch($row, 'image')));
|
||||
$this->item['requestable'] = trim(($this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'))) == 1) ? '1' : 0;
|
||||
$asset->requestable = $this->item['requestable'];
|
||||
$this->item['warranty_months'] = intval(trim($this->findCsvMatch($row, 'warranty_months')));
|
||||
|
||||
Reference in New Issue
Block a user