Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9730 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

strip_tags blows up with invalid html

Reported by: joevandyk Assigned to: core
Priority: high Milestone: 1.x
Component: ActionPack Version: edge
Severity: major Keywords: verified
Cc:

Description

strip_tags doesn't seem to like invalid html at all. This is pretty bad, imo. Causes a "stack level too deep" exception.

It used to work a while ago in rails trunk, at some point it stopped.

Attachments

strip_tags_failing_test.patch (0.6 kB) - added by joevandyk on 09/28/07 20:46:00.
Failing test
strip_stack_too_deep.patch (2.9 kB) - added by lifofifo on 09/28/07 22:11:30.

Change History

09/28/07 20:46:00 changed by joevandyk

  • attachment strip_tags_failing_test.patch added.

Failing test

09/28/07 22:11:11 changed by lifofifo

Nice catch! I've uploaded a patch taking care of the issue and adding some more tests. The patch also fixes similar issue with strip_links()

09/28/07 22:11:30 changed by lifofifo

  • attachment strip_stack_too_deep.patch added.

09/28/07 23:46:58 changed by joevandyk

Works for me, +1

09/29/07 15:56:46 changed by rmm5t

+1 applies cleanly; tests pass

09/29/07 18:31:52 changed by norbert

  • keywords set to verified.

Nice catch, works like a charm.

09/29/07 20:19:36 changed by david

  • status changed from new to closed.
  • resolution set to fixed.

(In [7677]) Fixed that strip_tags blows up with invalid html (closes #9730) [lifo]