f9/patches/smf21_expand_attach.patch
snow flurry 638fc72ccd add patches/
We should be tracking those here instead of random F9 threads.
2025-04-24 23:57:51 -07:00

22 lines
1.2 KiB
Diff

Modifies inline image attachment rendering to provide a link to the image itself.
--- old/Sources/Subs.php 2025-02-28 07:33:43.973736879 +0000
+++ new/Sources/Subs.php 2025-03-23 06:17:03.956035213 +0000
@@ -1769,14 +1769,16 @@
// Image.
if (!empty($currentAttachment['is_image']))
{
+ $returnContext .= '<a href="' . $currentAttachment['href'] . ';image" target="_blank">';
if (empty($params['{width}']) && empty($params['{height}']))
- $returnContext .= '<img src="' . $currentAttachment['href'] . '"' . $alt . $title . ' class="bbc_img">';
+ $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . ' class="bbc_img">';
else
{
$width = !empty($params['{width}']) ? ' width="' . $params['{width}'] . '"': '';
$height = !empty($params['{height}']) ? 'height="' . $params['{height}'] . '"' : '';
$returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img resized"/>';
}
+ $returnContext .= '</a>';
}
// Video.
elseif (strpos($currentAttachment['mime_type'], 'video/') === 0)