2.0.14 Update

All updates to the site will be posted here.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
Rat
Drain Brain
Drain Brain
Posts: 4475
Joined: Mon Jun 14, 2004 9:38 am
Location: in the dark

As battye has a habit of posting this sort of thing here I thought I'd do it for him, in his absence. (He must be back soon, right?) Anyhoo.... here we go, what follows is adapted from battye's previous posts plus a huge 'code' posting from the official guide (from which I've snipped only a few dozen lines of the leading blurb about who did what, to whom and using what weapon).....

Bug fixes and what have you for versions below phpBB 2.0.14. As usual, if you find any errors, report them in this topic.

If you own a forum, and use 2.0.13 or below, follow the instructions below to update to 2.0.14. Remember you will need to download the upgrade package for the update_to_latest.php file. You upload this to your forum root / install directory (eg forums.com/install) and run. Make sure you apply the code changes too, as this script only updates the database.

Code: Select all

################################################################# 
## MOD Title: phpBB 2.0.13 to phpBB 2.0.14 Code Changes
## MOD Author: Acyd Burn < N/A > (Meik Sievertsen) N/A 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################


# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/admin_styles.php

#
#-----[ FIND ]---------------------------------------------
# Line 78
			include($phpbb_root_path. "templates/" . $install_to . "/theme_info.cfg");

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
			include($phpbb_root_path. "templates/" . basename($install_to) . "/theme_info.cfg");

#
#-----[ FIND ]---------------------------------------------
# Line 742
			$fp = @fopen($phpbb_root_path . 'templates/' . $template_name . '/theme_info.cfg', 'w');

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
			$fp = @fopen($phpbb_root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w');


# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/page_header_admin.php

#
#-----[ FIND ]---------------------------------------------
# Line 38
	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');


# 
#-----[ OPEN ]--------------------------------------------- 
# 
admin/page_footer_admin.php

#
#-----[ FIND ]---------------------------------------------
# Line 36
	'PHPBB_VERSION' => '2' . $board_config['version'], 

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '', 


# 
#-----[ OPEN ]--------------------------------------------- 
# 
db/postgres7.php

#
#-----[ FIND ]---------------------------------------------
# Line 125
			$query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query);

#
#-----[ AFTER, ADD ]---------------------------------------------
# 
			$query = preg_replace('#(.*WHERE.*)(username|user_email|ban_email) = \'(.*)\'#ise', "\"\\1LOWER(\\2) = '\" . strtolower('\\3') . \"'\"", $query);


# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/page_header.php

#
#-----[ FIND ]---------------------------------------------
# Line 38
	$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');

#
#-----[ FIND ]---------------------------------------------
# Line 469
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))


# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/sessions.php

#
#-----[ FIND ]---------------------------------------------
# Line 53
		$session_id = '';
	}


#
#-----[ AFTER, ADD ]---------------------------------------------
# 
	$page_id = (int) $page_id;


#
#-----[ FIND ]---------------------------------------------
# Line 92
					// No match; don't login, set as anonymous user
					$login = 0; 
					$enable_autologin = 0; 
					$user_id = $userdata['user_id'] = ANONYMOUS;


#
#-----[ AFTER, ADD ]---------------------------------------------
# 
				
					$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
					$result = $db->sql_query($sql);
					$userdata = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);

#
#-----[ FIND ]---------------------------------------------
# Line 105
				// Autologin is not set. Don't login, set as anonymous user
				$login = 0;
				$enable_autologin = 0;
				$user_id = $userdata['user_id'] = ANONYMOUS;

#
#-----[ AFTER, ADD ]---------------------------------------------
# 

				$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS;
				$result = $db->sql_query($sql);
				$userdata = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);

#
#-----[ FIND ]---------------------------------------------
# Line 244
	//
	// Does a session exist?
	//

#
#-----[ BEFORE, ADD ]---------------------------------------------
# 
	$thispage_id = (int) $thispage_id;



# 
#-----[ OPEN ]--------------------------------------------- 
# 
modcp.php

#
#-----[ FIND ]---------------------------------------------
# Line 130
		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}
	$topic_row = $db->sql_fetchrow($result);


#
#-----[ AFTER, ADD ]---------------------------------------------
# 
	if (!$topic_row)
	{
		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}


#
#-----[ FIND ]---------------------------------------------
# Line 150
		message_die(GENERAL_MESSAGE, 'Forum_not_exist');
	}
	$topic_row = $db->sql_fetchrow($result);

#
#-----[ AFTER, ADD ]---------------------------------------------
# 

	if (!$topic_row)
	{
		message_die(GENERAL_MESSAGE, 'Forum_not_exist');
	}


# 
#-----[ OPEN ]--------------------------------------------- 
# 
privmsg.php

#
#-----[ FIND ]---------------------------------------------
# Line 566
	if ( !$board_config['allow_html'] )
 	{
		if ( $user_sig != '' && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] )

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
	{
		if ( $user_sig != '')

#
#-----[ FIND ]---------------------------------------------
# Line 1531
		if ( !$html_on )
		{
			if ( $user_sig != '' || !$userdata['user_allowhtml'] )

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
		if ( !$html_on || !$board_config['allow_html'] || !$userdata['user_allowhtml'] )
		{
			if ( $user_sig != '' )


# 
#-----[ OPEN ]--------------------------------------------- 
# 
search.php

#
#-----[ FIND ]---------------------------------------------
# Line 200
				$search_author = str_replace('*', '%', trim($search_author));

#
#-----[ BEFORE, ADD ]---------------------------------------------
# 
				if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
				{
					$search_author = '';
				}


#
#-----[ FIND ]---------------------------------------------
# Line 269

			
			{

#
#-----[ AFTER, ADD ]---------------------------------------------
# 
				if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))
				{
					$split_search[$i] = '';
					continue;
				}


#
#-----[ FIND ]---------------------------------------------
# Line 416
		// Author name search 
		//
		if ( $search_author != '' )
		{

#
#-----[ AFTER, ADD ]---------------------------------------------
# 
 			if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
			{
				$search_author = '';
			}



# 
#-----[ OPEN ]--------------------------------------------- 
# 
viewtopic.php

#
#-----[ FIND ]---------------------------------------------
# Line 1052
	if ( !$board_config['allow_html'] )
	{
		if ( $user_sig != '' && $userdata['user_allowhtml'] )

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
	{
		if ( $user_sig != '' )

#
#-----[ FIND ]---------------------------------------------
# Line 1122
			$user_sig = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
			$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 

# EoM
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Thanks for posting that Rat :D

I'll tell you a funny story, while I was away the one thing that worried me every single day was: "I hope a 2.0.14 hasn't been released". Because usually a new release means a security issue has been resolved, thus with me away we wouldn't be patched and we'd be vulnerable to attacks. First thing I noticed when I logged on was this post :lol:

Luckily the security issue was rated non-critical, and nothing happened to the forum. The forum is now running 2.0.14 :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
Grinch
Site Admin
Site Admin
Posts: 2170
Joined: Sat Jan 24, 2004 2:02 pm
Location: Martinsburg, WV

Welcome back battye, hope you had a good vacation.
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

I did, I had a fantastic time :)
Thanks :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
Rat
Drain Brain
Drain Brain
Posts: 4475
Joined: Mon Jun 14, 2004 9:38 am
Location: in the dark

Glad you found the post useful. Welcome back, it's nice to have you 'home'.
KM
Know-It-All
Know-It-All
Posts: 544
Joined: Sat Sep 11, 2004 9:42 pm
Location: in front of a computer, as usual
Contact:

[quote="battye"while I was away the one thing that worried me every single day was: "I hope a 2.0.14 hasn't been released".[/quote]

and they thought i was mad when i took a quick trip home to fix my connection when it went down today (during a 15 minute break between lessons - no, there aren't any speed cameras on the way home, luckily :-D)
Image

WinMX World.com - The new help website dedicated completely to WinMX. If you cant find help there, you cant find it anywhere!
Post Reply