|
02.11.2005, 12:26
Часть 2
Открываем modules/Forums/admin/index.php
Находим (570):
PHP код:
if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr))
Заменяем на:
PHP код:
if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr, 10))
Находим (605):
PHP код:
$version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
Заменяем на:
PHP код:
$version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_version) . ' ' . sprintf($lang['Current_version_info'], '2' . $board_config['version']) . '</p>';
Открываем modules/Forums/admin/page_footer_admin.php
Находим (28):
PHP код:
// // Show the overall footer. //
Выше добавляем:
PHP код:
global $do_gzip_compress;
Находим (39):
PHP код:
'TRANSLATION_INFO' => $lang['TRANSLATION_INFO'])
Заменяем на:
PHP код:
'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''))
Открываем modules/Forums/common.php
Находим (31):
PHP код:
// The following code (unsetting globals) was contributed by Matt Kavanagh // PHP5 with register_long_arrays off? if (!isset($HTTP_POST_VARS) && isset($_POST))
Заменяем на:
PHP код:
// The following code (unsetting globals) // Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files // PHP5 with register_long_arrays off? if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off'))
Находим (49):
PHP код:
if (@phpversion() < '4.0.0') { // PHP3 path; in PHP3, globals are _always_ registered // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); // Loop through each input array @reset($test); while (list($input,) = @each($test)) { while (list($var,) = @each($$input)) { // Validate the variable to be unset if (!isset($test[$var]) && $var != 'test' && $var != 'input') { unset($$var); } } } } else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
Заменяем на:
PHP код:
// Protect against GLOBALS tricks if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS'])) { die("Hacking attempt"); } // Protect against HTTP_SESSION_VARS tricks if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS)) { die("Hacking attempt"); } if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
Находим (69):
PHP код:
if (!isset($HTTP_SESSION_VARS))
Заменяем на:
PHP код:
if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
Находим (193):
PHP код:
include("includes/functions.php"); include("db/db.php"); }
Ниже добавляем:
PHP код:
// We do not need this any longer, unset for safety purposes unset($dbpasswd);
Открываем db/mysql.php
Находим (262):
PHP код:
$result = $this->rowset[$query_id][$field];
Заменяем на:
PHP код:
$result = $this->rowset[$query_id][0][$field];
Открываем db/mysql4.php
Находим (274):
PHP код:
$result = $this->rowset[$query_id][$field];
Заменяем на:
PHP код:
$result = $this->rowset[$query_id][0][$field];
Открываем modules/Forums/groupcp.php
Находим (107):
PHP код:
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts"); $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>'; $search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
Заменяем на:
PHP код:
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($row['username']) . "&showresults=posts"); $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $row['username']) . '" title="' . sprintf($lang['Search_user_posts'], $row['username']) . '" border="0" /></a>'; $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $row['username']) . '</a>';
Находим (1228):
PHP код:
// // Load and process templates //
Ниже добавляем:
PHP код:
$page_title = $lang['Group_Control_Panel'];
Открываем includes/bbcode.php
Находим (433):
PHP код:
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); bbcode_array_push($stack, $match);
Заменяем на:
PHP код:
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index); array_push($stack, $match);
Находим (455):
PHP код:
// We need to do 2 replacements now. $match = bbcode_array_pop($stack);
Заменяем на:
PHP код:
// We need to do 2 replacements now. $match = array_pop($stack);
Найти (522):
PHP код:
$match = bbcode_array_pop($stack); $curr_pos = $match['pos'];
Заменить на:
PHP код:
$match = array_pop($stack); $curr_pos = $match['pos'];
Находим (763):
PHP код:
$orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
Заменяем на:
PHP код:
$orig[] = "/(?<=.\W|\W.|^\W)" . preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
Открываем includes/constants.php
Находим (138):
PHP код:
define('SESSIONS_TABLE', $prefix.'_bbsessions');
Ниже добавляем:
PHP код:
define('SESSIONS_KEYS_TABLE', $prefix.'_bbsessions_keys');
Открываем includes/emailer.php
Находим 2 раза (209,219):
PHP код:
$drop_header .= '[\r\n]*?' . phpbb_preg_quote($match[1], '#');
Заменяем на:
PHP код:
$drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');
Находим (305):
PHP код:
$str = preg_replace('#' . phpbb_preg_quote($spacer, '#') . '$#', '', $str);
Заменяем на:
PHP код:
$str = preg_replace('#' . preg_quote($spacer, '#') . '$#', '', $str);
Открываем includes/functions.php
Находим (86):
PHP код:
// added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0)
Выше добавляем:
PHP код:
/** * This function is a wrapper for ltrim, as charlist is only supported in php >= 4.1.0 * Added in phpBB 2.0.18 */ function phpbb_ltrim($str, $charlist = false) { if ($charlist === false) { return ltrim($str); } $php_version = explode('.', PHP_VERSION); // php version < 4.1.0 if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1)) { while ($str{0} == $charlist) { $str = substr($str, 1); } } else { $str = ltrim($str, $charlist); } return $str; }
Находим (594):
PHP код:
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', phpbb_preg_quote($row['word'], '#')) . ')\b#i';
Заменяем на:
PHP код:
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i';
|
|