View Full Version : Comments insert double breaks
tintn
11-02-2006, 06:02 AM
the comments in version 1.5 seem to double the breaks in people's comments. meaning when i person sticks in a /br, it gets done twice. if a person sticks in two /br, it gets done four times. this didnt happen in version 1.4.3. any ideas where i can look? thanks.
Update to new 1.5 as we dont support any more old buggy 1.4.3.
tintn
11-02-2006, 04:52 PM
huh? the double breaks problem is happening in version 1.5. i'm using version 1.5.
this phenomenon did not happen in version 1.4.3.
each type the person presses 'enter/return' in their comment, it gets two /BR instead of one. how can i fix this? thanks.
Sorry, at frist moment I misunderstood your post.
Can you give me a link?
I see normal behavior of new lines in comments content at my site and Ive got same code for comment content storing.
tintn
11-02-2006, 05:06 PM
i just private messaged you with my link. thanks geoS!
As I sent you PM:
It can be a problem that your server after doing nl2br function on text doesnt replace new line chars with breaks but add them after breaks.
When comment is in store process there are converted all 3 and more new line to only 2. Then there is place for nl2br function which should replace nl char with br tag. Then at displaying process there is one more time nl2br function. You can remove it - line 84 in /includes/functions.php:
$image_comments .= "<li>".nl2br($comment_message)."<br />$comment_name @ $comment_datetime</li>";
by changing to:
$image_comments .= "<li>".$comment_message."<br />$comment_name @ $comment_datetime</li>";
tintn
11-02-2006, 08:30 PM
GeoS's solution worked! PP rules.
Dennis
11-02-2006, 08:47 PM
This has happened to me also, couldn't be bothered at the time.
So if first nl2br function works fine (or not) then this second isnt needed at all.
Im removing it from current dev version.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.