Browse Source

Fixed images fields

pull/3/head
MadD3n 2 years ago
parent
commit
04b693a66a
  1. 16
      admin/browser.php
  2. 2
      admin/templates/browser/browser_upload.tpl

16
admin/browser.php

@ -149,12 +149,18 @@
if (@unlink($del_file)) if (@unlink($del_file))
{ {
$nameParts = explode('.', $file_name); foreach (glob($upload_path . $_REQUEST['dir'] . THUMBNAIL_DIR . '/*') as $f_name)
$ext = strtolower(end($nameParts));
if (in_array($ext, $images_ext))
{ {
$nameParts[count($nameParts)-2] .= $thumb_size; $base_file = basename($del_file);
@unlink($upload_path . $_REQUEST['dir'] . THUMBNAIL_DIR . '/' . implode('.', $nameParts)); $nameParts = explode('.', $base_file);
$start = strtolower(array_shift($nameParts));
$ext = strtolower(array_pop($nameParts));
$regexp = '/^(' . $start . ')*(-)(t|f|c|s).{3,}.(' . $ext . ')/';
if (preg_match_all($regexp, basename($f_name))) {
@unlink($upload_path . $_REQUEST['dir'] . THUMBNAIL_DIR . '/' . basename($f_name));
}
} }
reportLog($_SESSION['user_name'] . ' - удалил файл (' reportLog($_SESSION['user_name'] . ' - удалил файл ('

2
admin/templates/browser/browser_upload.tpl

@ -1,5 +1,5 @@
<script> <script>
let path_upload = "{$smarty.request.dir|escape}"; var path_upload = "{$smarty.request.dir|escape}";
</script> </script>
<!-- Wrapper --> <!-- Wrapper -->

Loading…
Cancel
Save