Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#4418 closed defect (worksforme)

inline <style> and <script> blocks removed

Reported by: ittayd@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.10.3
Severity: normal Keywords: review
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

i have created a page with the attached content. when i view the 'page source' through the browser, the <style> and <script> blocks are gone.

Attachments (1)

test.html (3.2 KB ) - added by ittayd@… 18 years ago.

Download all attachments as: .zip

Change History (6)

by ittayd@…, 18 years ago

Attachment: test.html added

comment:1 by ittayd@…, 18 years ago

btw, when i pasted the html code into a file, the browser showed it fine

comment:2 by sid, 18 years ago

Resolution: worksforme
Status: newclosed

If your server runs on an intranet (i.e. no security threats), you could add the missing tags <script> and <style> to the 'safe_tags' list defined in html.py file (line 185), so that these tags do not get filtered out of the rendered XHTML output stream.

comment:3 by ittayd@…, 18 years ago

why should i need to hack the code for that? what will happen in the next release (meaning, do i need to keep a list of all my code changes?)

in reply to:  3 comment:4 by Emmanuel Blot, 18 years ago

Keywords: review added

Replying to ittayd@qlusters.com:

what will happen in the next release (meaning, do i need to keep a list of all my code changes?)

I maintain a custom release of Trac to preserve my own changes (when a new version of Trac is released, I merge my changes with the new Trac code base).

why should i need to hack the code for that?

For now, there is no option to "render unsafe html" contents.

As this "issue" has been raised several times, maybe it is time to add an option so that the HTML sanitizer preserves all tags. Such an option would be useful when the Trac server is run on a private network.

in reply to:  2 comment:5 by Noah Kantrowitz <coderanger@…>, 18 years ago

Replying to sid:

If your server runs on an intranet (i.e. no security threats), you could add the missing tags <script> and <style> to the 'safe_tags' list defined in html.py file (line 185), so that these tags do not get filtered out of the rendered XHTML output stream.

Perhaps there should be an option in trac.ini to add tags/attrs to the list?

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.