diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php
index facdff3..70c4555 100644
--- a/Rocksolid_Light/rocksolid/newsportal.php
+++ b/Rocksolid_Light/rocksolid/newsportal.php
@@ -1130,6 +1130,14 @@ function html_parse($text)
return ($ntext);
}
+function rewrite_body($text) {
+ global $config_dir;
+ if (file_exists($config_dir . '/rewrite_body.inc.php')) {
+ include($config_dir . '/rewrite_body.inc.php');
+ }
+ return $text;
+}
+
function display_links_in_body($text)
{
global $config_dir;
@@ -1152,10 +1160,7 @@ function display_links_in_body($text)
$pattern = "!$pattern!";
$text = preg_replace($pattern, '' . $url . '', $text, 1);
}
- if (file_exists($config_dir . '/rewrite_body.inc.php')) {
- include($config_dir . '/rewrite_body.inc.php');
- }
-
+ $text = rewrite_body($text);
echo $text;
if ($isquote) {
echo '';
diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php
index 71e117f..96d4085 100644
--- a/Rocksolid_Light/rocksolid/overboard.php
+++ b/Rocksolid_Light/rocksolid/overboard.php
@@ -379,9 +379,7 @@ function display_threads($threads, $oldest)
$article = get_db_data_from_msgid($target_head['msgid'], $target_head['newsgroup'], 1);
$text = $article['search_snippet'];
- if (file_exists($config_dir . '/rewrite_body.inc.php')) {
- include ($config_dir . '/rewrite_body.inc.php');
- }
+ $text = rewrite_body($text);
$display .= strip_tags(wordwrap(substr($text, 0, $snippetlength), ($snippetlength / 2), "
\n", true));
}
}
@@ -420,9 +418,7 @@ function display_threads($threads, $oldest)
if ($CONFIG['article_database'] == '1') {
$article = get_db_data_from_msgid($target['msgid'], $target['newsgroup'], 1);
$text = $article['search_snippet'];
- if (file_exists($config_dir . '/rewrite_body.inc.php')) {
- include ($config_dir . '/rewrite_body.inc.php');
- }
+ $text = rewrite_body($text);
$display .= strip_tags(html_parse(text2html(substr($text, 0, $snippetlength))));
// $display .= strip_tags(htmlentities(substr($text, 0, $snippetlength)));
}
@@ -559,9 +555,7 @@ function display_flat($threads, $oldest)
if ($CONFIG['article_database'] == '1') {
$article = get_db_data_from_msgid($target['msgid'], $target['newsgroup'], 1);
$text = $article['search_snippet'];
- if (file_exists($config_dir . '/rewrite_body.inc.php')) {
- include ($config_dir . '/rewrite_body.inc.php');
- }
+ $text = rewrite_body($text);
$display .= strip_tags(html_parse(text2html(substr($text, 0, $snippetlength))));
//$display .= htmlentities(substr($text, 0, $snippetlength));
}