Closed Bug 410726 Opened 17 years ago Closed 17 years ago

address bar eats escaped newlines

Categories

(Firefox :: Address Bar, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3 beta3

People

(Reporter: zeniko, Assigned: zeniko)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

Steps to Reproduce:
1. Copy this bug's URL to the address bar and hit Enter.

Expected Results:
An alert reading "stab".

Actual result:
An alert reading "s	ab" (the newline separated \ from t - now they're interpreted as a <tab>).

Depending on how bug 397815 gets fixed, this issue might get fixed as well.
Summary: address bar eats newlines → address bar eats escaped newlines
Assignee: nobody → dao
Blocks: 366797
So bug 397815 didn't fix this completely...

New Steps to Reproduce:
1. Copy&paste the following into the address bar and hit Enter/Go:
> data:text/plain,Percent:%20%25%0ANewline
2. Hit Enter again

Expected Result:
Nothing happens (two lines are displayed after both steps 1 and 2).

Actual Result:
After step 2, the newline vanishes.

I guess that's because the urlbar is set to newlines="stripsurroundingwhitespace" but whitespace isn't properly escaped at
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/base/content/browser.js&rev=1.925&mark=1909,1916#1881

>-        value = decodeURI(value).replace(/%/g, "%25");
>+        value = decodeURI(value).replace(/[%\r\n\t]/g, encodeURI);

would fix this issue for me.
(In reply to comment #1)
> >-        value = decodeURI(value).replace(/%/g, "%25");
> >+        value = decodeURI(value).replace(/[%\r\n\t]/g, encodeURI);
> 
> would fix this issue for me.

I think this makes sense. Would you like to take the bug?
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3 M11
Oops.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
See comment #4 for why we need to keep newlines and tabs encoded as well.
Assignee: dao → zeniko
Status: REOPENED → ASSIGNED
Attachment #296754 - Flags: review?(mano)
s/comment #4/comment #1/
Comment on attachment 296754 [details] [diff] [review]
keep non-space whitespace encoded

r=mano
Attachment #296754 - Flags: review?(mano) → review+
Attachment #296754 - Flags: approval1.9?
Why not just use \s?
Attachment #296754 - Flags: approval1.9? → approval1.9+
(In reply to comment #7)
Because we explicitly don't want to have %20 for plain spaces. At least that's how I understand the intention of these decoding bits.
Keywords: checkin-needed
Checking in browser/base/content/browser.js;
/cvsroot/mozilla/browser/base/content/browser.js,v  <--  browser.js
new revision: 1.928; previous revision: 1.927
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: