aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authornatec <natec@users.sourceforge.net>2001-12-06 23:39:16 +0000
committernatec <natec@users.sourceforge.net>2001-12-06 23:39:16 +0000
commit0a41688fa1b31160114707798d5a39c5d2be936f (patch)
treeda80c24c506783a795ec94e444b69e8af610319d /phpBB
parentdd8d0ddc6db86303fb9632c7a5832ed0461079be (diff)
downloadforums-0a41688fa1b31160114707798d5a39c5d2be936f.tar
forums-0a41688fa1b31160114707798d5a39c5d2be936f.tar.gz
forums-0a41688fa1b31160114707798d5a39c5d2be936f.tar.bz2
forums-0a41688fa1b31160114707798d5a39c5d2be936f.tar.xz
forums-0a41688fa1b31160114707798d5a39c5d2be936f.zip
fixed [code] bbcode linebreaking nbsp; stuff.
git-svn-id: file:///svn/phpbb/trunk@1520 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/bbcode.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index fb5c86333d..eb301fe6cd 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -225,6 +225,7 @@ mt_srand( (double) microtime() * 1000000);
function make_bbcode_uid()
{
// Unique ID for this message..
+
$uid = md5(mt_rand());
$uid = substr($uid, 0, BBCODE_UID_LEN);
@@ -537,11 +538,10 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
$after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace);
- // Replace all spaces with non-breaking spaces.
- $after_replace = str_replace(" ", "&nbsp;", $after_replace);
-
- // Replace 3 nbsp's with "&nbsp; &nbsp;" so non-tabbed code indents without making huge long lines.
- $after_replace = str_replace("&nbsp;&nbsp;&nbsp;", "&nbsp; &nbsp;", $after_replace);
+ // Replace 2 spaces with "&nbsp; " so non-tabbed code indents without making huge long lines.
+ $after_replace = str_replace(" ", "&nbsp; ", $after_replace);
+ // now Replace 2 spaces with " &nbsp;" to catch odd #s of spaces.
+ $after_replace = str_replace(" ", " &nbsp;", $after_replace);
// Replace tabs with "&nbsp; &nbsp;" so tabbed code indents sorta right without making huge long lines.
$after_replace = str_replace("\t", "&nbsp; &nbsp;", $after_replace);