Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 150404
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Mozilla Gentoo Team <mozilla@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Alexander Skwar <askwar@digitalprojects.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
mozilla-launcher-encode-comma.patch patch to mozilla-launcher to escape commas in urls patch Richard Fish 2006-11-12 11:09 0000 382 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 150404 depends on: Show dependency tree
Bug 150404 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-10-07 12:09 0000
http://alexander.skwar.name/~askwar/stuff/text-with,comma
http://alexander.skwar.name/~askwar/stuff/text-with

Run:
/usr/bin/firefox http://alexander.skwar.name/~askwar/stuff/text-with,comma

Expected result:
The URL http://alexander.skwar.name/~askwar/stuff/text-with,comma is loaded in
the browser. Text displayed:
If you see this text, the client loaded the complete URL, ie. WITH the comma
(,) in the URL.

Actual result:
URL http://alexander.skwar.name/~askwar/stuff/text-with is loaded. Text
displayed:
If you see this text, the client shortened the URL before the , (comma).

Assumed explanation:
The , in the URL is causing problems. Although I did not test this, I assume
that this bug will also effect seamonkey and any other application using
mozilla-launcher. When I use the original firefox from http://mozilla.com/, I
don't have this problem.

I'm currently using mozilla-launcher-1.52-r1.

------- Comment #1 From Alexander Skwar 2006-10-08 02:16:20 0000 -------
The bug only occurs, when there's already another firefox running (for the
current user, I assume). If this starts up a new firefox session, it works just
fine.

------- Comment #2 From Alexander Skwar 2006-10-08 02:24:21 0000 -------
The original firefox doesn't do any magic with openURL and such. Instead, when
"firefox http://alexander.skwar.name/~askwar/stuff/text-with,comma" is run, the
folllowing gets eventually executed:

    ./firefox-bin http://alexander.skwar.name/~askwar/stuff/text-with,comma

Maybe this could be adopted for mozilla-launcher?

If not, then "special" characters, like the , (comma), should be urlencoded. At
least for the URL given as a test case, 

   http://alexander.skwar.name/~askwar/stuff/text-with%2Ccomma

works as well.

------- Comment #3 From Alexander Skwar 2006-10-08 03:19:55 0000 -------
Hmm... Where's the advantage of using mozilla-launcher over using
/usr/lib/mozilla-firefox/firefox? I modified /usr/bin/firefox and did:

+++ /home/alexander/tmp/firefox 2006-10-08 12:19:21.000000000 +0200
@@ -4,7 +4,12 @@
 # but OOo brokenness makes it necessary to use a stub instead:
 # http://bugs.gentoo.org/show_bug.cgi?id=78890

+set -x
+
 export MOZILLA_LAUNCHER=firefox
 export MOZILLA_LIBDIR=/usr/lib/mozilla-firefox
 export MOZ_PLUGIN_PATH=${MOZ_PLUGIN_PATH:-/usr/lib/nsbrowser/plugins}
-exec /usr/libexec/mozilla-launcher "$@"
+#exec ~/tmp/mozilla-launcher "$@"
+
+exec /usr/lib/mozilla-firefox/firefox "$@"
+

What will not work?

------- Comment #4 From Jakub Moc (RETIRED) 2006-10-13 10:52:58 0000 -------
*** Bug 149215 has been marked as a duplicate of this bug. ***

------- Comment #5 From Alexander Skwar 2006-10-29 11:55:20 0000 -------
Any idea, about when something might be done about this? I'd also like to know,
what mozilla-launcher is good for - what would break, if it were dumped?

------- Comment #6 From Alexander Skwar 2006-11-12 01:31:41 0000 -------
Ping?

------- Comment #7 From Richard Fish 2006-11-12 11:09:53 0000 -------
Created an attachment (id=101759) [details]
patch to mozilla-launcher to escape commas in urls

------- Comment #8 From Alexander Skwar 2006-11-13 01:02:19 0000 -------
(In reply to comment #7)
> Created an attachment (id=101759) [edit] [details]
> patch to mozilla-launcher to escape commas in urls
> 

Having had a closer "look" at this, I dislike this patch. Reason: Up to now
firefox eventually runs the openURL remote command. Users might know this and
might make use of this. So a user might call "firefox
http://gentoo.org/,new-tab" to have http://gentoo.org/ opened in a new tab. If
this patch is applied, this won't work anymore.

------- Comment #9 From Matthew Kennedy (RETIRED) 2006-11-13 07:11:54 0000 -------
URLs including ')' in them cause mozilla-launcher to fail as well.

------- Comment #10 From Martin von Gagern 2006-12-20 01:32:22 0000 -------
(In reply to comment #8)
> Users might know this and might make use of this.
> So a user might call "firefox http://gentoo.org/,new-tab" to have
> http://gentoo.org/ opened in a new tab.

Talking about a command line interface, the cleaner approach would be something
like "firefox --new-tab http://gentoo.org/" or something similar.
Sure, that would break backward compatibility, but I believe it's worth it.
It would be nice if we could make the launcher intelligent enough to handle
this--

------- Comment #11 From Martin von Gagern 2006-12-20 01:32:22 0000 -------
(In reply to comment #8)
> Users might know this and might make use of this.
> So a user might call "firefox http://gentoo.org/,new-tab" to have
> http://gentoo.org/ opened in a new tab.

Talking about a command line interface, the cleaner approach would be something
like "firefox --new-tab http://gentoo.org/" or something similar.
Sure, that would break backward compatibility, but I believe it's worth it.
It would be nice if we could make the launcher intelligent enough to handle
this--—if the launcher is indeed needed, which I know nothing about yet.

------- Comment #12 From Christian Marie (RETIRED) 2006-12-26 17:13:09 0000 -------
Fixed in 1.56

------- Comment #13 From Togge 2007-05-02 15:03:26 0000 -------
Please reopen and revert the patch. This breaks all links in mails that have
commas in them. Until a correct way to handle new-tab is found. My guess is
that there are more users using firefox as a browser and tries to open links
from a mail client then there are users using the ",new-tab" way.

A better way would be to not filter commas but rather the valid command that
can be sent to openURL.

------- Comment #14 From Alexander Skwar 2007-05-02 16:07:36 0000 -------
(In reply to comment #13)
> Please reopen and revert the patch. This breaks all links in mails that have
> commas in them.

It does? How so? I just verified, and when I run

  firefox http://alexander.skwar.name/~askwar/stuff/text-with,comma

the URL "http://alexander.skwar.name/~askwar/stuff/text-with%2ccomma" is
loaded. It shows the contents of the file "text-with,comma". Exactly like
expected.

When and where does the patch NOT work?

Anyway - a better idea might be to NOT fiddle at all with the URL *AND* also
*NOT* use openURL() at all anymore. As written in the comments of this bug, the
plain "firefox" script from Mozilla.com works just fine. The mozilla-launcher
covers just for some corner cases.

> Until a correct way to handle new-tab is found. My guess is
> that there are more users using firefox as a browser and tries to open links
> from a mail client then there are users using the ",new-tab" way.

I don't understand. As it is right now, the ",new-tab" stuff doesn't work
anyway. Reason: ",new-tab" is converted to "%2cnew-tab". This is not a valid
openURL() parameter and thus interpreted as part of the URL.

> A better way would be to not filter commas

Sort of. If openURL() is used, commas have to be filtered.

Anyway. Please provide a testcase. Broken servers should not matter (only
broken servers don't handle the translation %2c -> ,).

My testcase is the following URL:
http://alexander.skwar.name/~askwar/stuff/text-with,comma

Try to load this URL and also:

http://alexander.skwar.name/~askwar/stuff/text-with

------- Comment #15 From Togge 2007-05-02 17:24:22 0000 -------
Well as far as I can tell, according to rfc2616 and rfc2396 the comma is a
reserved character that may not be escaped.

But any way if the openURL() call is depreciated then why break legal url's to
be compliant with openURL()? or see if openURL is in the call (possible?) and
only then filter ",","(",")"

------- Comment #16 From Alexander Skwar 2007-05-02 19:19:12 0000 -------
(In reply to comment #15)
> Well as far as I can tell, according to rfc2616 and rfc2396 the comma is a
> reserved character that may not be escaped.

I'm still checking that. Care to point out, which sections of the FAQ mention,
that reserved characters may not be escaped?

I understand RfC 2396 so, that reserved characters (eg. "," or "?") are NOT to
be escaped, if they serve a special function. Eg. the "?" serves as a delimiter
in the Request URI as a delimiter between the "script name" and the query
string (eg. in http://example.com/foo.htm?bar=yep, the bar=yep is the query
string). In such a case, the "?" is not allowed to be escaped. In other cases
it can (or sometimes must) be escaped. The same holds true for "," (although I
don't know when or where the "," serves a special purpose IN REAL LIFE USAGE).

> But any way if the openURL() call is depreciated then why break legal url's to
> be compliant with openURL()?

Simple - because otherwise, they don't work. If you pass
"http://alexander.skwar.name/~askwar/stuff/text-with,comma" as a parameter to
openURL(), Firefox (& SeaMonkey) will try to open the URL
"http://alexander.skwar.name/~askwar/stuff/text-with". The ",comma" will be
interpreted as a parameter on how to open. Basically, Firefox will then check
if ",comma" is equal to ",new-tab" and as it's not and as openURL() doesn't
know anything about ",comma", it'll silently ignore it.

Result: http://alexander.skwar.name/~askwar/stuff/text-with is loaded.

To overcome this, the , needs to be translated to %2c.

> or see if openURL is in the call (possible?) and
> only then filter ",","(",")"

As long as openURL() is used, the "," (and also "(" and ")") always need to be
escaped.

Anyway - how about a testcase? Which URL breaks? All the URLs I tested worked.
Granted, compared to the some billion URLs there are on the internet, I only
tested a *VERY* minor fraction... :)

Here's another working URL:
http://www.spiegel.de/politik/ausland/0,1518,480652,00.html ->
http://www.spiegel.de/politik/ausland/0%2c1518%2c480652%2c00.html

------- Comment #17 From Togge 2007-05-03 06:21:01 0000 -------
(comment #16)
From the examples you've given it seems like the comma is used as a character
in the url instead as a delimiter. In my url (like this:
http://www.bovision.se/scripts/bovision/prenbesk.phtml?nnnnnn,nnnn&confirmed=1&OBJGUID=nnnnnnn&OBJTYPE=CMVILLA&nyabesk=1
(n=a digit, removed due to subscription info)) it is used as a delimiter.

rfc2616: 3.2.3 URI Comparison
rfd2396: 3.4. Query Component

However as you said in comment #14: openURL() doesn't work now so why keep a
fix for it that 1: doesn't work and 2: breaks other things?

------- Comment #18 From Alexander Skwar 2007-05-03 08:26:08 0000 -------
Hm, I still don't quite understand.

The test URL you provided seems to be using PHP (because of the .phtml). When I
go to another test URL of mine, PHP (or Apache?) seems to translate the %2c to
a , just fine.

Compare http://digitalprojects.com/PHPInfo/index.php3?foo%2cbar=john.doe to
http://digitalprojects.com/PHPInfo/index.php3?foo,bar=john.doe. Scroll all the
way down to "PHP Variables". On both URLs, you'll find: _REQUEST["foo,bar"].

If I go to
http://www.bovision.se/scripts/bovision/prenbesk.phtml?nnnnnn,nnnn&confirmed=1&OBJGUID=nnnnnnn&OBJTYPE=CMVILLA&nyabesk=1
(ie. with ,), I get an error message:  Input string was not in a correct
format.

Could you provide a test case, please? Up to now, I'm not yet convinced, that
the , -> %2c translation is breaking things in the real world (although I of
course don't matter, as I'm not a dev...). Anyway, without a testcase, I
suppose it'll be hard to convince the devs that something is broken and should
be changed.

------- Comment #19 From Jakub Moc (RETIRED) 2007-05-12 16:29:42 0000 -------
*** Bug 178224 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug