From ab55d8f724e8740bb9a7bcff87e5f08224c66511 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 8 Jun 2025 23:29:40 +0900 Subject: [PATCH 01/48] Fix string * float error when height is auto #2562 --- modules/document/document.item.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 732d25e17..dcf90e8d7 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -1146,9 +1146,14 @@ class DocumentItem extends BaseObject // Call trigger for custom thumbnails. $trigger_obj = (object)[ - 'document_srl' => $this->document_srl, 'width' => $width, 'height' => $height, - 'image_type' => 'jpg', 'type' => $thumbnail_type, 'quality' => $config->thumbnail_quality, - 'filename' => $thumbnail_file, 'url' => $thumbnail_url, + 'document_srl' => $this->document_srl, + 'width' => $width, + 'height' => $height, + 'image_type' => 'jpg', + 'type' => $thumbnail_type, + 'quality' => $config->thumbnail_quality, + 'filename' => $thumbnail_file, + 'url' => $thumbnail_url, ]; $output = ModuleHandler::triggerCall('document.getThumbnail', 'before', $trigger_obj); clearstatcache(true, $thumbnail_file); @@ -1220,8 +1225,16 @@ class DocumentItem extends BaseObject // If not exists, file an image file from the content if(!$source_file && $config->thumbnail_target !== 'attachment') { - $external_image_min_width = min(100, round($trigger_obj->width * 0.3)); - $external_image_min_height = min(100, round($trigger_obj->height * 0.3)); + $external_image_min_width = is_numeric($trigger_obj->width) ? min(100, round(intval($trigger_obj->width) * 0.3)) : 100; + if($trigger_obj->height === 'auto') + { + $external_image_min_height = min(100, $external_image_min_width * 0.5); + } + else + { + $external_image_min_height = is_numeric($trigger_obj->height) ? min(100, round(intval($trigger_obj->height) * 0.3)) : 100; + } + preg_match_all("!]*?src=(\"|')([^\"' ]*?)(\"|')!is", $content, $matches, PREG_SET_ORDER); foreach($matches as $match) { From 85e583a111fecc8b73975328e9ba4a29b895081a Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 8 Jun 2025 23:38:41 +0900 Subject: [PATCH 02/48] Remove duplicate meta viewport tag https://rhymix.org/tip/1909080 --- modules/admin/tpl/_header.html | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/admin/tpl/_header.html b/modules/admin/tpl/_header.html index 729ca60e1..9385bfef3 100644 --- a/modules/admin/tpl/_header.html +++ b/modules/admin/tpl/_header.html @@ -1,7 +1,6 @@ -{@ Context::addMetaTag("viewport", "width=device-width, user-scalable=yes")}