wasimshaikh / php-calendar

Automatically exported from code.google.com/p/php-calendar
1 stars 0 forks source link

HTML tags added to text when event is modified #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an event with forced line breaks. (Simple entry, pressing "return" to 
create line breaks.
2. View event: All looks normal.
3. Modify event: '<br />' tag text is appended to the end of each line with a 
line break in the Description textarea.
4. '<br />' also shows as text in the display output when the modified event is 
saved.

What is the expected output? What do you see instead?
Expected output is visible line breaks with no visible html in both the event 
display and the event description textarea.

What version of the product are you using? On what operating system?
2.0 Beta8

Please provide any additional information below.

Original issue reported on code.google.com by kerri.mc...@gmail.com on 15 Sep 2010 at 6:24

GoogleCodeExporter commented 9 years ago
For what it's worth, to anyone else who might be having the same issue:

I commented out (around) line line 281 of calendar.php (in the :
//$text = nl2br($text);
This is what outputs the necessary <br /> into the html, but it was also adding 
it to the text area of the entry form.  

I then added it back into the php that displays the events (but not that 
displays it in the form). Basically, anywhere that called the function 
get_desc();

So, in display_event.php, display_day.php and search.php I changed the 
occurrences of:
$event->get_desc()
to
nl2br($event->get_desc())

(Which changes the /n line breaks that were stored in the database back into 
<br />s)

And I did NOT do the same to the occurrence in event_form.php.  The textarea 
there keeps the /n line breaks, and everything seems to format properly this 
way.

Original comment by kerri.mc...@gmail.com on 25 Sep 2010 at 1:00

GoogleCodeExporter commented 9 years ago
Thanks for the report! This is fixed in r473 and will be in the next release.

Original comment by sproctor@gmail.com on 19 Oct 2010 at 6:08