From 7952b6a00b363a00071796986a088bef47f43460 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Sun, 30 Jun 2024 00:53:56 -0700 Subject: [PATCH] Remove extra blank line from end of quote. --- Rocksolid_Light/common/version.txt | 2 +- Rocksolid_Light/rocksolid/post.php | 32 +++++++++++-------- .../rslight/overrides.inc.php.dist | 5 ++- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Rocksolid_Light/common/version.txt b/Rocksolid_Light/common/version.txt index f84e084..cd2f1c3 100644 --- a/Rocksolid_Light/common/version.txt +++ b/Rocksolid_Light/common/version.txt @@ -1 +1 @@ -0.9.137 +0.9.136 diff --git a/Rocksolid_Light/rocksolid/post.php b/Rocksolid_Light/rocksolid/post.php index 45627d8..811e2b8 100644 --- a/Rocksolid_Light/rocksolid/post.php +++ b/Rocksolid_Light/rocksolid/post.php @@ -261,11 +261,6 @@ if ($type == "post") { $message = message_post(quoted_printable_encode($subject), $nemail . " (" . quoted_printable_encode($name) . ")", $newsgroups, $references_array, addslashes($body), $_POST['encryptthis'], $_POST['encryptto'], strtolower($name), $_POST['fromname'], null, true); } else { $message = message_post(quoted_printable_encode($subject), $nemail . " (" . quoted_printable_encode($name) . ")", $newsgroups, $references_array, addslashes($body), $_POST['encryptthis'], $_POST['encryptto'], strtolower($name), $_POST['fromname']); - /* - * $message = message_post(quoted_printable_encode($subject), $nemail . " (" . quoted_printable_encode($name) . ")", $newsgroups, $references_array, addslashes(mb_wordwrap($body, 75)), $_POST['encryptthis'], $_POST['encryptto'], strtolower($name), $_POST['fromname'], null, true); - * } else { - * $message = message_post(quoted_printable_encode($subject), $nemail . " (" . quoted_printable_encode($name) . ")", $newsgroups, $references_array, addslashes(mb_wordwrap($body, 75)), $_POST['encryptthis'], $_POST['encryptto'], strtolower($name), $_POST['fromname']); - */ } // Article sent without errors, or duplicate? if ((substr($message, 0, 3) == "240") || (substr($message, 0, 7) == "441 435")) { @@ -304,7 +299,7 @@ if ($type == "reply") { $message = message_read($id, 0, $newsgroups); $head = $message->header; - $body = explode("\n", $message->body[0]); + $body = explode("\n", rtrim($message->body[0])); nntp_close($ns); if ($head->name != "") { $bodyzeile = $head->name; @@ -314,18 +309,27 @@ if ($type == "reply") { // For Synchronet use $fromname = $bodyzeile; - $bodyzeile = $text_post["wrote_prefix"] . $bodyzeile . $text_post["wrote_suffix"] . "\n\n"; for ($i = 0; $i <= count($body) - 1; $i ++) { if ((isset($cutsignature)) && ($cutsignature == true) && ($body[$i] == '-- ')) break; - if (trim($body[$i]) != "") { - if ($body[$i][0] == '>') - $bodyzeile .= ">" . $body[$i] . "\n"; - else - $bodyzeile .= "> " . $body[$i] . "\n"; - } else { - $bodyzeile .= "\n"; + if ((trim($body[$i]) == "") && ($body[$i + 1] == '-- ' || $i >= count($body) - 1)) {} else { + // Quote blank lines? YES by default + if (! isset($OVERRIDES['quote_blank_lines']) || $OVERRIDES['quote_blank_lines'] == true) { + if ($body[$i][0] == '>') + $bodyzeile .= ">" . $body[$i] . "\n"; + else + $bodyzeile .= "> " . $body[$i] . "\n"; + } else { + if (trim($body[$i]) != "") { + if ($body[$i][0] == '>') + $bodyzeile .= ">" . $body[$i] . "\n"; + else + $bodyzeile .= "> " . $body[$i] . "\n"; + } else { + $bodyzeile .= "\n"; + } + } } } $subject = $head->subject; diff --git a/Rocksolid_Light/rslight/overrides.inc.php.dist b/Rocksolid_Light/rslight/overrides.inc.php.dist index abc3c4a..90cab4f 100644 --- a/Rocksolid_Light/rslight/overrides.inc.php.dist +++ b/Rocksolid_Light/rslight/overrides.inc.php.dist @@ -44,6 +44,10 @@ return [ // Disable display of X-Face 'disable_xface' => false, + + // Set to false to NOT add '>' to quotes for blank lines + // Default is true + 'quote_blank_lines' => true, // Disable immediate post insertion (wait for remote server) // for a SECTION. Comma separated list ex: 'rocksolid,section3,section5', @@ -80,7 +84,6 @@ return [ // contained in reverse dns string // 'block_by_rdns' => array("hwclouds", "googlebot"), - // Just leave this here to avoid comma errors 'comma' => true ];