Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1485 closed bug (fixed)

Extra line feed in forum post after editing a post and also in notification

Reported by: jeanyves Owned by: globetrotter_tt
Priority: critical Milestone: 0.5.3 - bugfixing
Component: BW Forum Keywords: extra lines, line feed
Cc: micha


We have plenty of linefeed in edited forum post

they are also extra linefeed in notifications

This might be a browser issue (Firefox and Chrome seems to differ in behavior)

Change History (8)

comment:1 Changed 7 years ago by jeanyves

I add some input of Tim and Leonardo

This was one of the things i looked at, I could not get to the bottom of it though. I'm not a PHP head.

If you are and want to have a look at the code, the message to be edited is writen into the text box in this file, from line 142

Here are the specific lines of code:

142 <textarea id="create-tags" name="tags" cols="60" rows="2" class="long" 143 <?php 144 In case we are in edit mode, this field is a read only, tags cannot be edited by members 145 lupochen asks: Why? 146 if ($edit) { 147 echo "\"readonly\"" ; 148 } 149 ?>><?php 150 the tags may be set 151 echo ($tags_with_commas) ? htmlentities($tags_with_commas, ENT_COMPAT, 'utf-8') : ; 152 ?></textarea>

On 27 September 2011 17:12, Leonardo Boselli <leo@…> wrote: withut looking a code i have a suspect, to reduce to half the search:

i have noted that if I edit a post in forum lines are duplicated in edit window; so either ther eis a bug in reading that doubles or in writing. People with acces to the real database can check if in the database the messages are stared correctly ? if so the problem is in the reading routine, else in the writing ! so reducing the hunt.

Leonardo Boselli Firenze, Toscana, Italia, Europa

comment:2 Changed 7 years ago by globetrotter_tt

my guess it's the getAdvancedHtmlPurifier() function in ./modules/htmlpurify/lib/htmlpurify.lib.php:84

public function getAdvancedHtmlPurifier()
        require_once(SCRIPT_BASE . 'lib/htmlpurifier/library/HTMLPurifier.standalone.php');
        $config = HTMLPurifier_Config::createDefault();
        $config->set('AutoFormat.AutoParagraph', true); // automatically turn double newlines into paragraphs
        $config->set('AutoFormat.Linkify', true); // automatically turn stuff like into links
        return new HTMLPurifier($config);

Last edited 7 years ago by globetrotter_tt (previous) (diff)

comment:3 Changed 7 years ago by globetrotter_tt

  • Milestone changed from unassigned to 0.5.3 - bugfixing

comment:4 Changed 7 years ago by globetrotter_tt

  • Owner set to globetrotter_tt
  • Status changed from new to accepted

comment:5 Changed 7 years ago by globetrotter_tt

  • follow_up changed from none to test on alpha

comment:6 Changed 7 years ago by planetcruiser

globetrotter_tt: wow, nice find! :)

comment:7 Changed 7 years ago by globetrotter_tt

  • follow_up changed from test on alpha to test on production
  • Resolution set to fixed
  • Status changed from accepted to closed

comment:8 Changed 7 years ago by globetrotter_tt

  • follow_up changed from test on production to none
Note: See TracTickets for help on using tickets.