mirror of https://github.com/MarceauKa/shaark.git
📦 1.1.1
This commit is contained in:
parent
5dfbb3984c
commit
430b00d9c1
|
@ -62,7 +62,7 @@ class LinkActionsController extends Controller
|
|||
/** @var Link $link */
|
||||
$link = Link::findOrFail($id);
|
||||
|
||||
if (empty($request->user()) && $link->post->is_private) {
|
||||
if (false === $link->canDownloadArchive()) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Link;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class LinkController extends Controller
|
||||
{
|
||||
|
@ -45,6 +46,10 @@ class LinkController extends Controller
|
|||
/** @var Link $link */
|
||||
$link = Link::with('post')->findOrFail($id);
|
||||
|
||||
if ($link->hasArchive()) {
|
||||
Storage::disk('archives')->delete($link->archive);
|
||||
}
|
||||
|
||||
$link->delete();
|
||||
$link->post->delete();
|
||||
|
||||
|
|
|
@ -73,7 +73,13 @@ class Link extends Model implements Feedable
|
|||
return false;
|
||||
}
|
||||
|
||||
if (app('shaarli')->getPrivateArchive() === true && auth()->check() === false) {
|
||||
if ($this->post->is_private
|
||||
&& auth()->check() === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (app('shaarli')->getPrivateArchive() === true
|
||||
&& auth()->check() === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use Spatie\Valuestore\Valuestore;
|
|||
class Shaarli
|
||||
{
|
||||
/** @var string VERSION */
|
||||
public const VERSION = '1.0.0';
|
||||
public const VERSION = '1.1.1';
|
||||
/** @var Application $app */
|
||||
protected $app;
|
||||
/** @var Valuestore $settings */
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# 1.1.0
|
||||
|
||||
## Fixed
|
||||
|
||||
- Deleting a link will also delete its archive
|
||||
- Prevent link archive download when "private archive" option is set to true
|
||||
|
||||
# 1.1.0
|
||||
|
||||
## Added
|
||||
|
||||
- Link can now be archived using Puppeteer or Youtube-dl
|
||||
|
|
Loading…
Reference in New Issue