📦 1.1.1

This commit is contained in:
MarceauKa 2019-09-02 19:03:27 +02:00
parent 5dfbb3984c
commit 430b00d9c1
5 changed files with 21 additions and 3 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -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;
}

View File

@ -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 */

View File

@ -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