From d07e152ea7e820c5a0e47aeb8004fa0b5621a314 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sat, 13 Mar 2010 01:54:04 +0000 Subject: [PATCH 1/6] [bug/58025] Search robots are now redirected if they send a SID in the request Previously search robots could stumble upon a board link somewhere on the web containing a SID they'd follow it and end up indexing that page with the SID in the request URI, this fix prevents that by redirecting them to the same URI just without the SID. --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/session.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7b8d8f63f2..7df49bd81b 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -103,6 +103,7 @@
  • [Fix] Allow multibyte keys in request_var(). (Bug #51555)
  • [Fix] Prevent wrong tar archive type detection. (Bug #12531)
  • [Fix] Correct redirection after login to forum not in web root (Bug #58755)
  • +
  • [Fix] Redirect search engines that access pages with SIDs in the URL. (Bug #58025)
  • [Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
  • diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 1a302d5991..8beb0161f9 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -608,6 +608,12 @@ class session } else { + // Bot user, if they have a SID in the Request URI we need to get rid of it + // otherwise they'll index this page with the SID, duplicate content oh my! + if (isset($_GET['sid'])) + { + redirect(build_url(array('sid'))); + } $this->data['session_last_visit'] = $this->time_now; } From 144effd74cf52a71a62e127276d78f56eab41835 Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Mon, 15 Mar 2010 22:48:53 -0500 Subject: [PATCH 2/6] Allow setting parent forums regardless of permission settings. (Bug #58415) --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acp/acp_forums.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 53863da302..560e1e9013 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -98,6 +98,7 @@
  • [Fix] Allow redirect() function to redirect across directories. (Bug #56965)
  • [Fix] Add terminating semicolons to JavaScript code. (Bug #58085 - Patch by nn-)
  • [Fix] Minor language fixes. (Bug #54855)
  • +
  • [Fix] Allow setting parent forums regardless of permission settings. (Bug #57415)
  • [Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
  • diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index bde59ec870..5a5adc57ae 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -407,7 +407,7 @@ class acp_forums $exclude_forums[] = $row['forum_id']; } - $parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false); + $parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, true, false, false); $forum_data['forum_password_confirm'] = $forum_data['forum_password']; } @@ -416,7 +416,7 @@ class acp_forums $this->page_title = 'CREATE_FORUM'; $forum_id = $this->parent_id; - $parents_list = make_forum_select($this->parent_id, false, false, false, false); + $parents_list = make_forum_select($this->parent_id, false, true, false, false); // Fill forum data with default values if (!$update) From 559313eda60459ed7b73e790257321402824d35c Mon Sep 17 00:00:00 2001 From: mrkurt Date: Wed, 17 Mar 2010 06:08:52 -0500 Subject: [PATCH 3/6] [feature/memcache-multi-server] Adding support for multiple memcache servers to acm_memcache.php You can define multiple memcache servers in your config using this format: host::port,host::port,host::port Example: @define(PHPBB_ACM_MEMCACHE, '127.0.0.1::11211,10.0.0.2::11211,memcache1::11211' --- phpBB/includes/acm/acm_memcache.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php index 52b8832749..5a96509d38 100644 --- a/phpBB/includes/acm/acm_memcache.php +++ b/phpBB/includes/acm/acm_memcache.php @@ -37,6 +37,11 @@ if (!defined('PHPBB_ACM_MEMCACHE_HOST')) define('PHPBB_ACM_MEMCACHE_HOST', 'localhost'); } +if (!defined('PHPBB_ACM_MEMCACHE')){ + //can define multiple servers with host1::port1,host2::port2 format + define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '::' . PHPBB_ACM_MEMCACHE_PORT); +} + /** * ACM for Memcached * @package acm @@ -54,7 +59,10 @@ class acm extends acm_memory parent::acm_memory(); $this->memcache = new Memcache; - $this->memcache->connect(PHPBB_ACM_MEMCACHE_HOST, PHPBB_ACM_MEMCACHE_PORT); + foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u){ + $parts = explode('::', $u); + $this->memcache->addServer($parts[0], $parts[1]); + } $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0; } @@ -125,4 +133,4 @@ class acm extends acm_memory } } -?> \ No newline at end of file +?> From c57c1f3fc606665fad6b31993c4a1481018b0915 Mon Sep 17 00:00:00 2001 From: mrkurt Date: Thu, 18 Mar 2010 06:08:24 -0500 Subject: [PATCH 4/6] [feature/memcache-multi-server] Changing format for multiple memcache hosts. Fixing code style issues in changes. Host and ports are now represented like this in config: host1/port1,host2/port2,host3/port3 --- phpBB/includes/acm/acm_memcache.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php index 5a96509d38..e54fa36c38 100644 --- a/phpBB/includes/acm/acm_memcache.php +++ b/phpBB/includes/acm/acm_memcache.php @@ -37,9 +37,10 @@ if (!defined('PHPBB_ACM_MEMCACHE_HOST')) define('PHPBB_ACM_MEMCACHE_HOST', 'localhost'); } -if (!defined('PHPBB_ACM_MEMCACHE')){ - //can define multiple servers with host1::port1,host2::port2 format - define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '::' . PHPBB_ACM_MEMCACHE_PORT); +if (!defined('PHPBB_ACM_MEMCACHE')) +{ + //can define multiple servers with host1/port1,host2/port2 format + define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT); } /** @@ -59,9 +60,10 @@ class acm extends acm_memory parent::acm_memory(); $this->memcache = new Memcache; - foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u){ - $parts = explode('::', $u); - $this->memcache->addServer($parts[0], $parts[1]); + foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u) + { + $parts = explode('/', $u); + $this->memcache->addServer(trim($parts[0]), trim($parts[1])); } $this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0; } From f7c41e1db71a7ad0941d0d1cf13564f1bd0bbd6a Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 18 Mar 2010 17:09:18 +0100 Subject: [PATCH 5/6] [feature/arstechnica/memcache-multi-server] Add memcache-multi-server to the changelog. --- phpBB/docs/CHANGELOG.html | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index e5dcd82806..3f457efb69 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -105,6 +105,7 @@
  • [Fix] Correct redirection after login to forum not in web root (Bug #58755)
  • [Fix] Allow setting parent forums regardless of permission settings. (Bug #57415)
  • [Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
  • +
  • [Feature] The memcache acm plugin now supports multiple memcache servers.
  • 1.i. Changes since 3.0.7

    From b64686073aaeb00feaf9d285c8cf62f3e677544b Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sat, 6 Mar 2010 18:02:26 +0000 Subject: [PATCH 6/6] [bug/58685] Correct spelling errors in append_sid() comments. --- phpBB/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 917433a970..ce1f5f5462 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2139,8 +2139,8 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) { global $_SID, $_EXTRA_URL, $phpbb_hook; - // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly. - // They could mimick most of what is within this function + // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately. + // They could mimic most of what is within this function if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id)) { if ($phpbb_hook->hook_return(__FUNCTION__))