Soda Tasting, an online show for those who love soda

Bookmark and Share

phpBB 2.0.6d to 2.0.7 Code Changes

phpBB 2.0.6d to 2.0.7 Code Changes

Postby Thoul » March 14th 2004, 6:19 am

HTML Version.
Text Version.

These are the code changes introduced between phpBB 2.0.6d and phpBB 2.0.7. 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.

There were several security updates made to phpBB 2.0.6 after it's initial release. The last version of phpBB 2.0.6, called 2.0.6d, included all of those changes and was released shortly before 2.0.7. phpBB 2.0.7 includes all of these changes and a few new ones. Since these are the code changes from 2.0.6d to 2.0.7, the complete list of changes since the initial release of 2.0.6 is not included here. If you are interested in the full list of changes, a separate tutorial is available for that.

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 last 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_207.php file that comes in any phpBB 2.0.7 download to the install/ directory. Run update_to_207.php by opening it via your web browser, just as you would a normal forum page. Afterward, deleting 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 » March 14th 2004, 6:20 am

includes/page_header.php
Although this file is included in the changed files package from phpBB.com, there are no significant changes in the file. Only the $Id line near the top has changed. You do not need to edit or replace this file.


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


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



posting.php
FIND
Code: Select all
		$$var = ( !empty($HTTP_POST_VARS[$param]) ) ? $HTTP_POST_VARS[$param] : $HTTP_GET_VARS[$param];


REPLACE WITH
Code: Select all
		$$var = ( !empty($HTTP_POST_VARS[$param]) ) ? htmlspecialchars($HTTP_POST_VARS[$param]) : htmlspecialchars($HTTP_GET_VARS[$param]);


FIND
Code: Select all
			$sql = "SELECT * 
				FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr 
				WHERE vd.topic_id = $topic_id 
					AND vr.vote_id = vd.vote_id 
				ORDER BY vr.vote_option_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
			}
			$db->sql_freeresult($result);


REPLACE WITH
Code: Select all
			$sql = "SELECT * 
				FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr 
				WHERE vd.topic_id = $topic_id 
					AND vr.vote_id = vd.vote_id 
				ORDER BY vr.vote_option_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
			}


FIND
Code: Select all
					$poll_results_sum += $row['vote_result'];
				}
				while ( $row = $db->sql_fetchrow($result) );
			}


AFTER, ADD
Code: Select all
			$db->sql_freeresult($result);



viewforum.php
FIND
Code: Select all
	$topic_days = ( !empty($HTTP_POST_VARS['topicdays']) ) ? $HTTP_POST_VARS['topicdays'] : $HTTP_GET_VARS['topicdays'];


REPLACE WITH
Code: Select all
	$topic_days = ( !empty($HTTP_POST_VARS['topicdays']) ) ? intval($HTTP_POST_VARS['topicdays']) : intval($HTTP_GET_VARS['topicdays']);



viewtopic.php
FIND
Code: Select all
	$post_days = ( !empty($HTTP_POST_VARS['postdays']) ) ? $HTTP_POST_VARS['postdays'] : $HTTP_GET_VARS['postdays'];


REPLACE WITH
Code: Select all
	$post_days = ( !empty($HTTP_POST_VARS['postdays']) ) ? intval($HTTP_POST_VARS['postdays']) : intval($HTTP_GET_VARS['postdays']);



includes/usercp_register.php
FIND
Code: Select all
	$avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? $HTTP_POST_VARS['avatarcategory'] : '';


REPLACE WITH
Code: Select all
	$avatar_category = ( !empty($HTTP_POST_VARS['avatarcategory']) ) ? htmlspecialchars($HTTP_POST_VARS['avatarcategory']) : '';
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