Author |
Topic |
Podge
Support Moderator
Ireland
3775 Posts |
|
SiSL
Average Member
Turkey
671 Posts |
Posted - 12 January 2009 : 13:05:36
|
quote: Originally posted by HuwR
quote: Originally posted by SiSL
well, I'm not talking about any of things you mentioned Podge...
www.chip.com.tr/test/forum/test/forum.asp etc. when someone post it without bb/forum code, it should enter into database as it is already tagged... like [url]http://www.chip.com.tr/test/forum/test/forum.asp[/url] by post_info.asp ... No need to change anything or it would confuse things a lot more...
you still have the problem of deciding whether or not it is a valid url (that is the crux of the issue) before wrapping it in url tags
Ofcourse, but it is just done "only once", and it is while posting for just a single user. Not everytime this topic is viewed. That's the difference. You can simply wrap entire text that does not have space or a line break into url tags and only check this single line to security tests etc.
quote: Originally posted by Podge
IMHO www.chip.com.tr/test/forum/test/forum.asp should just be text if its not within url tags. Unless there are clear rules its impossible to account for every possibility. For example should snitz.com be a valid linked url or should it be text? If you have code that allows snitz.com as a valid url it will also allow the likes of the following;
I like ketchup on my chips.Come to McDonalds for all your nutritional needs.
By valid, I meant normal URL's that does posted as http:// or starting with www. and have typical URL properties. Only to be checked while posting, not while reading the topic.
Anyway, I'm doing some tests, like in this topic: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=67996 and waiting for 3.4.0.7 to continue on processes. HURRY UP for .07 !
< |
CHIP Online Forum
My Mods Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
|
Edited by - SiSL on 12 January 2009 13:43:05 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 12 January 2009 : 14:10:49
|
checking whether a string of text contains a valid url embedded in it is not as trivial as you seem to think, that is what the problem is with urls, not whether they are parsed pre or post insertion into the db.
even urls starting with http or www need validation.
< |
|
|
SiSL
Average Member
Turkey
671 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 12 January 2009 : 14:50:26
|
this issue has been discussed over and over again for nearly 10 years and it is still being discussed. unless you fancy porting the gigantic regexp that is required to validate every conceivable URL allowed by the RFC standards then we will most likely still be discussing it in 10 years time .
what I am trying to point out is that if you automatically parse valid URLs in the message, then why do we have URL tags ? is not the purpose of the tags to tell you it is a URL?
IMHO we should therefor not bother checking for URLs that are not in URL tags, it would save a whole heap of grief and aggravation and another 10 years of recurring discussions < |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 13 January 2009 : 04:42:10
|
quote: Originally posted by HuwR is not the purpose of the tags to tell you it is a URL?
This has always been my thinking, as well; you wouldn't expect a link written in HTML to be active without wrapping it in an anchor tag and isn't forum code essentially a simplified version of HTML?
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 13 January 2009 : 05:55:19
|
quote: Originally posted by Shaggy
quote: Originally posted by HuwR is not the purpose of the tags to tell you it is a URL?
This has always been my thinking, as well; you wouldn't expect a link written in HTML to be active without wrapping it in an anchor tag and isn't forum code essentially a simplified version of HTML?
I agree too. I think we should just remove the automatic recognition of URLs.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 13 January 2009 : 06:35:05
|
It seems we have a consensus - at least on the automatic recognition of URLs.
Rather than hold up 3.4.07 any longer than it has been, shall we agree to slate this for the next update?
Also, while that takes care of a lot of the "weird URL issues" we've been talking about, there's the other issue of long URLs forcing horizontal scrolling. I remember a few years back there was some discussion of (and some code for) snipping them in the middle and adding some ellipses. Alternately, I've also considered doing the URL shortening a la Marcel's Link Shrinker or just providing some text if none is provided. ([ url ]http://www.jesusjoshua2415.com[ /url ] -> [link]< |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
JJenson
Advanced Member
USA
2121 Posts |
Posted - 13 January 2009 : 10:15:29
|
Hey Marcel would you be willing to share the Link Shrinker Code with me? My brother has a site they want to truncate links and make them look like they are coming from their site ie www.theirdomain.com/theirtitle
Is this possible I am not going to use this for people to truncate their own urls?< |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 13 January 2009 : 10:36:48
|
Jeff, it's a bit offtopic, but here's how I built it. I'm afraid I cannot share the link shrinker code as it's my own addition to a commercial non-open source linkmanager package. The basic idea of the linkmanager is pretty straightforward however:
- enter URL on inputpage (example input.asp)
- store URL in a database (for example SQL) and auto-assign an ID to it.
- provide the redirection URL to the user (for example redirect.asp?URL=ID).
- everytime the redirect URL is requested, the counter for that URL in the database is increased by 1, and the browser is redirected to the URL found in the database using response.redirect.
I've added two features to it: Instead of decimal URL ID's use base62 encoded ID's using a-z, A-Z and 0-9, effectively enabling 62x62x62x62=14776336 ID's to be fitted in only 4 characters. Here's some more info: http://oxle.com/convert.asp Here's the function for that: http://oxle.nl/Wh If you'd want *clean* looking URL's isntead of cryptic urls such as the one above, I'd do it differently.
- enter URL *and title* on inputpage (example input.asp)
- if the title is already stored in the database, provide feedback to the user, to provide a new unique title.
- if the title is unique, store it together with the URL in the database
- provide the redirection URL to the user (for example http://mysite.com/link/title).
- enable a custom 404 page in the form of an ASP page, specifically checking for 404's in the above subfolder (/link/).
- have this custom 404 page do a lookup in the database for that unique title, and increase the viewcounter.
- have the custom 404 page perform the redirect to the URL found in the database using response.redirect(url).
This way you could create clean looking links like http://mysite.com/link/latestnews etc.< |
portfolio - linkshrinker - oxle - twitter |
|
|
SiSL
Average Member
Turkey
671 Posts |
Posted - 13 January 2009 : 11:44:01
|
quote: Originally posted by HuwR
what I am trying to point out is that if you automatically parse valid URLs in the message, then why do we have URL tags ? is not the purpose of the tags to tell you it is a URL?
I humbly disagree on the subject. We (designers, webmasters) use BBCODE URL tags to help "us" parse URL's and give links in HTML format "easily". But forgetting main thing that our primary duty is to make visitors life easier, not just us.
We can not quote for users, we can not put bold tags instead of them, but heck, we sure can do URL parsing and in so easy way that does leave URL's without parsed if they don't fit our expectations or give links if they do.
Let's just don't get lazy or "let go" for things. Com'on people where is your developer spirit to search for the better options ;)
Here is something to start with a basic solution for any long text... ­ character... Basically wraps text and adds - where it is wrapped...
ThatsalongtextthatdoesnothaveanyspacesinitsothatitisnotwrappedbyanyborderssowecanuseourshycharactersitissousefulwhenrenderedsuccessfullyforexamplehowevernowonderIneedtowritesomemoretexttofitmyscreenat1680x1050resolutiontogivebestresults.
< |
CHIP Online Forum
My Mods Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
|
Edited by - SiSL on 13 January 2009 11:54:00 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 13 January 2009 : 12:15:01
|
it has nothing to do with being lazy, have you actually got any ide how large the regexp is that is required to parse URL correctly ? if you can't do something correctly then IMHO you shouldn't do it at all. So no, we can't do url parsing, if we could, whay do we continue repeating this discussion over and over again ?
wrapping long text is an entirely different issue and is extremely easy to fix using a very basic regexp, URL's are not.< |
|
|
SiSL
Average Member
Turkey
671 Posts |
Posted - 13 January 2009 : 12:27:12
|
quote: Originally posted by HuwR
it has nothing to do with being lazy, have you actually got any ide how large the regexp is that is required to parse URL correctly ? if you can't do something correctly then IMHO you shouldn't do it at all. So no, we can't do url parsing, if we could, whay do we continue repeating this discussion over and over again ?
wrapping long text is an entirely different issue and is extremely easy to fix using a very basic regexp, URL's are not.
Trying to figure out how hard it can be. Nope, I'm not here for an argument. I just think you might be exaggrating about regexp. Beside, when it is done in during post, multiple steps of regexp pass would ease it. That's all I'm thinking at this moment...
If you have any hard-to-parse URLs as examples (most likely on a txt file since they might be problem in current code), I'd be happy to have them and do my tests which would help me greatly on my new forum design as well. < |
CHIP Online Forum
My Mods Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
|
Edited by - SiSL on 13 January 2009 12:30:12 |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
Posted - 13 January 2009 : 12:51:16
|
For starters the regexp would contain
1. All protocols - http:// ftp:// news:// etc. 2. All tld's .ad .tv .com .net .org .ie .info, etc. 3. Some way of validating the text in between 1. & 2. which could include anything from valid url's to i.p. addresses
There are 106 regexp results for url here - http://regexlib.com/Search.aspx?k=url&c=-1&m=-1&ps=20
There are lots of different ways to do it but none of them are perfect. Its a lot easier for the user to specify what they want as a url by using url tags and then treat the text as a url rather than have the forum software try to guess what the user wants as a url.
Shaggy made an important point when he said quote: you wouldn't expect a link written in HTML to be active without wrapping it in an anchor tag
< |
Podge.
The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)
My Mods: CAPTCHA Mod | GateKeeper Mod Tutorial: Enable subscriptions on your board
Warning: The post above or below may contain nuts. |
Edited by - Podge on 13 January 2009 12:52:51 |
|
|
Topic |
|