[問題] 2.0.17更新到2.0.18

phpBB Installation & Usage Support
phpBB 2 安裝於各類型作業平台之問題討論;外掛問題,請到相關版面依發問格式發表!
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

版面規則
本區是討論關於 phpBB 2.0.X 架設安裝上的問題,只要有安裝任何外掛,請到外掛討論相關版面按照公告格式發表。
(發表文章請按照公告格式發表,違者砍文)
主題已鎖定
streitleak
星球公民
星球公民
文章: 261
註冊時間: 2003-07-26 04:44
來自: 龍潭
聯繫:

[問題] 2.0.17更新到2.0.18

文章 streitleak »

發生了
Warning: in_array(): Wrong datatype for second argument in D:\ACG3\phpBB2\common.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at D:\ACG3\phpBB2\common.php:79) in D:\ACG3\phpBB2\includes\sessions.php on line 255

Warning: Cannot modify header information - headers already sent by (output started at D:\ACG3\phpBB2\common.php:79) in D:\ACG3\phpBB2\includes\sessions.php on line 256

Warning: Cannot modify header information - headers already sent by (output started at D:\ACG3\phpBB2\common.php:79) in D:\ACG3\phpBB2\includes\sessions.php on line 255

Warning: Cannot modify header information - headers already sent by (output started at D:\ACG3\phpBB2\common.php:79) in D:\ACG3\phpBB2\includes\sessions.php on line 256

Warning: Cannot modify header information - headers already sent by (output started at D:\ACG3\phpBB2\common.php:79) in D:\ACG3\phpBB2\includes\functions.php on line 831

紅色部分出現很多次..其他部分有參考此篇
http://phpbb-tw.net/phpbb/viewtopic.php?t=39729
檢查後沒有多餘的空白...純手動更新...目前還在找原因中...

代碼: 選擇全部

if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
	if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
[color=red]line 79		if(!in_array($var,$not_unset))[/color]
		{
			unset($$var);
		}
	}
	
	unset($input);
}
台灣動漫論壇
http://ACGFan.twbbs.org
星
汝命短眷族望聞
我望 
汝本將末看取
-------------《人類帝國國歌一節
~倉木麻衣~
竹貓忠實會員
竹貓忠實會員
文章: 1405
註冊時間: 2004-03-21 21:00

文章 ~倉木麻衣~ »

升級文件中關於common.php的修改部份再怎麼改, 也不致於會缺了這一行(紅色標示部份)
底下是以修改後的程式碼為例
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
// PHP4+ path
$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');

// Not only will array_merge give a warning if a parameter
// is not an array, it will actually fail. So we check if
// HTTP_SESSION_VARS has been initialised.

if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
{
$HTTP_SESSION_VARS = array();
}
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好

竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
flower
星球公民
星球公民
文章: 272
註冊時間: 2004-08-31 21:03
來自: 火星
聯繫:

文章 flower »

那段應該是這樣才對....您可能在取代的時候不小心刪除了 PHP4+ path 那部份...
可以比對一下 2.0.18 完整檔案中的 common.php

代碼: 選擇全部

if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
	// PHP4+ path
	$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');

	// Not only will array_merge give a warning if a parameter
	// is not an array, it will actually fail. So we check if
	// HTTP_SESSION_VARS has been initialised.
	if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}

	unset($input);
}
streitleak
星球公民
星球公民
文章: 261
註冊時間: 2003-07-26 04:44
來自: 龍潭
聯繫:

文章 streitleak »

代碼: 選擇全部

#
#-----[ OPEN ]---------------------------------------------
#
common.php

#
#-----[ FIND ]---------------------------------------------
#
// The following code (unsetting globals) was contributed by Matt Kavanagh

#
#-----[ REPLACE WITH ]---------------------------------------------
#
// The following code (unsetting globals)
// Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files

#
#-----[ FIND ]---------------------------------------------
#
// PHP5 with register_long_arrays off?
if (!isset($HTTP_POST_VARS) && isset($_POST))
{
	$HTTP_POST_VARS = $_POST;
	$HTTP_GET_VARS = $_GET;
	$HTTP_SERVER_VARS = $_SERVER;
	$HTTP_COOKIE_VARS = $_COOKIE;
	$HTTP_ENV_VARS = $_ENV;
	$HTTP_POST_FILES = $_FILES;

	// _SESSION is the only superglobal which is conditionally set
	if (isset($_SESSION))
	{
		$HTTP_SESSION_VARS = $_SESSION;
	}
}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
// 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'))
{
	$HTTP_POST_VARS = $_POST;
	$HTTP_GET_VARS = $_GET;
	$HTTP_SERVER_VARS = $_SERVER;
	$HTTP_COOKIE_VARS = $_COOKIE;
	$HTTP_ENV_VARS = $_ENV;
	$HTTP_POST_FILES = $_FILES;

	// _SESSION is the only superglobal which is conditionally set
	if (isset($_SESSION))
	{
		$HTTP_SESSION_VARS = $_SESSION;
	}
}

// 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");
}

#
#-----[ FIND ]---------------------------------------------
#
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')
{

#
#-----[ REPLACE WITH ]---------------------------------------------
#
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{

#
#-----[ FIND ]---------------------------------------------
#
	if (!isset($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}

	unset($input);
}

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}

	unset($input);
}

#
#-----[ FIND ]---------------------------------------------
#
	header("Location: install/install.$phpEx");

#
#-----[ REPLACE WITH ]---------------------------------------------
#
	header('Location: ' . $phpbb_root_path . 'install/install.' . $phpEx);
這是官方給的升級說明XD
台灣動漫論壇
http://ACGFan.twbbs.org
星
汝命短眷族望聞
我望 
汝本將末看取
-------------《人類帝國國歌一節
streitleak
星球公民
星球公民
文章: 261
註冊時間: 2003-07-26 04:44
來自: 龍潭
聯繫:

文章 streitleak »

剛看了舊版的...果然是我耍笨把他砍了XD
現在OK了....
台灣動漫論壇
http://ACGFan.twbbs.org
星
汝命短眷族望聞
我望 
汝本將末看取
-------------《人類帝國國歌一節
主題已鎖定

回到「phpBB 2 安裝與使用」