From 6b99f5ca4759e14d538a19118b2c708092f8030d Mon Sep 17 00:00:00 2001
From: Retro_Guy
Date: Wed, 3 Apr 2024 07:44:58 -0700
Subject: [PATCH] Check that imagecreatefromxbm() function exists before trying
to display xface.
---
INSTALL.md | 2 +-
Rocksolid_Light/rocksolid/lib/message.inc.php | 65 +++++++++++--------
2 files changed, 40 insertions(+), 27 deletions(-)
diff --git a/INSTALL.md b/INSTALL.md
index b3fa34c..a5df972 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -29,7 +29,7 @@ php-gnupg
php8.x-sqlite3 (or later version).
phpmailer is required if email confirmation is to be used.
php-xml to work with RSS feeds
-compface and php-gd for X-Face support
+compface, php-gd and libgd3 for X-Face support
These are the names for Debian packages. Other distributions should
also provide these in some way.
diff --git a/Rocksolid_Light/rocksolid/lib/message.inc.php b/Rocksolid_Light/rocksolid/lib/message.inc.php
index a78153e..f5c081c 100644
--- a/Rocksolid_Light/rocksolid/lib/message.inc.php
+++ b/Rocksolid_Light/rocksolid/lib/message.inc.php
@@ -23,10 +23,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
- ?>
+?>
';
-
+
// Copy MID to clipboard (requires js)
echo ' ';
+ echo '{';
+ echo 'var r = document.createRange();';
+ echo 'r.selectNode(document.getElementById(id));';
+ echo 'window.getSelection().removeAllRanges();';
+ echo 'window.getSelection().addRange(r);';
+ echo "document.execCommand('copy');";
+ echo 'window.getSelection().removeAllRanges();';
+ echo '}';
+ echo ' ';
?>
- id); ?>
- copy mid
+id); ?>
+
+copy
+ mid
- number . '&group=' . urlencode($group) . '#' . $head->number; ?>
- copy link
-
- number . 'copy'; ?>"
+ style="position: absolute; z-index: -9999;">number . '&group=' . urlencode($group) . '#' . $head->number; ?>
+
+copy
+ link
+
+newsgroups);
$ngroups = explode("\t", $ngroups);
- // echo " ";
+ // echo " ";
foreach ($ngroups as $onegroup) {
if ($s = get_section_by_group($onegroup)) {
echo ' ' . $onegroup . " ";
} else {
- echo " ".$onegroup." ";
+ echo " " . $onegroup . " ";
}
}
echo "
";
-
+
if (isset($head->followup) && ($article_show["Followup"]) && ($head->followup != "")) {
echo $text_header["followup"] . htmlspecialchars($head->followup) . "
\n";
}
@@ -585,7 +595,8 @@ function show_header_short($head, $group, $local_poster = false)
echo '';
}
-function copy_messageid() {
+function copy_messageid()
+{
$messageid = "THIS IS THE MSGID";
return $messageid;
}
@@ -781,10 +792,12 @@ function message_show($group, $id, $attachment = 0, $article_data = false, $maxl
$xbmfile = $facefile . '.xbm';
$uncompface = 'uncompface -X ' . $facefile . ' ' . $xbmfile;
shell_exec($uncompface);
- if (($xbm = imagecreatefromxbm($xbmfile)) !== false) {
- imagepng($xbm, $pngfile);
- imagedestroy($xbm);
- echo '';
+ if (function_exists('imagecreatefromxbm')) {
+ if (($xbm = imagecreatefromxbm($xbmfile)) !== false) {
+ imagepng($xbm, $pngfile);
+ imagedestroy($xbm);
+ echo '';
+ }
}
unlink($facefile);
unlink($xbmfile);