|
From: Paul S. O. <ps...@us...> - 2002-06-10 01:52:19
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv7629/includes
Modified Files:
bbcode.php
Log Message:
Updates in line with 2.0.1
Index: bbcode.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/bbcode.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** bbcode.php 24 Apr 2002 15:00:33 -0000 1.38
--- bbcode.php 10 Jun 2002 01:52:16 -0000 1.39
***************
*** 484,487 ****
--- 484,493 ----
if ($mark_lowest_level && ($curr_nesting_depth == 1))
{
+ if ($open_tag[0] == '[code]')
+ {
+ $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#');
+ $code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}');
+ $between_tags = preg_replace($code_entities_match, $code_entities_replace, $between_tags);
+ }
$text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$curr_nesting_depth:$uid]";
$text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$curr_nesting_depth:$uid]";
***************
*** 489,501 ****
else
{
! if ($open_is_regexp)
{
! $text = $before_start_tag . $start_tag;
}
else
{
! $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$uid]";
}
- $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$uid]";
}
--- 495,515 ----
else
{
! if ($open_tag[0] == '[code]')
{
! $text = $before_start_tag . '[code]';
! $text .= $between_tags . '[/code]';
}
else
{
! if ($open_is_regexp)
! {
! $text = $before_start_tag . $start_tag;
! }
! else
! {
! $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$uid]";
! }
! $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$uid]";
}
}
***************
*** 607,611 ****
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, or comma.
! $ret = preg_replace("#([\n ])([a-z]+?)://([^,\t \n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
--- 621,625 ----
// xxxx can only be alpha characters.
// yyyy is anything up to the first space, newline, or comma.
! $ret = preg_replace("#([\n ])([a-z]+?)://([^\t <\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
***************
*** 615,619 ****
// This is slightly restrictive - it's not going to match stuff like "forums.foo.com"
// This is to keep it from getting annoying and matching stuff that's not meant to be a link.
! $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,\t \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
--- 629,633 ----
// This is slightly restrictive - it's not going to match stuff like "forums.foo.com"
// This is to keep it from getting annoying and matching stuff that's not meant to be a link.
! $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^\t <\n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
// matches an email@domain type address at the start of a line, or after a space.
|