Skip to content

Commit

Permalink
Fix #8838 - Change logo even if tmp folder contains periods
Browse files Browse the repository at this point in the history
  • Loading branch information
SinergiaCRM committed Aug 6, 2024
1 parent 80ee82d commit 265cb91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -5472,11 +5472,12 @@ function verify_uploaded_image($path, $jpeg_only = false)
$filetype = $img_size['mime'] ?? '';
$tmpArray = explode('.', $path);
$ext = end($tmpArray);

if (strpos($ext, '/')) {
$ext = $path;
}
if (!has_valid_image_mime_type($filetype)) {
return false;
}

if (substr_count('..', $path) > 0 || ($ext !== $path && !isset($supportedExtensions[strtolower($ext)])) ||
!in_array($filetype, array_values($supportedExtensions))
) {
Expand Down

0 comments on commit 265cb91

Please sign in to comment.