2.0.2, Spaces in website links

Started by Robert., May 04, 2012, 06:34:02 PM

Previous topic - Next topic

Robert.

G'day, so I was searching for some bugs and I found one. Mostly, a forum has some members. Some have many. The thing is, sometimes there are morons who think they're cool and try breaking stuff. So, what did uncle 医生唱片骑师 do? Well, uncle 医生唱片骑师 added a website to his profile. But, because he likes breaking stuff, this was his link: http://I have asite.com. He saved it and try to click on it. It didn't work, because it contained spaces. So, I think there should be an url validator to keep morons happy and the users that click on their links. No mods installed, default theme.

Antechinus

So you're saying that if someone enters an invalid url it wont work, and this means there is a bug in the software? :D

Robert.

Nope, but I do think it's good to validate urls by using something like rawurlencode(). :)

Antechinus

Quotesearching for some bugs and I found one

Quoteyou're saying that if someone enters an invalid url it wont work, and this means there is a bug in the software

Hey ho.

Robert.

Well to be honest, I can't recall this a bug nor a feature, so I decided to go for a bug report instead. :P

Antechinus

I'm all in favour of making morons suffer for their stupidity. Natural selection and all that. ;)

MrPhil

Natural selection doesn't work fast enough...

Anyway, it's very common to have something like mySite.com or sample.com, which don't go to real sites. As long as it doesn't cause the browser to blow up (at least, in a way that threatens site security or lets the browser into places it shouldn't go), and I've never seen that, I say just leave it alone. If fools want to waste their time pressing on shiny links, let 'em. It keeps them occupied and out of the way...

Storman™

QuoteI'm all in favour of making morons suffer for their stupidity. Natural selection and all that.

Agree +1   ;)

Like MrPhil, I say leave alone as there may be a legitimate reason why someone enters a url like that. Doesn't necesaariliy mean it's a real url that goes somewhere.

Guess an option would be to have a mod that does as you ask and maybe throws up an error message. However, certainly don't think this should be part of core functionality nor should it be considered a "bug".

Trekkie101

We should validate our inputs, just as good practice, I think we should fix it for 2.1.

MrPhil

"Validating inputs" implies that it should be fixed or rejected as soon as someone clicks the Submit button. Are there any cases where BBCode etc. is checked upon input, rather than upon output? I think it would be more practical (if you want to do something about it) to check upon output for invalid characters in the href string. Ditto for images, etc.

Of course, from the resources-used point of view, it's better to format a post (process BBCode) up front once upon saving and save the processed version alongside the raw markup. It's possible that there might be some tags not resolvable until output time, but at least most of the BBCode processing will have been done ahead of time, saving server resources by not formatting over and over.

I still don't think it's worthwhile to worry about malformed URLs, unless it can be shown that it's a browser stability or security issue. Of course, others may feel differently. As I said before, sometimes they're not intended to be real domains or URLs, and it would be unnecessarily confusing to have error messages pop up (possibly better to highlight the presumed URL in some odd color and leave it inactive?).

Trekkie101

I didn't mean in the posts/BBCode, just the profile website link, hopefully thats simpler to verify to be accurate :)

I think we're on separate issues.

Arantor

So there is an issue with this - and it doesn't require any formatting or anything to be dealt with.

However... a space in a URL can actually be *legitimate* if stupid. The only place it's not legitimate is in a domain. If we have to do anything - and I'm not convinced we do - we should just urlencode the domain, but that might confuse users who expect their URL to be exactly as entered... maybe just urlencode the link on display.

Advertisement: