Every edit link adds line breaks

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-21-2007, 01:38 PM
Pligg Donor
 
Join Date: Dec 2006
Location: Amsterdam
Posts: 30
When I enter a story with newlines in the content, they're replaced with <br/>'s. That's fine. But every time I save changes, an extra level of <br/>'s is added:

Code:
This is a line.

This is a line.
Submit and edit again:

Code:
This is a line.
<br />
<br />This is a line.
<br />
<br />
Submit and edit again:

Code:
This is a line.
<br /><br />
<br /><br />This is a line.
<br /><br />
<br /><br />
And so on. This is beta 9 in Internet Explorer 7.
Reply With Quote
  #2 (permalink)  
Old 01-21-2007, 01:54 PM
Pligg Donor
 
Join Date: Dec 2006
Location: Amsterdam
Posts: 30
I patched this problem by adding a condition to the newlinification in editlink.php:

Code:
      if ( !strstr($linkres->content, '<br />'))
      {
              $linkres->content = str_replace("\n", "<br />", $linkres->content);
      }
In this way, newlines are not replaced when there are already <br />'s in the text (most likely by an earlier newlinification).
Reply With Quote
  #3 (permalink)  
Old 01-24-2007, 12:26 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
I think Savant also fixed this is the latest code. http://pligg.svn.sourceforge.net/vie...v&revision=620
Reply With Quote
  #4 (permalink)  
Old 01-24-2007, 09:01 AM
Constant Pligger
Pligg Version: 9.8
Pligg Template: garx mod
 
Join Date: Oct 2006
Location: Poland
Posts: 124
another similar thing -system adding space to tags, every edit makes space bigger, and in latest code is somthing wrong with short story option in edit. you can edit this, and save, but on main page will be everytime old version
Reply With Quote
  #5 (permalink)  
Old 01-24-2007, 09:09 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
Quote:
latest code is somthing wrong with short story option in edit. you can edit this, and save, but on main page will be everytime old version
nice catch. I've updated the SVN with the fix.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
/var/log/httpd/error_log messages gr8rcake Questions and Comments 4 06-01-2010 12:25 PM
Pligg Errors tcritic Questions and Comments 4 09-01-2009 10:40 AM
Upgrading a 9.8.2 template to 9.9 AshDigg Wiki Articles 10 05-01-2008 02:38 PM
cann't vote in pligg (buliding 802) haxhax Questions and Comments 27 03-10-2007 07:53 AM
ERROR: my_base_url is not set. Please correct this using the admin panel. Then refres search Questions and Comments 7 11-14-2006 11:35 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development