MyBB Community Forums

Full Version: Problem with links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hello

example
click in the links

This is fine
http://rapidshare.com/files/180836847/01...456789.rar

but this does not
http://rapidshare.com/files/180837963/01...567890.rar

the difference is only a character
inserts these characters% E2% 80% 8B in the second link

Here is the same
copy paste
http://rapidshare.com/files/180836847/0123456789012345678901234567890123456789012345678901234567890123467890123456789.rar

http://rapidshare.com/files/180837963/01234567890123456789012345678901234567890123456789012345678901234678901234567890.rar

what is the problem?

thanks
what's that have to do with mybb?
(2009-01-07, 11:35 PM)Proper Wrote: [ -> ]what's that have to do with mybb?

in other forums work fine the link
in mybb not
what do you mean, those are rapidshare links
He is right...that's odd...possibly a mybb bug.
It actually seems to be a wordwrap issue. Might have a look into it a bit more.
EDIT: Unlikely to be fixed without some major change to the wordwrap system. All I can suggest is turn off word wrapping / increase the wrap cutoff to fix the issue.
Zinga, can you explain what is going wrong?
(2009-01-22, 06:56 PM)Ryan Gordon Wrote: [ -> ]Zinga, can you explain what is going wrong?
The wordwrap function doesn't differentiate text inside a HTML attribute to text outside of a HTML tag. The wordwrap function is trying to wrap the long URL inside the <a href="<url>"> attribute.
Even so, wordwrap should already recognize / and . as word delimiters so usually even very long URLs are safe because slash is already a delimiter as is dot:

http://very.com/long/urls/are/safe/becau...s.dot.html

There's no problem unless the URL actually contains a single folder/file that is fricking long without punctuation (>80 characters with default wordwrap setting). It's hard to find a real world example for that. Whoever creates such long URLs is asking for trouble.

EDIT: Code taken out, doesn't work this way.
Thanks for the suggested code, however as you said, there's no "easy" perfect solution anyway, and it's generally unlikely to get many URLs which exceed 80 characters without some non-word delimiter.

Unfortunately, your example doesn't appear to work here (I'm assuming "$0" should be "$0&#8203;​", or else no word-wrapping occurs at all) - specifying <.*?> as an alternative branch doesn't actually stop preg_replace from replacing inside tags.
echo preg_replace("#(?>(<.*?>|[^\s&/\"\\-\.\[\]]){10})#u", '$0 ', '<a href="asdfsadiufahsifdudhsaf">');
<a href="asdfsadiuf ahsifdudhs af">

Thanks for the suggestion nonetheless Toungue
Pages: 1 2 3 4