Previous Thread
Next Thread
Print Thread
Hop To
Joined: Aug 2007
Posts: 45
M
newbie
newbie
M Offline
Joined: Aug 2007
Posts: 45
Hello,

When posting the following link

http://i447.photobucket.com/albums/qq191/yvonne112/Cocos%20pics/DSC01095.jpg

the post does not recognize it as a link in the message.

Is this a bug?

Thanks,
Mike

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
I think the regex is choking on the % sign


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Gizmo #221928 02/02/2009 9:08 PM
Joined: Feb 2007
Posts: 1,294
Likes: 2
Veteran
Veteran
Joined: Feb 2007
Posts: 1,294
Likes: 2
%20 is a space to a Linux server running Apache.

Best never to use direct spaces in anything web related but rather an underscore for spaces.

"web_space" rather then "web space".

JAISP #221929 02/03/2009 12:36 AM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
that's a good 'practice' Thelockman-UNiT, but you'll never get members to adhere to that rule all the time..

the regex (bbcode.inc.php) could (should) be updated to handle it... 2c

oh and %20 is space for ANY url.. it's nothing to do with apache and linux.. %20 loves IIS / doze too and is just how url encoding works.. %20 (hex 20) is decimal 32, which is ascii number for space .. smile

SD #221931 02/03/2009 12:42 AM
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
My members complained about it to. They couldn't grasp that the should name folder in photobucket without a space and use an underscore.

Told them if they want it to work, best change that folder name :X

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yah, i personally NEVER use spaces in URL's and typically use underscores _ instead... it's 'natural' to me, but assuming it's natural for everyone else, doesn't work laugh

SD #221934 02/03/2009 1:04 AM
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
LOL, yes you are right. Assumptions are the mother of all....you know what! All we can do is steer them in the right direction.

Joined: Aug 2007
Posts: 45
M
newbie
newbie
M Offline
Joined: Aug 2007
Posts: 45
I never uses spaces in URLs. But that isn't the case for the members of our message board. Even still if %20 is a legitimate sequence in a URL then I would think UBB Threads should support it.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yeppers smile

SD #221937 02/03/2009 4:09 AM
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
It use to work that way prior to 7.4.1 I think

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
I have this fixed for 7.5.

Rick #222278 02/12/2009 7:41 AM
Joined: Dec 2003
Posts: 117
K
Member
Member
K Offline
Joined: Dec 2003
Posts: 117
Can someone give me the fix code?

Joined: Dec 2003
Posts: 117
K
Member
Member
K Offline
Joined: Dec 2003
Posts: 117
Okay... I actually didn't know anything about regex (they're REALLY Chinese for me), but after going through some documentation, I would presume the fix to be like this:

In "libs" / "bbcode.inc.php" change:

Code


$body = preg_replace('#(\n|\r|\]|^|\s|\(|<)([a-zA-Z0-9]+?)://(([a-zA-Z0-9\.\-\_\?=\#/&]|&)+)(>|<|\n|\r|$|,(\s|$)|\?(\s|$)|\)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'$2://$3\').\'$5\'', $body);



into
Code


$body = preg_replace('#(\n|\r|\]|^|\s|\(|<)([a-zA-Z0-9]+?)://(([a-zA-Z0-9\.\-\_\?=\#/&]|&|[\+\%])+)(>|<|\n|\r|$|,(\s|$)|\?(\s|$)|\)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'$2://$3\').\'$5\'', $body);



and

Code


$body = preg_replace('#(\n|\r|\]|^|\s|<|\()www\.(([a-zA-Z0-9\.\-\_\?&/\#=]|&)+)($|>|\)|,(\s|$)|\?(\s|$)|\)(\s|$)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'http://www.$2\',\'www.$2\').\'$4\'', $body);



into

Code


$body = preg_replace('#(\n|\r|\]|^|\s|<|\()www\.(([a-zA-Z0-9\.\-\_\?&/\#=]|&|[\+\%])+)($|>|\)|,(\s|$)|\?(\s|$)|\)(\s|$)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'http://www.$2\',\'www.$2\').\'$4\'', $body);


basically adding "|[\+\%]" after the "amp;" to include plus and percent signs.

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Kayjey
Okay... I actually didn't know anything about regex (they're REALLY Chinese for me), but after going through some documentation, I would presume the fix to be like this:


If you ever want to learn chinese, RegexBuddy™ could be your new best friend!


[Linked Image from siemons.org]
Yarp #222428 02/15/2009 1:44 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
RegexBuddy [Linked Image from static.ewites.com]


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Havenofsobriety, rootman), 624 guests, and 106 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)