Merge branch 'release/1.8.7'

This commit is contained in:
Andy Miller
2018-07-31 11:16:06 -06:00
3 changed files with 14 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
# v1.8.7
## 07/31/2018
1. [](#bugfix)
* Fix for deleting 'extra' media files [grav#2100](https://githubcom/getgrav/grav/issues/2100)
# v1.8.6
## 07/13/2018

View File

@@ -1,5 +1,5 @@
name: Admin Panel
version: 1.8.6
version: 1.8.7
description: Adds an advanced administration panel to manage your site
icon: empire
author:

View File

@@ -1826,7 +1826,13 @@ class AdminController extends AdminBaseController
// Remove Extra Files
foreach (scandir($media->path(), SCANDIR_SORT_NONE) as $file) {
if (preg_match("/{$fileParts['filename']}@\d+x\.{$fileParts['extension']}(?:\.meta\.yaml)?$|{$filename}\.meta\.yaml$/", $file)) {
$result = unlink($media->path() . '/' . $file);
$targetPath = $media->path() . '/' . $file;
if ($locator->isStream($targetPath)) {
$targetPath = $locator->findResource($targetPath, true, true);
}
$result = unlink($targetPath);
if (!$result) {
$this->admin->json_response = [