2013/10/23 Isaac Bennetch <bennetch@gmail.com>


On 10/22/13 8:48 PM, Isaac Bennetch wrote:
> In the user description field of the error reporting server, new lines
> are represented as \n rather than <br> or some other HTML-friendly
> means. This is easy to fix, however I'm not sure where best to fix it.
>
> Do we convert the raw input before submission (line 58 of
> libraries/error_report.lib.php or on display (line 88 of
> app/View/Incidents/view.ctp)? I think it's best to do it on submission,
> but wanted to double-check first.
>

For example, see http://reports.phpmyadmin.net/incidents/view/62


Just a thought (I haven't looked at the code): if user's description is just a plain text it would be better to just pass it through nl2br just before displaying, after making sure that we convert all "\n" escape sequences to proper newlines before text is saved to our database.

--
Regards,
Piotr Przybylski