mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
some url match fiddling ... seems to be behaving ... but then just like the captain of the Hindenburg saying "Anyone smell burning?" these are famous last words ...
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@4103 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
362830e86a
commit
6636b1817d
1 changed files with 6 additions and 6 deletions
|
@ -105,7 +105,7 @@ function prepare_bbcode_template($bbcode_tpl)
|
||||||
$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);
|
$bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);
|
||||||
|
|
||||||
$bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
|
$bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);
|
||||||
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);
|
$bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\5', $bbcode_tpl['url4']);
|
||||||
|
|
||||||
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
|
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
|
||||||
|
|
||||||
|
@ -198,19 +198,19 @@ function bbencode_second_pass($text, $uid)
|
||||||
$replacements[] = $bbcode_tpl['img'];
|
$replacements[] = $bbcode_tpl['img'];
|
||||||
|
|
||||||
// matches a [url]xxxx://www.phpbb.com[/url] code..
|
// matches a [url]xxxx://www.phpbb.com[/url] code..
|
||||||
$patterns[] = "#\[url\]([\w]+?://*[^ \"\n\r\t<]*)\[/url\]#is";
|
$patterns[] = "#\[url\]([\w]+?://.*?[^ \"\n\r\t<]*?)\[/url\]#is";
|
||||||
$replacements[] = $bbcode_tpl['url1'];
|
$replacements[] = $bbcode_tpl['url1'];
|
||||||
|
|
||||||
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
|
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
|
||||||
$patterns[] = "#\[url\]((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:/[^ \"\n\r\t<]*)?)\[/url\]#is";
|
$patterns[] = "#\[url\]((www|ftp)\.([\w\-]+\.)*?[\w\-]+\.[a-z]{2,4}(:?[0-9]*?/[^ \"\n\r\t<]*)?)\[/url\]#is";
|
||||||
$replacements[] = $bbcode_tpl['url2'];
|
$replacements[] = $bbcode_tpl['url2'];
|
||||||
|
|
||||||
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
|
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
|
||||||
$patterns[] = "#\[url=([\w]+?://*[^ \"\n\r\t<]*)\](.*?)\[/url\]#is";
|
$patterns[] = "#\[url=([\w]+?://.*?[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
|
||||||
$replacements[] = $bbcode_tpl['url3'];
|
$replacements[] = $bbcode_tpl['url3'];
|
||||||
|
|
||||||
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
|
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
|
||||||
$patterns[] = "#\[url=((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:/[^ \"\n\r\t<]*)?)\](.*?)\[/url\]#is";
|
$patterns[] = "#\[url=((www|ftp)\.([\w\-]+\.)*?[\w\-]+\.[a-z]{2,4}(:?[0-9]*?/[^ \"\n\r\t<]*)?)\](.*?)\[/url\]#is";
|
||||||
$replacements[] = $bbcode_tpl['url4'];
|
$replacements[] = $bbcode_tpl['url4'];
|
||||||
|
|
||||||
// [email]user@domain.tld[/email] code..
|
// [email]user@domain.tld[/email] code..
|
||||||
|
@ -621,7 +621,7 @@ function make_clickable($text)
|
||||||
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
|
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
|
||||||
// xxxx can only be alpha characters.
|
// xxxx can only be alpha characters.
|
||||||
// yyyy is anything up to the first space, newline, comma, double quote or <
|
// yyyy is anything up to the first space, newline, comma, double quote or <
|
||||||
$ret = preg_replace("#(^|[\n ])([\w]+?://*[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
|
$ret = preg_replace("#(^|[\n ])([\w]+?://.*?[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
|
||||||
|
|
||||||
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
|
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
|
||||||
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
|
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
|
||||||
|
|
Loading…
Add table
Reference in a new issue