Skip to content

Commit

Permalink
When passing a URL containing special characters (as ! ) in a chat wi…
Browse files Browse the repository at this point in the history
…ndow the url is not clickable. (Facebook Links).
  • Loading branch information
Neumann-Valle authored and kerphi committed Mar 9, 2011
1 parent 8865a45 commit 6733de5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pfcurlprocessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function pfc_make_hyperlink($text)
else
$target = "";

$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);

// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
Expand All @@ -34,7 +34,7 @@ function pfc_make_hyperlink($text)
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, comma, double quote or <
//$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
$ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret);
$ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/!.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret);

// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
Expand Down

0 comments on commit 6733de5

Please sign in to comment.