|
|
|
|
@ -1974,9 +1974,11 @@ class ApiV1Controller extends Controller
|
|
|
|
|
abort(403, 'Invalid or unsupported mime type.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$hash = \hash_file('sha256', $photo->getRealPath());
|
|
|
|
|
abort_if(MediaBlocklistService::exists($hash) == true, 451);
|
|
|
|
|
|
|
|
|
|
$storagePath = MediaPathService::get($user, 2);
|
|
|
|
|
$path = $photo->storePublicly($storagePath);
|
|
|
|
|
$hash = \hash_file('sha256', $photo);
|
|
|
|
|
$license = null;
|
|
|
|
|
$mime = $photo->getMimeType();
|
|
|
|
|
|
|
|
|
|
@ -2000,8 +2002,6 @@ class ApiV1Controller extends Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abort_if(MediaBlocklistService::exists($hash) == true, 451);
|
|
|
|
|
|
|
|
|
|
$media = new Media;
|
|
|
|
|
$media->status_id = null;
|
|
|
|
|
$media->profile_id = $profile->id;
|
|
|
|
|
@ -2201,9 +2201,11 @@ class ApiV1Controller extends Controller
|
|
|
|
|
abort(403, 'Invalid or unsupported mime type.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$hash = \hash_file('sha256', $photo->getRealPath());
|
|
|
|
|
abort_if(MediaBlocklistService::exists($hash) == true, 451);
|
|
|
|
|
|
|
|
|
|
$storagePath = MediaPathService::get($user, 2);
|
|
|
|
|
$path = $photo->storePublicly($storagePath);
|
|
|
|
|
$hash = \hash_file('sha256', $photo);
|
|
|
|
|
$license = null;
|
|
|
|
|
$mime = $photo->getMimeType();
|
|
|
|
|
|
|
|
|
|
@ -2217,8 +2219,6 @@ class ApiV1Controller extends Controller
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abort_if(MediaBlocklistService::exists($hash) == true, 451);
|
|
|
|
|
|
|
|
|
|
if ($request->has('replace_id')) {
|
|
|
|
|
$rpid = $request->input('replace_id');
|
|
|
|
|
$removeMedia = Media::whereNull('status_id')
|
|
|
|
|
|