URI validation and cleanup
| Project: | CCK Redirection |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
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"

#1
Hello, 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...
#2
Here 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...
#3
OK, sorry, realized I coded from 6.x-1.2 where there are still the line ends problems. Re-rolling against CVS HEAD.
#4
Finally !
#5
Hello ?