A node with a "cck redirect field" in use redirects a URI as expected. However when the information text "This node is redirected to a remote URI." is displayed the link (which encompasses the section of text "remote URI") unexpectedly points http:// instead of the expected /foo/bar
e.g. If "/foo/bar" is the set value for a cck redirect field, the href value for the text "remote URI" will have "http://" pre-appended. The resulting href value would end up being "http://foo/bar/".
Of note regarding the above example; there are are only two forward slashes and not three as would be expected if "/foo/bar" was concatenated to "http://" (e.g. http:///foo/bar). As it stands it appears the leading slash is removed from the URI.
Reproduction steps:
- Modify content type "Page"
- Add a new cck field for cck redirect
- Edit or create page node and enter a URI (e.g. without http://)
- Save the page, the resulting page will display the text "This node is redirected to a remote URI."
- Click the link "remote URI"
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | cck_redirection-445894-4.patch | 4.71 KB | guillaumeduveau |
| #2 | cck_redirection-445894-2.patch | 40.65 KB | guillaumeduveau |
Comments
Comment #1
guillaumeduveauHello, this is because there's no link validation yet, maybe we could add this after #501024: Code in CVS is saved with the wrong line ending format. I have the code ready, "stolen" straight away from CCK Link...
Comment #2
guillaumeduveauHere is an URI validation (protocols allowed : http, https) and cleanup (trims spaces, adds http:// if no protocol specified). The code is taken from CCK Link (why re-invent the wheel) and slightly adapted.
There seems to be still a problem with the lines numerotation (see #501024: Code in CVS is saved with the wrong line ending format), leading to big patches that remove a lot of code and adds it back...
Comment #3
guillaumeduveauOK, sorry, realized I coded from 6.x-1.2 where there are still the line ends problems. Re-rolling against CVS HEAD.
Comment #4
guillaumeduveauFinally !
Comment #5
guillaumeduveauHello ?
Comment #6
robin monks commentedTested and applied to 6.x branch.
Thanks for your work!
/Robin
Comment #7
robin monks commentedNeeds to be ported to 5.x to fix same issue there to fix bugs such as #185883.
/Robin