diff --git a/opt/admin.php b/opt/admin.php index aad0b28..beefc59 100644 --- a/opt/admin.php +++ b/opt/admin.php @@ -991,8 +991,7 @@ function show_shadowed($db, $css, $settings, $token) $org_id = "{$row[1]}"; $sub = "{$row[2]}"; $text = "{$row[3]}"; - $post_text = break_text(bbcode_to_html($text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($text, $settings, $sub)); $html_string .= "
" . "" diff --git a/opt/display.php b/opt/display.php index 243a24f..3136d3f 100644 --- a/opt/display.php +++ b/opt/display.php @@ -57,14 +57,14 @@ function bbcode_to_html($text, $settings, $sub) } $search = array ( - '/(\[b\ )(.*)(\])/', - '/(\[i\ )(.*)(\])/', - '/(\[u\ )(.*)(\])/', - '/(\[s\ )(.*)(\])/', - '/(\[h\ )(.*)(\])/', - '/(\[sp\ )(.*)(\])/', - '/(\[li\ )(.*)(\])/', - '/(\[url\ )(.*)(\])/', + '/(\[b\ )(.*?)(\])/', + '/(\[i\ )(.*?)(\])/', + '/(\[u\ )(.*?)(\])/', + '/(\[s\ )(.*?)(\])/', + '/(\[h\ )(.*?)(\])/', + '/(\[sp\ )(.*?)(\])/', + '/(\[li\ )(.*?)(\])/', + '/(\[url\ )(.*?)(\])/', '/ s\/(.+)\/([0-9]+)/', '/>> ([0-9]+)\r\n/', '/>>(.*)\r\n/' @@ -89,12 +89,11 @@ function bbcode_to_html($text, $settings, $sub) } // Break text according to config.php, also transform \r\n to
-function break_text($text, $settings) +function break_text($text) { - $post_text = wordwrap($text, $settings['line_break'], "\n", TRUE); - $post_text = nl2br($post_text, FALSE); - return $post_text; + $post_text = nl2br($text, FALSE); + return $post_text; } @@ -166,8 +165,7 @@ function print_thread($db, $sub, $css, $settings, $org_id, $link_to_reply) $post_id = "{$row[0]}"; $org_id = "{$row[1]}"; $post_text = "{$row[3]}"; - $post_text = break_text(bbcode_to_html($post_text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($post_text, $settings, $sub)); $id_text = make_id_text($post_id); $timestamp = "{$row[4]}"; $name = "{$row[5]}"; @@ -183,7 +181,6 @@ function print_thread($db, $sub, $css, $settings, $org_id, $link_to_reply) $html_string .= ":$timestamp"; } -// $html_string .= "

$post_text

"; $html_string .= "

$post_text

"; if ( !empty($name) && @@ -278,8 +275,7 @@ function print_overboard($db, $css, $settings, $page) $org_id = "{$row[1]}"; $sub = "{$row[2]}"; $text = "{$row[3]}"; - $post_text = break_text(bbcode_to_html($text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($text, $settings, $sub)); $timestamp = "{$row[4]}"; $name = "{$row[5]}"; $tripcode = "{$row[6]}"; @@ -397,8 +393,7 @@ function print_individual_feed($db, $css, $settings, $ex_subs, $in_subs) $org_id = "{$row[1]}"; $sub = "{$row[2]}"; $text = "{$row[3]}"; - $post_text = break_text(bbcode_to_html($text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($text, $settings, $sub)); $timestamp = "{$row[4]}"; $name = "{$row[5]}"; $tripcode = "{$row[6]}"; @@ -692,8 +687,7 @@ function print_replies($db, $sub, $post_id, $org_id, $settings, $css, $state) $counter++; $post = array(); $sub_post_text = break_text(bbcode_to_html - ($sub_text, $settings, $sub), - $settings); + ($sub_text, $settings, $sub)); array_push($post, $sub_post_id); array_push($post, $sub_org_id); array_push($post, $sub_post_text); @@ -969,8 +963,7 @@ function print_sub($db, $sub, $css, $settings, $page) $tripcode = "{$row[6]}"; $move_message = "{$row[7]}"; $edit_message = "{$row[8]}"; - $post_text = break_text(bbcode_to_html($text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($text, $settings, $sub)); $html_string .= "
"; @@ -1063,8 +1056,7 @@ function print_user($db, $name, $css, $settings) $timestamp = "{$row[4]}"; $name = "{$row[5]}"; $tripcode = "{$row[6]}"; - $post_text = break_text(bbcode_to_html($text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($text, $settings, $sub)); $html_string .= "
"; @@ -1081,7 +1073,6 @@ function print_user($db, $name, $css, $settings) $html_string .= ":$timestamp"; } -// $html_string .= "

$post_text

" $html_string .= "

$post_text

" . "reply "; diff --git a/opt/show.php b/opt/show.php index 7c69a48..dd4b982 100644 --- a/opt/show.php +++ b/opt/show.php @@ -289,8 +289,7 @@ function show_post_history($db, $sub, $post_id, $settings) $post_id = "{$row[0]}"; $org_id = "{$row[1]}"; $post_text = "{$row[3]}"; - $post_text = break_text(bbcode_to_html($post_text, $settings, $sub), - $settings); + $post_text = break_text(bbcode_to_html($post_text, $settings, $sub)); $id_text = make_id_text($post_id); $timestamp = "{$row[4]}"; $name = "{$row[5]}";