[Tool] phpBB 2.0.19 to phpBB 2.0.20 Changes

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
12
36%
Very Good
2
6%
Good
5
15%
Fair
2
6%
Poor
12
36%
 
Total votes: 33

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27919
Joined: Sat Aug 16, 2003 7:36 am

[Tool] phpBB 2.0.19 to phpBB 2.0.20 Changes

Post by Extensions Robot » Fri Apr 07, 2006 7:04 pm

Classification: 48 phpBB Installation & Upgrade Tools

MOD Name: phpBB 2.0.19 to phpBB 2.0.20 Changes
Author: Graham
MOD Description: Code Changes from phpBB 2.0.19 to 2.0.20 in three formats (text/mod, html, bbcode prepared for posting the changes on phpBB forums).


MOD Version: 1.0.0
Installation Level: Intermediate
Installation Time: ~ 20 Minutes

Download File: phpBB-2.0.20-codechanges.zip (Preferred) phpBB-2.0.20-codechanges.zip (Alternate)
File Size: 24437 Bytes

Security Score: 0

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.

Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham » Sat Apr 08, 2006 4:42 pm

MOD Validated/Released

Notes:
The updated version of the code changes MOD as listed in the announcement
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!

User avatar
aboyd
Registered User
Posts: 193
Joined: Mon May 10, 2004 7:30 pm
Location: USA
Contact:

Post by aboyd » Sat Apr 08, 2006 4:45 pm

I note it was posted on the 7th, and it says it's version 1.0.0. However, there was a re-release on the 8th, with fixed code (I assume that would make it version 1.0.1). So does the original post contain the most up-to-date code?

-Tony

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Post by stickerboy » Sat Apr 08, 2006 5:35 pm

I was a bit apprehensive about this update as I have aquite a few MODs and it's not the smallest of updates, but I'm glad to report it went fine :)
I'll keep looking for conflicts, but so far most of the big MODs - Cash, Attatchments and Attached Forums, have taken to it fine.

cheers :wink:
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Post by Seraphic » Sat Apr 08, 2006 5:39 pm

Update went well.

BigRed01
Registered User
Posts: 472
Joined: Mon Jan 24, 2005 9:26 am
Location: The upper midwest

Post by BigRed01 » Sat Apr 08, 2006 6:22 pm

Used easy mod with no problems :D

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Apr 08, 2006 6:23 pm

The following change in includes/functions_post.php kills the ability to recognize named quotes (quotes in the format [qoute="asinshesq"]...) on my board:

Code: Select all

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

#
#-----[ FIND ]---------------------------------------------
# Line 44
		$allowed_html_tags = split(',', $board_config['allow_html_tags']);

		$end_html = 0;
		$start_html = 1;
		$tmp_message = '';
		$message = ' ' . $message . ' ';

		while ($start_html = strpos($message, '<', $start_html))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));

			if ($end_html = strpos($message, '>', $start_html))
			{
				$length = $end_html - $start_html + 1;
				$hold_string = substr($message, $start_html, $length);

				if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)
				{
					$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
					$hold_string = substr($hold_string, $unclosed_open - 1);
				}

				$tagallowed = false;
				for ($i = 0; $i < sizeof($allowed_html_tags); $i++)
				{
					$match_tag = trim($allowed_html_tags[$i]);
					if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string))
					{
						$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t ]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
					}
				}

				$tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;

				$start_html += $length;
			}
			else
			{
				$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));

				$start_html = strlen($message);
				$end_html = $start_html;
			}
		}

		if (!$end_html || ($end_html != strlen($message) && $tmp_message != ''))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
		}

		$message = ($tmp_message != '') ? trim($tmp_message) : trim($message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// If HTML is on, we try to make it safe
		// This approach is quite agressive and anything that does not look like a valid tag
		// is going to get converted to HTML entities
		$message = stripslashes($message);
		$html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#';
		$matches = array();

		$message_split = preg_split($html_match, $message);
		preg_match_all($html_match, $message, $matches);

		$message = '';

		foreach ($message_split as $part)
		{
			$tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
			$message .= htmlspecialchars($part) . clean_html($tag);
		}

		$message = addslashes($message);
When I leave that change out all is fine. This is probably a problem on my end (I have my board very heavily modded and have fooled around with html before). I'll try to track this down over the weekend and report back (and I'll test it on a plain vaniall phpbb2.0.19 upgrade to 2.0.20 to see whether all is fine there) but in the meantime I figured I'd mention it here in case anyone else runs into this problem. (And actually, I would appreciate it if anyone who has this problem replies to this post so I can confirm it's not solely my setup.)

abramelin
Registered User
Posts: 79
Joined: Sat Apr 08, 2006 6:31 pm

Post by abramelin » Sat Apr 08, 2006 6:34 pm

lastvisit hack conflicts with the new phpbb 2.0.20 search.php
here is the code changes in 2.0.20's search.php

Code: Select all

# 
#-----[ FIND ]--------------------------------------------- 
# Line 646 
      // Finish building query (for all combinations) 
      // and run it ... 
      // 
      $sql = "SELECT session_id 
         FROM " . SESSIONS_TABLE; 
      if ( $result = $db->sql_query($sql) ) 
      { 
         $delete_search_ids = array(); 
         while( $row = $db->sql_fetchrow($result) ) 
         { 
            $delete_search_ids[] = "'" . $row['session_id'] . "'"; 
         } 

         if ( count($delete_search_ids) ) 
         { 
            $sql = "DELETE FROM " . SEARCH_TABLE . " 
               WHERE session_id NOT IN (" . implode(", ", $delete_search_ids) . ")"; 
            if ( !$result = $db->sql_query($sql) ) 
            { 
               message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql); 
            } 
         } 

# 
#-----[ REPLACE WITH ]--------------------------------------------- 
# 
      // Delete old data from the search result table 
      // 
      $sql = 'DELETE FROM ' . SEARCH_TABLE . ' 
         WHERE search_time < ' . ($current_time - (int) $board_config['session_length']); 
      if ( !$result = $db->sql_query($sql) ) 
      { 
         message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql);
and these are the lines i got in my seach.php(2.0.19) (with the modification of lastvisit)

Code: Select all

// Finish building query (for all combinations) 
      // and run it ... 
      // 
      // Start replacement - Last visit MOD 
   $expiry_time = $current_time - $board_config['session_length']; 
      $sql = "SELECT session_id 
         FROM " . SESSIONS_TABLE ." WHERE session_time>$expiry_time"; 
// Start replacement - Last visit MOD 
      if ( $result = $db->sql_query($sql) ) 
      { 
         $delete_search_ids = array(); 
         while( $row = $db->sql_fetchrow($result) ) 
         { 
            $delete_search_ids[] = "'" . $row['session_id'] . "'"; 
         } 

         if ( count($delete_search_ids) ) 
         { 
            $sql = "DELETE FROM " . SEARCH_TABLE . " 
               WHERE session_id NOT IN (" . implode(", ", $delete_search_ids) . ")"; 
            if ( !$result = $db->sql_query($sql) ) 
            { 
               message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql); 
            } 
         } 
what must i do?

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Post by Seraphic » Sat Apr 08, 2006 6:40 pm

abramelin wrote: what must i do?

Code: Select all

		// Delete old data from the search result table
		//

// Start replacement - Last visit MOD
    	$expiry_time = $current_time - $board_config['session_length'];
		$sql = "SELECT session_id
			FROM " . SESSIONS_TABLE ." WHERE session_time>$expiry_time";
// Start replacement - Last visit MOD

		$sql = 'DELETE FROM ' . SEARCH_TABLE . '
			WHERE search_time < ' . ($current_time - (int) $board_config['session_length']);
		if ( !$result = $db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql);

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Post by Seraphic » Sat Apr 08, 2006 6:41 pm

asinshesq wrote: The following change in includes/functions_post.php kills the ability to recognize named quotes (quotes in the format [qoute="asinshesq"]...) on my board:


It looks like a lot of people are having this problem. But on my forum at least, I didn't have this problem.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Apr 08, 2006 7:07 pm

Seraphic wrote: ...It looks like a lot of people are having this problem. But on my forum at least, I didn't have this problem.


I didn't see any posts on this...are other people reporting that problem somewhere?

I remember a prior upgrade created some problems when html was enabled and there was a workaround...I'm guessing this problem is tied to that same problem. Hopefully I'll have a chance to track this down over the weekend but in the meantime leaving out that one change fixes things (or alternatively you can disable html on your board since that part of the code does not get executed unless you have html enabled).

By teh way, Seraphic, do you have html enabled? If not, could you turn it on temproarily to see if you suddenly start having that problem?

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Post by Seraphic » Sat Apr 08, 2006 7:16 pm

There are a few posts about the issue you're talking about in the main phpbb support forum. http://www.phpbb.com/phpBB/viewforum.php?f=1

Also, I turned on html and tried a test quote. It still works fine.

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq » Sat Apr 08, 2006 8:52 pm

The support team beat me to it. If you are having a problem with quotes iwth names in them when you have html turned on, see this post for a fix: http://www.phpbb.com/phpBB/viewtopic.ph ... 63#2079863

delicata
Registered User
Posts: 143
Joined: Sat Apr 24, 2004 12:49 am
Location: South Yorkshire
Contact:

Post by delicata » Sat Apr 08, 2006 9:26 pm

I made these upgrade changes today and all seemed well...until I pressed 'quote' in a private message and got this:

Warning: preg_replace(): Empty regular expression in /home/maltbyonliuk/public_html/community/privmsg.php on line 1524

Warning: Cannot modify header information - headers already sent by (output started at /home/maltbyonliuk/public_html/community/privmsg.php:1524) in /home/maltbyonliuk/public_html/community/includes/page_header.php on line 501

Warning: Cannot modify header information - headers already sent by (output started at /home/maltbyonliuk/public_html/community/privmsg.php:1524) in /home/maltbyonliuk/public_html/community/includes/page_header.php on line 503

Warning: Cannot modify header information - headers already sent by (output started at /home/maltbyonliuk/public_html/community/privmsg.php:1524) in /home/maltbyonliuk/public_html/community/includes/page_header.php on line 504

Any ideas anyone?

Cheers
John - Delicata Designs
Tel: +44 (0) 7930 343276 | Fax: +44 (0) 7092 004104


Supporter of:
Independent Web Designers Portal | Mini Tutorials

Image

amoun
Registered User
Posts: 251
Joined: Mon Sep 29, 2003 1:15 pm
Location: Cornwall, UK SX45036904
Contact:

Post by amoun » Sat Apr 08, 2006 9:38 pm

I think the code has an error :

the bit

"$html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#';" shouldn't have the '?>' bit as it ends the php script ???


I think. There's screwed hightlighting in my editor. Remove the ?> and it all looks fine.

Can someone confirm that it is an error please.


Amoun
asinshesq wrote: The following change in includes/functions_post.php kills the ability to recognize named quotes (quotes in the format [qoute="asinshesq"]...) on my board:

Code: Select all

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

#
#-----[ FIND ]---------------------------------------------
# Line 44
		$allowed_html_tags = split(',', $board_config['allow_html_tags']);

		$end_html = 0;
		$start_html = 1;
		$tmp_message = '';
		$message = ' ' . $message . ' ';

		while ($start_html = strpos($message, '<', $start_html))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));

			if ($end_html = strpos($message, '>', $start_html))
			{
				$length = $end_html - $start_html + 1;
				$hold_string = substr($message, $start_html, $length);

				if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)
				{
					$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
					$hold_string = substr($hold_string, $unclosed_open - 1);
				}

				$tagallowed = false;
				for ($i = 0; $i < sizeof($allowed_html_tags); $i++)
				{
					$match_tag = trim($allowed_html_tags[$i]);
					if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string))
					{
						$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t ]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
					}
				}

				$tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;

				$start_html += $length;
			}
			else
			{
				$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));

				$start_html = strlen($message);
				$end_html = $start_html;
			}
		}

		if (!$end_html || ($end_html != strlen($message) && $tmp_message != ''))
		{
			$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
		}

		$message = ($tmp_message != '') ? trim($tmp_message) : trim($message);

#
#-----[ REPLACE WITH ]---------------------------------------------
#
		// If HTML is on, we try to make it safe
		// This approach is quite agressive and anything that does not look like a valid tag
		// is going to get converted to HTML entities
		$message = stripslashes($message);
		$html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#';
		$matches = array();

		$message_split = preg_split($html_match, $message);
		preg_match_all($html_match, $message, $matches);

		$message = '';

		foreach ($message_split as $part)
		{
			$tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
			$message .= htmlspecialchars($part) . clean_html($tag);
		}

		$message = addslashes($message);
When I leave that change out all is fine. This is probably a problem on my end (I have my board very heavily modded and have fooled around with html before). I'll try to track this down over the weekend and report back (and I'll test it on a plain vaniall phpbb2.0.19 upgrade to 2.0.20 to see whether all is fine there) but in the meantime I figured I'd mention it here in case anyone else runs into this problem. (And actually, I would appreciate it if anyone who has this problem replies to this post so I can confirm it's not solely my setup.)
facts invariably distort the truth

Post Reply

Return to “[2.0.x] MOD Database Releases”