fix: uploaded image path computted wrong when in subdirectory

The path set as $file['full_file'] and used for the dimension calculation incorrectly used the HTTP path
This commit is contained in:
onli 2021-05-13 14:11:07 +02:00
parent fd9edae13c
commit 46e8cc96b3

View File

@ -3147,7 +3147,7 @@ function serendipity_prepareMedia(&$file, $url = '') {
$file['imgsrc'] = $file['show_thumb'];
}
} else {
$file['full_file'] = $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $file['path'] . $file['name'] . (empty($file['extension']) ? '' : '.' . $file['extension']);
$file['full_file'] = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['name'] . (empty($file['extension']) ? '' : '.' . $file['extension']);
$file['show_thumb'] = $file['full_thumbHTTP'];
if (!isset($file['imgsrc'])) {
$file['imgsrc'] = $serendipity['uploadHTTPPath'] . $file['path'] . $file['name'] . (!empty($file['thumbnail_name']) ? '.' . $file['thumbnail_name'] : '') . (empty($file['extension']) ? '' : '.' . $file['extension']);
@ -3170,7 +3170,7 @@ function serendipity_prepareMedia(&$file, $url = '') {
$file['links'] = array('imagelinkurl' => $file['full_file']);
$file['dim'] = @getimagesize($file['full_thumb'], $file['thumb_header']);
$file['dim_orig'] = @getimagesize($serendipity['serendipityPath'] . $file['full_file'], $file['header']);
$file['dim_orig'] = @getimagesize($file['full_file'], $file['header']);
$file['is_image'] = serendipity_isImage($file);
if ($file['is_image']) {