#9 edit answer: newline turned into <br />

open
nobody
3
2006-01-16
2006-01-16
Jakub Holý
No

1.When editting a survey, add a question with a newline
in the Question Text, e.g.:
---
What do you think
about blue pigs?
---

2.Save the question.
3.Edit the question (click the Edit button) - the text
shown includes the newline and a new <br />:
---
What do you think<br />
about blue pigs?
---
4.Repeate save/edit to get more <br />s.

uccass: 1.8.2 (cvs)

Expected behaviour: The <br /> shouldn't appear.
Likely cause: nl2br is called unnecessarily
Note: survey_text_mode = 2, user_text_mode = 2

Discussion

  • Jakub Holý
    Jakub Holý
    2006-01-16

    • priority: 5 --> 3
     
  • John Holmes
    John Holmes
    2006-01-17

    Logged In: YES
    user_id=609197

    Jakub,

    I have a fix for this in my CVS which I should upload today.
    It involves making another SAFE_STRING version,
    SAFE_STRING_TEXTAREA, that'll be used for text that needs to
    be displayed in a textarea. There's only two places where
    it'll be needed, iirc. The code uses SAFE_STRING_TEXT now,
    which includes the nl2br() call.

    ---John Holmes...