Get Photoshop help and share your work at PhotoshopForums.com

Bookmark and Share

phpBB 2.0.9 to 2.0.10 Code Changes

phpBB 2.0.9 to 2.0.10 Code Changes

Postby Thoul » November 19th 2004, 12:54 am

HTML Version.
Text Version.

These are the code changes introduced between phpBB 2.0.9 and phpBB 2.0.10. If you have installed many hacks on a forum, but wish to update it, these may help you. It is often easier to apply code changes such as these instead of replacing and rehacking your current files.

These code changes use the following instruction labels:
FIND - This indicates lines of code you should locate. Changes will be made in reference to this code.
REPLACE WITH - This code should completely replace the code in the preceding FIND instruction.
AFTER, ADD - The code in this instruction should be added on a new line after the last line of code in the preceding FIND instruction.
BEFORE, ADD - The code in this instruction should be added on a new line before the first line of code in the preceding FIND instruction.
FIND AND DELETE - Locate the code in this instruction as with a FIND statement, and then delete the code.

Once you have completed the code changes, create an install/ directory in your forum's root directory, and upload the update_to_210.php file that comes in any phpBB 2.0.10 download to the install/ directory. Run update_to_210.php by opening it via your web browser, just as you would a normal forum page. Afterward, delete the file and the install/ directory so that your forum is accessible again.

Now, onward to the file changes!
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA

Postby Thoul » November 19th 2004, 12:58 am

admin/admin_board.php
FIND
Code: Select all
		$default_config[$config_name] = str_replace("'", "\'", $config_value);


REPLACE WITH
Code: Select all
		$default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value;




admin/admin_styles.php
FIND
Code: Select all
$no_page_header = (!empty($HTTP_POST_VARS['send_file']) || $cancel) ? TRUE : FALSE;

require('./pagestart.' . $phpEx);


AFTER, ADD
Code: Select all
$confirm = ( isset($HTTP_POST_VARS['confirm']) ) ? TRUE : FALSE;
$cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? TRUE : FALSE;
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA

Postby Thoul » November 19th 2004, 1:01 am

common.php
FIND
Code: Select all
			unset_vars(${$var_prefix . $var . $var_suffix});


AFTER, ADD
Code: Select all
			@reset(${$var_prefix . $var . $var_suffix});


FIND
Code: Select all
			unset_vars(${$var});


AFTER, ADD
Code: Select all
			@reset(${$var});


FIND
Code: Select all
		unset_vars(${'_FILES'});


AFTER, ADD
Code: Select all
		@reset(${'_FILES'});


FIND
Code: Select all
		unset_vars(${'HTTP_POST_FILES'});


AFTER, ADD
Code: Select all
		@reset(${'HTTP_POST_FILES'});


FIND
Code: Select all
//
// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//


BEFORE, ADD
Code: Select all
// 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;
}




login.php
FIND
Code: Select all
					$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : '';
					$redirect = str_replace('?', '&', $redirect);


AFTER, ADD
Code: Select all
					if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))
					{
						message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
					}


FIND
Code: Select all
			$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "";
			$redirect = str_replace("?", "&", $redirect);


AFTER, ADD
Code: Select all
			if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r"))
			{
				message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
			}
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA

Postby Thoul » November 19th 2004, 1:02 am

search.php
FIND
Code: Select all
	$search_author = ( isset($HTTP_POST_VARS['search_author']) ) ? $HTTP_POST_VARS['search_author'] : $HTTP_GET_VARS['search_author'];


AFTER, ADD
Code: Select all
	$search_author = htmlspecialchars($search_author);




includes/functions.php
FIND
Code: Select all
	if ( !empty($SID) )
	{
		$boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
	}


REPLACE WITH
Code: Select all
	// Let the jumpbox work again in sites having additional session id checks.
//	if ( !empty($SID) )
//	{
		$boxstring .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
//	}



FIND
Code: Select all
	if (!empty($db))
	{
		$db->sql_close();
	}


AFTER, ADD
Code: Select all
	if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r"))
	{
		message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');
	}
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA


Return to phpBB 2: Fixes and Code Changes

Who is online

Users browsing this forum: No registered users and 0 guests