> From: JohnInKansas > > The difference in how mudcat posts the link appears to depend on whether the program that runs the site recognizes what you enter as a global link (that starts with an http or www or both) or interprets what you enter (by typing or by copy/paste) as a local link.
But that's just plain wrong, wrong, wrong. A URL like my own homepage, macfh.co.uk/CEMH.html, is a perfectly valid URL that no browser that I know of would misinterpret as a local relative URL.
If Mudcat is going to check and edit URLs on the fly, then it should do it properly*. Anything else is going to fail under some circumstance or other, and result in behaviour that is sufficiently close to that of malware that some might instinctively distrust the site. It would be better not to do attempt it at all than to attempt it and get it wrong.
* Getting it right is going to be far, far more difficult and involved than most people would ever imagine:
+ Check for the presence or absence of http://, https://, or ftp:// at the beginning. Reject file:// or [A-Za-z]:\
+ Check for a TLD at the end of the first section *.com *.org etc *.co.[country code] *.org.[country code] etc
+ Check for a valid IP as the complete first section, but reject those lying in the Link Local, Local DHCP, or localhost ranges
+ Check for 'localhost' as the complete first section
+ Check for and allow non-standard ports ending the first section
? Do you try to decode the URL if it has been copied, say, from a search engine result that has encoded it? ∓ becomes & %20 becomes a space %2F becomes / %3F becomes ? %3D becomes = etc
Etc, etc.
Trying to correct a URL is far from simple, and if you're not prepared to invest a great deal of time and effort in testing the result *exhaustively*, then it's probably better not to even attempt it.