A ještě jeden patch, chyba linkování interních odkazů.
Kód: Vybrat vše
diff -x '*cache/*' -x config.php -x '*files*' -x '*download*' -crB forum/includes/th23_autolinks.php forum_new/includes/th23_autolinks.php
*** forum/includes/th23_autolinks.php Fri Nov 20 11:17:36 2009
--- forum_new/includes/th23_autolinks.php Fri Nov 20 13:31:22 2009
***************
*** 28,35 ****
// prepare root path and session id for local links
$th23_autolinks_local = array(
'search' => array(
! 'th23autolink_root',
! 'th23autolink_sid_and',
'th23autolink_sid_que',
),
'replace' => array(
--- 28,35 ----
// prepare root path and session id for local links
$th23_autolinks_local = array(
'search' => array(
! 'th23autolink_root',
! 'th23autolink_sid_and',
'th23autolink_sid_que',
),
'replace' => array(
***************
*** 51,94 ****
// convert standard bbcodes tags to secure them from being linked
$search = array(
! '[i:' . $th23_autolinks_uid . ']',
! '[/i:' . $th23_autolinks_uid . ']',
! '[u:' . $th23_autolinks_uid . ']',
! '[/u:' . $th23_autolinks_uid . ']',
! '[b:' . $th23_autolinks_uid . ']',
! '[/b:' . $th23_autolinks_uid . ']',
! '[*:' . $th23_autolinks_uid . ']',
! '[/*:m:' . $th23_autolinks_uid . ']',
! '[/quote:' . $th23_autolinks_uid . ']',
! '[/list:o:' . $th23_autolinks_uid . ']',
! '[/list:u:' . $th23_autolinks_uid . ']',
! '[/color' . $th23_autolinks_uid . ']',
! '[/size' . $th23_autolinks_uid . ']',
);
$replace = array(
! ' th23autolink_bbcode_start_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_quote_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_o_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_color_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_size_' . $th23_autolinks_uid . ' ',
);
if ($config['th23_autolinks_code'])
{
! $search[] = '[code:' . $th23_autolinks_uid . ']';
! $search[] = '[/code:' . $th23_autolinks_uid . ']';
! $replace[] = ' th23autolink_bbcode_start_code_' . $th23_autolinks_uid . ' ';
! $replace[] = ' th23autolink_bbcode_end_code_' . $th23_autolinks_uid . ' ';
}
$text = str_replace($search, $replace, $text);
!
// encode img, url, flash, attachment, smilies (incl. start/end tag)
// and encode start tag of quote, list, color, size
$search = array(
--- 51,94 ----
// convert standard bbcodes tags to secure them from being linked
$search = array(
! '[i:' . $th23_autolinks_uid . ']',
! '[/i:' . $th23_autolinks_uid . ']',
! '[u:' . $th23_autolinks_uid . ']',
! '[/u:' . $th23_autolinks_uid . ']',
! '[b:' . $th23_autolinks_uid . ']',
! '[/b:' . $th23_autolinks_uid . ']',
! '[*:' . $th23_autolinks_uid . ']',
! '[/*:m:' . $th23_autolinks_uid . ']',
! '[/quote:' . $th23_autolinks_uid . ']',
! '[/list:o:' . $th23_autolinks_uid . ']',
! '[/list:u:' . $th23_autolinks_uid . ']',
! '[/color' . $th23_autolinks_uid . ']',
! '[/size' . $th23_autolinks_uid . ']',
);
$replace = array(
! ' th23autolink_bbcode_start_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_quote_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_o_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_color_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_size_' . $th23_autolinks_uid . ' ',
);
if ($config['th23_autolinks_code'])
{
! $search[] = '[code:' . $th23_autolinks_uid . ']';
! $search[] = '[/code:' . $th23_autolinks_uid . ']';
! $replace[] = ' th23autolink_bbcode_start_code_' . $th23_autolinks_uid . ' ';
! $replace[] = ' th23autolink_bbcode_end_code_' . $th23_autolinks_uid . ' ';
}
$text = str_replace($search, $replace, $text);
!
// encode img, url, flash, attachment, smilies (incl. start/end tag)
// and encode start tag of quote, list, color, size
$search = array(
***************
*** 96,102 ****
'/\[url.*?:' . $th23_autolinks_uid . '\].*?\[\/url:' . $th23_autolinks_uid . '\]/i',
'/\[flash.*?:' . $th23_autolinks_uid . '\].*?\[\/flash:' . $th23_autolinks_uid . '\]/i',
'/\[attachment.*?:' . $th23_autolinks_uid . '\].*?\[\/attachment:' . $th23_autolinks_uid . '\]/i',
! '/(<!-- s:.*?: -->)<img.*?\/>\1/i',
'/(<!-- m -->).*?\1/i',
'/(<!-- l -->).*?\1/i',
'/(<!-- w -->).*?\1/i',
--- 96,102 ----
'/\[url.*?:' . $th23_autolinks_uid . '\].*?\[\/url:' . $th23_autolinks_uid . '\]/i',
'/\[flash.*?:' . $th23_autolinks_uid . '\].*?\[\/flash:' . $th23_autolinks_uid . '\]/i',
'/\[attachment.*?:' . $th23_autolinks_uid . '\].*?\[\/attachment:' . $th23_autolinks_uid . '\]/i',
! '/(<!-- s:.*?: -->)<img.*?\/>\1/i',
'/(<!-- m -->).*?\1/i',
'/(<!-- l -->).*?\1/i',
'/(<!-- w -->).*?\1/i',
***************
*** 121,161 ****
// re-convert standard bbcodes tags
$search = array(
! ' th23autolink_bbcode_start_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_quote_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_o_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_color_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_size_' . $th23_autolinks_uid . ' ',
);
$replace = array(
! '[i:' . $th23_autolinks_uid . ']',
! '[/i:' . $th23_autolinks_uid . ']',
! '[u:' . $th23_autolinks_uid . ']',
! '[/u:' . $th23_autolinks_uid . ']',
! '[b:' . $th23_autolinks_uid . ']',
! '[/b:' . $th23_autolinks_uid . ']',
! '[*:' . $th23_autolinks_uid . ']',
! '[/*:m:' . $th23_autolinks_uid . ']',
! '[/quote:' . $th23_autolinks_uid . ']',
! '[/list:o:' . $th23_autolinks_uid . ']',
! '[/list:u:' . $th23_autolinks_uid . ']',
! '[/color' . $th23_autolinks_uid . ']',
! '[/size' . $th23_autolinks_uid . ']',
);
if ($config['th23_autolinks_code'])
{
! $search[] = ' th23autolink_bbcode_start_code_' . $th23_autolinks_uid . ' ';
! $search[] = ' th23autolink_bbcode_end_code_' . $th23_autolinks_uid . ' ';
! $replace[] = '[code:' . $th23_autolinks_uid . ']';
! $replace[] = '[/code:' . $th23_autolinks_uid . ']';
}
$text = str_replace($search, $replace, $text);
--- 121,161 ----
// re-convert standard bbcodes tags
$search = array(
! ' th23autolink_bbcode_start_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_i_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_b_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_start_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_star_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_quote_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_o_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_list_u_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_color_' . $th23_autolinks_uid . ' ',
! ' th23autolink_bbcode_end_size_' . $th23_autolinks_uid . ' ',
);
$replace = array(
! '[i:' . $th23_autolinks_uid . ']',
! '[/i:' . $th23_autolinks_uid . ']',
! '[u:' . $th23_autolinks_uid . ']',
! '[/u:' . $th23_autolinks_uid . ']',
! '[b:' . $th23_autolinks_uid . ']',
! '[/b:' . $th23_autolinks_uid . ']',
! '[*:' . $th23_autolinks_uid . ']',
! '[/*:m:' . $th23_autolinks_uid . ']',
! '[/quote:' . $th23_autolinks_uid . ']',
! '[/list:o:' . $th23_autolinks_uid . ']',
! '[/list:u:' . $th23_autolinks_uid . ']',
! '[/color' . $th23_autolinks_uid . ']',
! '[/size' . $th23_autolinks_uid . ']',
);
if ($config['th23_autolinks_code'])
{
! $search[] = ' th23autolink_bbcode_start_code_' . $th23_autolinks_uid . ' ';
! $search[] = ' th23autolink_bbcode_end_code_' . $th23_autolinks_uid . ' ';
! $replace[] = '[code:' . $th23_autolinks_uid . ']';
! $replace[] = '[/code:' . $th23_autolinks_uid . ']';
}
$text = str_replace($search, $replace, $text);
***************
*** 173,179 ****
function th23_autolinks_encode_links($match)
{
global $th23_autolinks, $th23_autolinks_css, $th23_autolinks_title, $th23_autolinks_local, $th23_autolinks_uid;
! return ' th23autolink_encode_start_' . $th23_autolinks_uid . base64_encode('<a href="' . str_replace($th23_autolinks_local['search'], $th23_autolinks_local['replace'], $th23_autolinks['replacement'][strtolower($match[1])]) . '"' . $th23_autolinks_css . $th23_autolinks_title . '>' . $match[1] . '</a>') . 'th23autolink_encode_end_' . $th23_autolinks_uid . ' ';
}
// decode the encoded links and smilies to display them properly
--- 173,179 ----
function th23_autolinks_encode_links($match)
{
global $th23_autolinks, $th23_autolinks_css, $th23_autolinks_title, $th23_autolinks_local, $th23_autolinks_uid;
! return ' th23autolink_encode_start_' . $th23_autolinks_uid . base64_encode('<a href="' . ereg_replace('^\./http', 'http', str_replace($th23_autolinks_local['search'], $th23_autolinks_local['replace'], $th23_autolinks['replacement'][strtolower($match[1])])) . '"' . $th23_autolinks_css . $th23_autolinks_title . '>' . $match[1] . '</a>') . 'th23autolink_encode_end_' . $th23_autolinks_uid . ' ';
}
// decode the encoded links and smilies to display them properly