Edgewall Software
Modify

Opened 17 years ago

Closed 16 years ago

#6251 closed defect (duplicate)

ticket description sometimes fails with rendering error

Reported by: nick+trac@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.10.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

My installation of trac (0.10.4) has an error when rendering tickets with too many weird things in between <% and %>. This is fairly common for error reports that contain rhtml or asp (etc). I'm not certain that <% and %> are what are triggering the problem… but I've tried to narrow it down to a small bit of text that will cause the problem.

This ticket will try to trigger this with its description:

<%= foobar, { :foo ⇒ 'foos', :bar ⇒ 'bar', :blah⇒@bar.blah("#{foobar}_blah").id }, :id⇒"#{bleh}_blah" %>

Attachments (0)

Change History (6)

comment:1 by nick+trac@…, 17 years ago

Interesting… the t.e.o installation doesn't seem to have the bug, or at least isn't triggered by the same text that would trigger the bug on my installation. Perhaps a plugin I have is causing the issue?

comment:2 by nick+trac@…, 17 years ago

FWIW, there are two versions of this bug on my installation: in one version rendering simply stops in the middle of some text (leaving the page half rendered, with no edit form). I've never seen anything in the trac log when that happens. In the other version, I get an error page whenever I try to render the ticket. Here is the exception it shows me:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 244, in dispatch
    req.display(template, content_type or 'text/html')
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 358, in display
    data = self.hdf.render(template, form_token)
  File "/usr/lib/python2.4/site-packages/trac/web/clearsilver.py", line 296, in render
    injector.feed(template.render())
  File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib/python2.4/HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.4/HTMLParser.py", line 226, in parse_starttag
    endpos = self.check_for_whole_start_tag(i)
  File "/usr/lib/python2.4/HTMLParser.py", line 301, in check_for_whole_start_tag
    self.error("malformed start tag")
  File "/usr/lib/python2.4/HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParseError: malformed start tag, at line 103, column 79

comment:3 by Emmanuel Blot, 17 years ago

Version: 0.10.4

comment:4 by anonymous, 17 years ago

Also, both versions of the bug go away when you surround the text with {{{ and }}}

comment:5 by Christian Boos, 17 years ago

Keywords: needinfo added

Aren't you using SilverCity highlighting, which is known to generate malformed HTML with some input? (see e.g. #4365)

If you're using the {{{ ... }}} blocks without specifying a processor, things will work, but if you're specifying a #!xyz line, this is what should trigger the issue. However I don't see how the bug could be triggered without any code block at all. Maybe a faulty plugin as you said?

Can you show us the original wiki text of the ticket and comments from the db, as well as the rendering of ticket page when you temporarily disable the form token injector?

  • trac/web/api.py

     
    355355        else:
    356356            form_token = None
    357357            if content_type in ('text/html', 'application/xhtml+xml'):
    358                 form_token = self.form_token
     358                pass # form_token = self.form_token
    359359            data = self.hdf.render(template, form_token)
    360360
    361361        self.send_response(status)

comment:6 by Christian Boos, 16 years ago

Keywords: needinfo removed
Resolution: duplicate
Status: newclosed

Closing as duplicate of #4365, #4691

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.