diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php index 5695ad9b..1f358c54 100644 --- a/ext/bbcode/main.php +++ b/ext/bbcode/main.php @@ -2,7 +2,10 @@ class BBCode extends FormatterExtension { public function format($text) { - $text = wordwrap($text, 80, " ", true); + global $config; + if($config->get_bool("word_wrap", true)) { + $text = wordwrap($text, 80, " ", true); + } $text = preg_replace_callback("/(\[img\]https?:\/\/.*?\[\/img\])/s", array($this, "unwrap"), $text); $text = preg_replace_callback("/(\[url=(?:https?|ftp|irc|mailto):\/\/.*?\])/s", array($this, "unwrap"), $text); $text = preg_replace_callback("/(\[url\](?:https?|ftp|irc|mailto):\/\/.*?\[\/url\])/s", array($this, "unwrap"), $text); @@ -46,7 +49,10 @@ class BBCode extends FormatterExtension { } public function strip($text) { - $text = wordwrap($text, 80, " ", true); + global $config; + if($config->get_bool("word_wrap", true)) { + $text = wordwrap($text, 80, " ", true); + } $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text); $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text); $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text); diff --git a/ext/setup/main.php b/ext/setup/main.php index 313c435b..98dc8aa7 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -164,6 +164,7 @@ class Setup extends SimpleExtension { $config->set_default_string("base_href", "./index.php?q="); $config->set_default_string("theme", "default"); $config->set_default_bool("use_autodate", true); + $config->set_default_bool("word_wrap", true); $config->set_default_string("use_autodate", "F j, Y"); $config->set_default_string("cookie_prefix", "shm"); }