diff --git a/Rocksolid_Light/common/header.php b/Rocksolid_Light/common/header.php index 2fdb872..de4174e 100644 --- a/Rocksolid_Light/common/header.php +++ b/Rocksolid_Light/common/header.php @@ -8,34 +8,6 @@ if (basename(getcwd()) == 'mods') { include ($rootdir . 'common/config.inc.php'); $CONFIG = include $config_file; -?> - - - -'; -echo '
'; -?> - +?> diff --git a/Rocksolid_Light/common/version.txt b/Rocksolid_Light/common/version.txt index b8a1bd1..1a02c2d 100644 --- a/Rocksolid_Light/common/version.txt +++ b/Rocksolid_Light/common/version.txt @@ -1 +1 @@ -0.9.141 +0.9.142 diff --git a/Rocksolid_Light/rocksolid/lib/message.inc.php b/Rocksolid_Light/rocksolid/lib/message.inc.php index f724717..5388be0 100644 --- a/Rocksolid_Light/rocksolid/lib/message.inc.php +++ b/Rocksolid_Light/rocksolid/lib/message.inc.php @@ -563,7 +563,7 @@ function show_header_short($head, $group, $local_poster = false)

id); ?>

  -copy mid @@ -571,7 +571,7 @@ function show_header_short($head, $group, $local_poster = false)

number . '&group=' . urlencode($group) . '#' . $head->number; ?>

  -copy link @@ -837,6 +837,9 @@ function message_show($group, $id, $attachment = 0, $article_data = false, $maxl return "no-archive"; } + // Any header checks to display notice in article display + $notice = display_header_notice($head); + if(isset($head->content_type[0])) { if(!strpos($head->content_type[0], "/")) { echo '

(message #' . $head->number . ' not displayed - malformed header)


'; @@ -845,6 +848,7 @@ function message_show($group, $id, $attachment = 0, $article_data = false, $maxl } if (($head->content_type[$attachment] == "text/plain") && ($attachment == 0)) { show_header($head, $group, $local_poster); + echo $notice; // X-Face if (($face = display_full_headers($head->number, $group, $head->name, $head->from, true)) && ($OVERRIDES['disable_xface'] != true)) { $pngfile = '../tmp/face-' . hash('ripemd160', $face); @@ -1041,4 +1045,14 @@ function articleflat_pageselect($group, $id, $article_count, $first) $return .= ''; } return $return; +} + +function display_header_notice($head) { + $notice = false; + if(stripos($head->subject, "Re: ") === 0) { + if(!isset($head->references)) { + $notice = '

(article missing references header)


'; + } + } + return $notice; } \ No newline at end of file diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index c46ace3..dc41c7c 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1826,7 +1826,8 @@ function get_search_snippet($body, $content_type = '', $content_transfer_encodin $body = quoted_printable_decode($body); } if ($content_type !== '') { - $mysnippet = recode_charset($body, $content_type, "utf8"); + $content_type = explode(';', $content_type); + $mysnippet = recode_charset($body, $content_type[0]); } else { $mysnippet = $body; } diff --git a/Rocksolid_Light/rslight/scripts/nntp-ssl.php b/Rocksolid_Light/rslight/scripts/nntp-ssl.php index 02ac674..2407f9e 100755 --- a/Rocksolid_Light/rslight/scripts/nntp-ssl.php +++ b/Rocksolid_Light/rslight/scripts/nntp-ssl.php @@ -2,12 +2,21 @@ include "config.inc.php"; include ("$file_newsportal"); include $config_dir . "/scripts/rslight-lib.php"; + $lockfile = $lockdir . '/rslight-nntp-ssl.lock'; if (file_exists($config_dir . "/nntp.disable")) { clearstatcache(true, $config_dir . "/nntp.disable"); - $parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES); + $parent_pid = file_get_contents($lockfile); posix_kill($parent_pid, SIGTERM); exit(); } + if (file_exists($config_dir . "/nntp.reload")) { + clearstatcache(true, $config_dir . "/nntp.reload"); + $parent_pid = file_get_contents($lockfile); + posix_kill($parent_pid, SIGTERM); + unlink($config_dir . "/nntp.reload"); + unlink($lockfile); + sleep(5); + } /** * Listens for requests and forks on each connection */ @@ -42,9 +51,8 @@ function server_loop($address, $port) { GLOBAL $__server_listening; - GLOBAL $CONFIG, $logdir, $lockdir, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $ssldir, $nntp_group, $auth_ok; + GLOBAL $CONFIG, $logdir, $lockfile, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $ssldir, $nntp_group, $auth_ok; $logfile = $logdir . '/nntp.log'; - $lockfile = $lockdir . '/rslight-nntp-ssl.lock'; $pid = file_get_contents($lockfile); if (posix_getsid($pid) === false || ! is_file($lockfile)) { print "Starting Rocksolid Light NNTP Server...\n"; diff --git a/Rocksolid_Light/rslight/scripts/nntp.php b/Rocksolid_Light/rslight/scripts/nntp.php index 012b180..2d8ef5f 100755 --- a/Rocksolid_Light/rslight/scripts/nntp.php +++ b/Rocksolid_Light/rslight/scripts/nntp.php @@ -2,12 +2,23 @@ include "config.inc.php"; include ("$file_newsportal"); include $config_dir . "/scripts/rslight-lib.php"; + $lockfile = $lockdir . '/rslight-nntp.lock'; if (file_exists($config_dir . "/nntp.disable")) { clearstatcache(true, $config_dir . "/nntp.disable"); - $parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES); + $parent_pid = file_get_contents($lockfile); posix_kill($parent_pid, SIGTERM); exit(); } + if (file_exists($config_dir . "/nntp.reload")) { + clearstatcache(true, $config_dir . "/nntp.reload"); + $parent_pid = file_get_contents($lockfile); + posix_kill($parent_pid, SIGTERM); + if (!is_numeric($CONFIG['local_ssl_port'])) { + unlink($config_dir . "/nntp.reload"); + } + unlink($lockfile); + sleep(5); + } /** * Listens for requests and forks on each connection */ @@ -42,9 +53,8 @@ function server_loop($address, $port) { GLOBAL $__server_listening; - GLOBAL $CONFIG, $logdir, $lockdir, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $nntp_group, $auth_ok; + GLOBAL $CONFIG, $logdir, $lockfile, $webserver_uid, $webserver_gid, $installed_path, $config_path, $groupconfig, $workpath, $path, $spooldir, $nntp_group, $auth_ok; $logfile = $logdir . '/nntp.log'; - $lockfile = $lockdir . '/rslight-nntp.lock'; $pid = file_get_contents($lockfile); if (posix_getsid($pid) === false || ! is_file($lockfile)) { print "Starting Rocksolid Light NNTP Server...\n"; diff --git a/Rocksolid_Light/rslight/scripts/rslight-lib.php b/Rocksolid_Light/rslight/scripts/rslight-lib.php index cd36e60..3101b6f 100644 --- a/Rocksolid_Light/rslight/scripts/rslight-lib.php +++ b/Rocksolid_Light/rslight/scripts/rslight-lib.php @@ -34,11 +34,6 @@ function interact($msgsock, $use_crypto = false) $msg = ""; set_time_limit(30); $buf = fgets($msgsock, 2048); - if (file_exists($config_dir . "/nntp.disable")) { - $parent_pid = file_get_contents($lockdir . '/rslight-nntp.lock', IGNORE_NEW_LINES); - posix_kill($parent_pid, SIGTERM); - exit(); - } if ($buf === false) { // file_put_contents($logfile, "\n".format_log_date()." socket read failed: reason: " . socket_strerror(socket_last_error($msgsock)), FILE_APPEND); break; @@ -1250,6 +1245,7 @@ function insert_article($section, $nntp_group, $filename, $subject_i, $from_i, $ } else { $this_snippet = get_search_snippet($body); } + unlink($tmp_file); } else { rename($tmp_file, $tradspool_out_file); }