• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

[Fix] Url Parsing with ~ (1.0-beta7)

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby firebane » Wed Nov 15, 2006 12:58 am

Upon entering a url that was of the similar:

http://www.blah.com/~/

It would not parse after the ~ and you would only get the main address. So if your link was http://www.blah.com/~user/index.html you would only get http://www.blah.com .

The easy fix to this is open up the file in src/client called pfcclient.js and go to line 1120 and find the following:

var rx_url = new RegExp('(^|[^\"])([a-z]+://[a-z0-9.\/\?\=\&\-_\#:;%]*)([^\"]|$)','ig');

and modify it to have

var rx_url = new RegExp('(^|[^\"])([a-z]+://[a-z0-9.\~\/\?\=\&\-_\#:;%]*)([^\"]|$)','ig');

And your URL Parsing will work perfect.
Last edited by firebane on Wed Nov 15, 2006 12:59 am, edited 1 time in total.
firebane
Member
 
Posts: 11
Joined: Wed Nov 15, 2006 12:54 am
Top

Postby phpfreechat » Wed Nov 15, 2006 8:41 am

Thank you fireban, your fix is now integrated in the official pfc source code.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby montja » Fri May 04, 2007 1:26 pm

you should do the same for @ which appears in som urls. but maybe this will introduce a problem for mailto:
montja
New member
 
Posts: 2
Joined: Fri May 04, 2007 1:20 pm
Top

Postby phpfreechat » Fri May 04, 2007 4:32 pm

Thank you montja, your suggestion in integrated in 1023 revision.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
4 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 13 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub