Feng Forum

Support => Older versions => : Murz December 11, 2009, 03:29:13 AM

: Href links with percents (%D0%9D) cuts on first percent
: Murz December 11, 2009, 03:29:13 AM
I have a link in note:
http://ru.wikipedia.org/wiki/%D0%9D%D0%B8%D0%B6%D0%BD%D0%B8%D0%B9
and OpenGoo detect this link as
<a href="http://ru.wikipedia.org/wiki/" target="_blank">http://ru.wikipedia.org/wiki/</a>%D0%9D%D0%B8%D0%B6%D0%BD%D0%B8%D0%B9

The link cuts at first percent symbol.
: Re: Href links with percents (%D0%9D) cuts on first percent
: ignacio December 14, 2009, 11:42:18 AM
Fixed for next release. Edit file 'environment/functions/general.php' lines 570-574, change from:

:
//Replace full urls with hyperinks. Avoids " character for already rendered hyperlinks
$text = preg_replace('@([^"\']|^)(https?://([-\w\.]+)+(:\d+)?(/([\w/_\-\.\+]*(\?[^\s<]+)?)?)?)@', '$1<a href="$2" target="_blank">$2</a>', $text);

//Convert every word starting with "www." into a hyperlink
$text = preg_replace('@(>|\s|^)(www.([-\w\.]+)+(:\d+)?(/([\w/_\-\.\+]*(\?[^\s<]+)?)?)?)@', '$1<a href="http://$2" target="_blank">$2</a>', $text);

to:

:
//Replace full urls with hyperinks. Avoids " character for already rendered hyperlinks
$text = preg_replace('@([^"\']|^)(https?://([-\w\.]+)+(:\d+)?(/([%\w/_\-\.\+]*(\?[^\s<]+)?)?)?)@', '$1<a href="$2" target="_blank">$2</a>', $text);

//Convert every word starting with "www." into a hyperlink
$text = preg_replace('@(>|\s|^)(www.([-\w\.]+)+(:\d+)?(/([%\w/_\-\.\+]*(\?[^\s<]+)?)?)?)@', '$1<a href="http://$2" target="_blank">$2</a>', $text);

(Added a % sign before the second occurrence of \w in both lines that start with $text)