Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(145)

Issue 4641064: Factor out a replaceable tagPolicy to enable customization of the sanitizer.

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 11 months ago by zestyping
Modified:
14 years, 7 months ago
Reviewers:
MikeSamuel, kpy
CC:
felix8a, google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

This exposes a hook named 'tagPolicy' in the sanitizer so that the sanitizer can be customized to accept or transform particular tags, for example, to accept <iframe> tags with a specific SRC, or transform <embed> tags into <iframe> tags. makeTagPolicy, sanitizeAttribs, and sanitizeWithPolicy are factored out so that they can be easily reused in custom tagPolicy functions.

Patch Set 1 #

Patch Set 2 : Factor out a replaceable tagPolicy to enable customization of the sanitizer. #

Patch Set 3 : Factor out a replaceable tagPolicy to enable customization of the sanitizer. #

Patch Set 4 : Add formatting changes enforced by JS linter :( #

Patch Set 5 : Clarify documentation of uriPolicy and nmTokenPolicy #

Patch Set 6 : Small indentation fix #

Patch Set 7 : Small indentation fix #

Total comments: 14

Patch Set 8 : Small indentation fix #

Patch Set 9 : Don't omit attributes that have empty values. #

Total comments: 3

Patch Set 10 : Fix usemap bug; add tests to html-sanitizer-test.js; fix Linter so that build and tests all succeed. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -241 lines) Patch
M src/com/google/caja/ancillary/linter/Linter.java View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/com/google/caja/plugin/html-sanitizer.js View 1 2 3 4 5 6 7 8 9 12 chunks +292 lines, -239 lines 0 comments Download
M tests/com/google/caja/plugin/html-sanitizer-test.js View 1 2 3 4 5 6 7 8 9 3 chunks +28 lines, -2 lines 0 comments Download

Messages

Total messages: 14
zestyping
14 years, 11 months ago (2011-06-21 22:31:49 UTC) #1
zestyping
14 years, 8 months ago (2011-09-22 02:23:49 UTC) #2
zestyping
14 years, 8 months ago (2011-09-22 02:30:06 UTC) #3
zestyping
14 years, 8 months ago (2011-09-22 02:34:55 UTC) #4
zestyping
14 years, 8 months ago (2011-09-22 02:37:11 UTC) #5
MikeSamuel
http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js#newcode1 src/com/google/caja/plugin/html-sanitizer.js:1: // Copied from r4631 of the google-caja project, then ...
14 years, 8 months ago (2011-10-06 12:30:22 UTC) #6
kpy
Thanks! All done, please take another look. http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js#newcode1 src/com/google/caja/plugin/html-sanitizer.js:1: // Copied ...
14 years, 8 months ago (2011-10-06 13:52:02 UTC) #7
MikeSamuel
http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js#newcode550 src/com/google/caja/plugin/html-sanitizer.js:550: attribs[i + 1] = value || null; On 2011/10/06 ...
14 years, 8 months ago (2011-10-06 23:09:18 UTC) #8
zestyping
14 years, 8 months ago (2011-10-07 18:11:44 UTC) #9
kpy
http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/11002/src/com/google/caja/plugin/html-sanitizer.js#newcode550 src/com/google/caja/plugin/html-sanitizer.js:550: attribs[i + 1] = value || null; Oh, looks ...
14 years, 8 months ago (2011-10-07 18:15:38 UTC) #10
MikeSamuel
LGTM modulo a fix for the bug you identified. http://codereview.appspot.com/4641064/diff/21001/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/21001/src/com/google/caja/plugin/html-sanitizer.js#newcode536 src/com/google/caja/plugin/html-sanitizer.js:536: ...
14 years, 8 months ago (2011-10-09 07:02:36 UTC) #11
kpy
http://codereview.appspot.com/4641064/diff/21001/src/com/google/caja/plugin/html-sanitizer.js File src/com/google/caja/plugin/html-sanitizer.js (right): http://codereview.appspot.com/4641064/diff/21001/src/com/google/caja/plugin/html-sanitizer.js#newcode536 src/com/google/caja/plugin/html-sanitizer.js:536: if (value && '#' === value.charAt(0)) { On 2011/10/09 ...
14 years, 8 months ago (2011-10-19 00:18:42 UTC) #12
zestyping
14 years, 7 months ago (2011-10-19 17:42:00 UTC) #13
MikeSamuel
14 years, 7 months ago (2011-10-31 16:16:09 UTC) #14
On 2011/10/19 17:42:00, zestyping wrote:

Took over at http://codereview.appspot.com/5305081
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b