mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-28 08:46:45 +01:00
Introduce the mediapicker field (#1125)
Added a new `mediapicker` form field which allows to select a media from any page + Provided an option to control how parent select field displays
This commit is contained in:
@@ -924,7 +924,7 @@ class AdminBaseController
|
||||
$fileParts = pathinfo($filename);
|
||||
|
||||
foreach (scandir($fileParts['dirname']) as $file) {
|
||||
$regex_pattern = "/" . preg_quote($fileParts['filename']) . "@\d+x\." . $fileParts['extension'] . "$|" . preg_quote($fileParts['basename']) . ".meta.yaml$/";
|
||||
$regex_pattern = "/" . preg_quote($fileParts['filename']) . "@\d+x\." . $fileParts['extension'] . "(?:\.meta\.yaml)?$|" . preg_quote($fileParts['basename']) . "\.meta\.yaml$/";
|
||||
if (preg_match($regex_pattern, $file)) {
|
||||
$path = $fileParts['dirname'] . '/' . $file;
|
||||
@unlink($path);
|
||||
|
||||
Reference in New Issue
Block a user