Some services such as EZproxy provide links have urls that provide another url as a query string parameter, for example:

http://ezproxy.domain.com/login?url=http://another.domain.com

It looks as if the URL validation is not properly formatting these links. The link turns into the following:

http://ezproxy.domain.com/login?url=http%3A//another.domain.com

It gets worse when the url passed as the query string has query strings in them, for example

http://ezproxy.domain.com/login?url=http://another.domain.com/some/file?...

turns into:

http://ezproxy.domain.com/login?url=http%3A//another.domain.com/some/fil...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ubun2Junky’s picture

pshafer;

I'm also having the exact same issue. I'm using ezProxy and I'm getting the exact same results. Seems like the query string is getting web encoded. Did you find a solution or a workaround?

pshafer’s picture

I actually hacked the link module, however we are also using proxy by host so were are slowly moving to changing the urls from:

http://ezproxy.host.edu/login?url=http://somehost.com/some/path

to

http://somehost.com.ezproxy.host.edu/some/path

Let me know if you want to see the changes I made to the link field module.

duckydan’s picture

I would like to see that please. Also using EZproxy and having major problems.

alevtina’s picture

I, too, am interested in seeing your changes. Please share!

modulo’s picture

I am having the same issue here. I would be interested in seeing your changes as well.

jcfiala’s picture

So, as far as I can see from looking at http://en.wikipedia.org/wiki/Query_string#URL_encoding, encoding the : in the querystring is what's supposed to happen.

adamzimmermann’s picture

I'm not super familiar with url encoding and my issue may not be the same as this one, but it seems related. If it is different, and not a works as designed issue let me know and I will file a new issue.

The first link is the link as entered, the second link is how it is being formatted when it is displayed on the page.

https://yulib002.mc.yu.edu:8443/login?url=http://www.jstor.org/action/showJournals?browseType=collectionInfoPage&selectCollection=britpam
https://yulib002.mc.yu.edu:8443/login?url=http%3A//www.jstor.org/action/showJournals%3FbrowseType%3DcollectionInfoPage&selectCollection=britpam

The second link returns a 404, which is obviously a problem. I fixed the issue in the interim by intercepting the link and calling urldecode() on it.

Let me know if this is something that is expected, related to this issue, and/or if I could help solve this by digging into the code if we determine this is an issue.

Thanks,
Adam.

Stac3y’s picture

I'm having the same problem. I'd like to see your changes too.

lex0r’s picture

Title: Issue when a URL is a query string parameter, e.g. EZproxy links » Issue when a URL is a query string parameter, e.g. EZproxy links, Zanox tracking links etc.
Priority: Normal » Major
Issue summary: View changes

The issue seems to be of major importance. I also stumbled upon it when working with some tracking URLs. Here is an example:

Original URL:
http://ad.zanox.com/ppc/?19542219C370930768&ULP=[[ASOS/ASOS-Spring-Break...

URL that is then rendered and available in entity field under "url" key:
http://ad.zanox.com/ppc/?19542219C370930768&ULP=%5B%5BASOS/ASOS-Spring-B...

As you may see, iid argument now doesn't have a value it should have (3413976). This is definitely a major bug, although it is mitigated by a bit specific conditions.

As a workaround, I will probably apply a patch from this issue https://drupal.org/node/1814444

lex0r’s picture

I found the reason, and the patch is really awesome :)
Incoming URL wasn't supposed to have second unescaped "=" inside "key=value" pair of the URL's query part. Now it only gets first two items of explode()'s result.

jcfiala’s picture

Status: Active » Reviewed & tested by the community

Ah, I see... that's interesting.

I don't see any problem with that patch, myself - anyone else want to give it a try, they can, but it looks simple enough for me to boost it up to RTBC.

  • Commit 994db97 on 7.x-1.x authored by lex0r, committed by jcfiala:
    Issue #2036645 by lex0r: restricting the explode to 2 items when...
jcfiala’s picture

Status: Reviewed & tested by the community » Fixed

Okay, this is merged into code, and should show up in 7.x-1.x-dev tomorrow sometime.

Thanks, lex0r, you should get credit for the commit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.