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

Issue 88118: uri normalization breaks several uris (Closed)

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

Description

When using a PluginEnvironment that allows URIs without rewriting, the cajoler will turn this: <a href="mailto:a@b"></a> <a href="http://a.b/c;_d=e"></a> into this: <a href="mailto:/a%40b"></a> <a href="http://a.b/c%3b%5fd%3de"></a> which doesn't mean the same thing at all. What's happening is the TemplateCompiler gets a URI String from the PluginEnvironment, then runs that String through normalizeUri, which is a little buggy and mangles the URI I don't see any particular reason to mistrust the string returned by the PluginEnvironment. So rather than trying to fix normalizeUri, I've removed the call to normalizeUri. I've also fixed the error message for invalid uris.

Patch Set 1 #

Total comments: 1

Patch Set 2 : uri normalization breaks several uris #

Patch Set 3 : uri normalization breaks several uris #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -34 lines) Patch
M src/com/google/caja/plugin/templates/TemplateCompiler.java View 1 2 2 chunks +2 lines, -5 lines 0 comments Download
M tests/com/google/caja/opensocial/example-rewritten.xml View 1 chunk +1 line, -1 line 0 comments Download
M tests/com/google/caja/plugin/templates/TemplateCompilerTest.java View 2 9 chunks +27 lines, -24 lines 1 comment Download
M tests/com/google/caja/plugin/templates/template-compiler-golden1-dynamic.html View 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/com/google/caja/plugin/templates/template-compiler-golden1-static.html View 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 10
felix8a
16 years, 11 months ago (2009-07-07 09:32:24 UTC) #1
MikeSamuel
http://codereview.appspot.com/88118/diff/1/3 File src/com/google/caja/lexer/escaping/UriUtil.java (right): http://codereview.appspot.com/88118/diff/1/3#newcode103 Line 103: if (path.length() != 0 || authority != null) ...
16 years, 11 months ago (2009-07-07 18:20:34 UTC) #2
felix8a
On 2009/07/07 18:20:34, MikeSamuel wrote: > http://codereview.appspot.com/88118/diff/1/3 > File src/com/google/caja/lexer/escaping/UriUtil.java (right): > > http://codereview.appspot.com/88118/diff/1/3#newcode103 > ...
16 years, 11 months ago (2009-07-07 19:02:07 UTC) #3
ihab.awad
Felix, please let me know when this is ready for review.
16 years, 11 months ago (2009-07-08 18:21:35 UTC) #4
felix8a
ok, looking at this some more, there are a lot more cases where URIs get ...
16 years, 11 months ago (2009-07-14 11:02:43 UTC) #5
felix8a
16 years, 11 months ago (2009-07-14 11:04:48 UTC) #6
felix8a
I missed a testcase that broke due to the normalization change. new snapshot.
16 years, 10 months ago (2009-07-15 08:36:10 UTC) #7
ihab.awad
Looks good, but see comments. What do you think? http://codereview.appspot.com/88118/diff/2001/2005 File tests/com/google/caja/plugin/templates/TemplateCompilerTest.java (right): http://codereview.appspot.com/88118/diff/2001/2005#newcode147 Line ...
16 years, 10 months ago (2009-07-16 00:27:26 UTC) #8
felix8a
On 2009/07/16 00:27:26, ihab.awad wrote: > Looks good, but see comments. What do you think? ...
16 years, 10 months ago (2009-07-16 19:43:47 UTC) #9
ihab.awad
16 years, 10 months ago (2009-07-17 22:46:04 UTC) #10
LGTM++

Optional whether or not you want to implement PluginEnvironment.getSafeUri().
Sign in to reply to this message.

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