From 4091f873eaa108cebd3192ede979ce61ead09238 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 18 Oct 2010 21:25:52 +0800 Subject: [ticket/6712] Bump does not create new topic icon on index. Handle the topic bumping process more properly. PHPBB3-6712 --- phpBB/includes/functions_posting.php | 91 ++++++++++++++++++++++++++++++++++++ phpBB/posting.php | 30 +----------- 2 files changed, 92 insertions(+), 29 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6fd87db663..041b549cd6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2611,4 +2611,95 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u return $url; } +/* +* Handle topic bumping +*/ +function bump_topic($forum_id, $topic_id, &$post_data, $current_time = false) +{ + global $config, $db, $user, $phpEx, $phpbb_root_path; + + if ($current_time === false) + { + $current_time = time(); + } + + // Begin bumping + $db->sql_transaction('begin'); + + // Update the topic's last post post_time + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_time = $current_time + WHERE post_id = {$post_data['topic_last_post_id']} + AND topic_id = $topic_id"; + $db->sql_query($sql); + + // Sync the topic's last post time, the rest of the topic's last post data isn't changed + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_post_time = $current_time, + topic_bumped = 1, + topic_bumper = " . $user->data['user_id'] . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + // Update the forum's last post info + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_last_post_id = " . $post_data['topic_last_post_id'] . ", + forum_last_poster_id = " . $post_data['topic_last_poster_id'] . ", + forum_last_post_subject = '" . $db->sql_escape($post_data['topic_last_post_subject']) . "', + forum_last_post_time = $current_time, + forum_last_poster_name = '" . $db->sql_escape($post_data['topic_last_poster_name']) . "', + forum_last_poster_colour = '" . $db->sql_escape($post_data['topic_last_poster_colour']) . "' + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + // Update bumper's time of the last posting to prevent flood + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastpost_time = $current_time + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + + // Mark this topic as posted to + markread('post', $forum_id, $topic_id, $current_time); + + // Mark this topic as read + markread('topic', $forum_id, $topic_id, $current_time); + + // Update forum tracking info + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'SELECT mark_time + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $f_mark_time = (int) $db->sql_fetchfield('mark_time'); + $db->sql_freeresult($result); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $f_mark_time = false; + } + + if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered']) + { + // Update forum info + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time'); + $db->sql_freeresult($result); + + update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time, false); + } + + add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']); + + $url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; + + return $url; +} + ?> \ No newline at end of file diff --git a/phpBB/posting.php b/phpBB/posting.php index f775699cee..89f2dfa2a6 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -321,35 +321,7 @@ if ($mode == 'bump') if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id']) && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}")) { - $db->sql_transaction('begin'); - - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_time = $current_time - WHERE post_id = {$post_data['topic_last_post_id']} - AND topic_id = $topic_id"; - $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_last_post_time = $current_time, - topic_bumped = 1, - topic_bumper = " . $user->data['user_id'] . " - WHERE topic_id = $topic_id"; - $db->sql_query($sql); - - update_post_information('forum', $forum_id); - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_lastpost_time = $current_time - WHERE user_id = " . $user->data['user_id']; - $db->sql_query($sql); - - $db->sql_transaction('commit'); - - markread('post', $forum_id, $topic_id, $current_time); - - add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']); - - $meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; + $meta_url = bump_topic($forum_id, $topic_id, $post_data, $current_time); meta_refresh(3, $meta_url); $message = $user->lang['TOPIC_BUMPED'] . '

' . sprintf($user->lang['VIEW_MESSAGE'], '', ''); -- cgit v1.2.1 From ac26bb458f2a2ea60848921826c69bfe03e676db Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 28 Oct 2010 21:41:14 +0200 Subject: [ticket/9764] Allow $config['mime_triggers'] to be an empty string. explode('|', '') and explode('|', NULL) both return array(0 => '') which can cause filespec::check_content() to reject everything starting with a '<' character in case $config['mime_triggers'] is an empty string or not set. fileupload::set_disallowed_content() now filters out empty strings by calling array_diff() on the passed array, so setting $config['mime_triggers'] to an empty string will turn off mime checking completely. On the other side we want to fail safe if $config['mime_triggers'] is not set at all. To do this, the array fileupload::$disallowed_content now contains some default strings to be filtered out. PHPBB3-9764 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_upload.php | 4 ++-- phpBB/includes/functions_user.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6fd87db663..72331a73c6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -388,7 +388,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); $upload = new fileupload(); - if ($config['check_attachment_content']) + if ($config['check_attachment_content'] && isset($config['mime_triggers'])) { $upload->set_disallowed_content(explode('|', $config['mime_triggers'])); } diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 7f09cc1640..d5bbd80242 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -458,7 +458,7 @@ class fileerror extends filespec class fileupload { var $allowed_extensions = array(); - var $disallowed_content = array(); + var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title'); var $max_filesize = 0; var $min_width = 0; var $min_height = 0; @@ -539,7 +539,7 @@ class fileupload { if ($disallowed_content !== false && is_array($disallowed_content)) { - $this->disallowed_content = $disallowed_content; + $this->disallowed_content = array_diff($disallowed_content, array('')); } } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index f2c80705ba..90341cd926 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2080,7 +2080,7 @@ function avatar_upload($data, &$error) // Init upload class include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); - $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], explode('|', $config['mime_triggers'])); + $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], (isset($config['mime_triggers']) ? explode('|', $config['mime_triggers']) : false)); if (!empty($_FILES['uploadfile']['name'])) { -- cgit v1.2.1 From 87aa611a8e4b944ad3ba2cde1d3256570c5f45af Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 11:49:17 +0100 Subject: [develop-olympus] Incrementing the version number to 3.0.9-dev. --- phpBB/includes/constants.php | 4 ++-- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index a4635895b0..90440f74b8 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.0.8-RC1'); +define('PHPBB_VERSION', '3.0.9-dev'); // QA-related // define('PHPBB_QA', 1); @@ -275,4 +275,4 @@ define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables -?> \ No newline at end of file +?> diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 01e8ef7658..87a80f6a30 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-RC1'; +$updates_to_version = '3.0.9-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index cbee2c9ba1..355af802ef 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -242,7 +242,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8-RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.9-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -829,4 +829,4 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); -# POSTGRES COMMIT # \ No newline at end of file +# POSTGRES COMMIT # -- cgit v1.2.1 From 396af3853fc2d86b255db0f71e56a9f880ee2509 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 12:07:45 +0100 Subject: [develop-olympus] Remove accidentally added trailing newlines. --- phpBB/includes/constants.php | 2 +- phpBB/install/database_update.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 90440f74b8..2b19aa185d 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -275,4 +275,4 @@ define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables -?> +?> \ No newline at end of file diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 87a80f6a30..78d9067003 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.9-dev'; +$updates_to_version = '3.0.8-RC1'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -477,7 +477,7 @@ else

-

" class="button1">

+

" class="button1">

'[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'mssqlnative' => array( 'INT:' => '[int]', 'BINT' => '[float]', @@ -2028,7 +2028,7 @@ class updater_db_tools 'VCHAR_CI' => '[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -2175,7 +2175,7 @@ class updater_db_tools case 'mssql_odbc': $this->sql_layer = 'mssql'; break; - + case 'mssqlnative': $this->sql_layer = 'mssqlnative'; break; @@ -3797,4 +3797,4 @@ class updater_db_tools } } -?> +?> \ No newline at end of file -- cgit v1.2.1 From b02cec86d40345f7ad28d0cca4e409766f0e65c2 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 12:13:51 +0100 Subject: [develop-olympus] Revert accidental revert of db update lang fix and version Really not my day, is it? --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 78d9067003..8d1755f8a6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-RC1'; +$updates_to_version = '3.0.9-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -477,7 +477,7 @@ else

-

" class="button1">

+

" class="button1">

Date: Sun, 21 Nov 2010 23:18:09 +0100 Subject: [ticket/9910] Make sure S_BBCODE_ALLOWED exists when viewing PMs PHPBB3-9910 --- phpBB/includes/ucp/ucp_pm_viewmessage.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB') diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 16700c490c..b91636a9c8 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -172,6 +172,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Number of "to" recipients $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); + $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false; + $template->assign_vars(array( 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), @@ -229,6 +231,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), 'S_PM_RECIPIENTS' => $num_recipients, + 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0, 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') -- cgit v1.2.1 From 7e934c6362a219bd3e9c11c6461bc6a32a9cf930 Mon Sep 17 00:00:00 2001 From: RMcGirr83 Date: Thu, 11 Nov 2010 18:50:08 -0500 Subject: [ticket/9897] A few language fixes PHPBB3-9897 --- phpBB/language/en/acp/board.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB') diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 753decd517..5293b835d6 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -51,7 +51,7 @@ $lang = array_merge($lang, array( 'SITE_NAME' => 'Site name', 'SYSTEM_DST' => 'Enable Summer Time/DST', 'SYSTEM_TIMEZONE' => 'Guest timezone', - 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in user control panel.', + 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.', 'WARNINGS_EXPIRE' => 'Warning duration', 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record.', )); @@ -325,7 +325,7 @@ $lang = array_merge($lang, array( 'VISUAL_CONFIRM_REG' => 'Enable spambot countermeasures for registrations', 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to pass the anti-spambot task to help prevent automated registrations.', 'VISUAL_CONFIRM_REFRESH' => 'Allow users to refresh the anti-spambot task', - 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the currunt task during registration. Some plugins might not support this option.', + 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the current task during registration. Some plugins might not support this option.', )); // Cookie Settings @@ -394,7 +394,7 @@ $lang = array_merge($lang, array( 'LDAP_NO_EMAIL' => 'The specified e-mail attribute does not exist.', 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.', 'LDAP_PASSWORD' => 'LDAP password', - 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', + 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding, otherwise fill in the password for the above user. Required for Active Directory Servers.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', 'LDAP_PORT' => 'LDAP server port', 'LDAP_PORT_EXPLAIN' => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.', 'LDAP_SERVER' => 'LDAP server name', -- cgit v1.2.1 From 053cf790a93e9cfb521f484901d79c72783f868f Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 23 Nov 2010 16:09:09 +0100 Subject: [ticket/9924] Pass template instance into $template->display hook PHPBB3-9924 --- phpBB/docs/hook_system.html | 2 ++ phpBB/includes/template.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB') diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index 1bf4630a9f..34055c4661 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -380,6 +380,8 @@ a:active { color: #368AD2; } $template->display($handle, $include_once = true); which is called directly before outputting the (not-yet-compiled) template.
exit_handler(); which is called at the very end of phpBB3's execution.

+

Please note: The $template->display hook takes a third $template argument, which is the template instance being used, which should be used instead of the global.

+

There are also valid external constants you may want to use if you embed phpBB3 into your application:

diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index f1c8094a9b..6347633b14 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -205,7 +205,7 @@ class template
 	{
 		global $user, $phpbb_hook;
 
-		if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
+		if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
 		{
 			if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
 			{
-- 
cgit v1.2.1


From 5ec1c887959be5629c8a4c712b152d58058929a8 Mon Sep 17 00:00:00 2001
From: Joas Schilling 
Date: Thu, 25 Nov 2010 23:29:12 +0100
Subject: [ticket/9930] Redirect failes with open_basedir enabled.

Open_basedir does not allow file_exists() for "." and directories without a
trayling-slash. Therefor we must append it on the check.

PHPBB3-9930
---
 phpBB/includes/functions.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 561a9906c4..c7f19b709d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2353,12 +2353,12 @@ function redirect($url, $return = false, $disable_cd_check = false)
 		// Relative uri
 		$pathinfo = pathinfo($url);
 
-		if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
+		if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
 		{
 			$url = str_replace('../', '', $url);
 			$pathinfo = pathinfo($url);
 
-			if (!file_exists($pathinfo['dirname']))
+			if (!file_exists($pathinfo['dirname'] . '/'))
 			{
 				// fallback to "last known user page"
 				// at least this way we know the user does not leave the phpBB root
-- 
cgit v1.2.1


From 23765fa6684ab8a4764ce944ac0469d2973eb12f Mon Sep 17 00:00:00 2001
From: Richard Foote 
Date: Sun, 28 Nov 2010 13:32:35 +0100
Subject: [ticket/9932] Add the Bing bot when converting

PHPBB3-9932
---
 phpBB/includes/functions_convert.php | 1 +
 1 file changed, 1 insertion(+)

(limited to 'phpBB')

diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 9e26043b39..4a359dcade 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1816,6 +1816,7 @@ function add_bots()
 		'Alta Vista [Bot]'			=> array('Scooter/', ''),
 		'Ask Jeeves [Bot]'			=> array('Ask Jeeves', ''),
 		'Baidu [Spider]'			=> array('Baiduspider+(', ''),
+		'Bing [Bot]'				=> array('bingbot/', ''),
 		'Exabot [Bot]'				=> array('Exabot/', ''),
 		'FAST Enterprise [Crawler]'	=> array('FAST Enterprise Crawler', ''),
 		'FAST WebCrawler [Crawler]'	=> array('FAST-WebCrawler/', ''),
-- 
cgit v1.2.1


From b017f54ac9c923e74325f8cca96b11c6b684f115 Mon Sep 17 00:00:00 2001
From: Ingo Migliarina 
Date: Wed, 1 Dec 2010 18:33:53 +0100
Subject: [ticket/9921] Adding sample configuration file for the lighttpd
 webserver.

PHPBB3-9921
---
 phpBB/docs/lighttpd.sample.conf | 60 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 phpBB/docs/lighttpd.sample.conf

(limited to 'phpBB')

diff --git a/phpBB/docs/lighttpd.sample.conf b/phpBB/docs/lighttpd.sample.conf
new file mode 100644
index 0000000000..5873d1c945
--- /dev/null
+++ b/phpBB/docs/lighttpd.sample.conf
@@ -0,0 +1,60 @@
+# Sample lighttpd configuration file for phpBB.
+# Global settings have been removed, copy them
+# from your system's lighttpd.conf.
+# Tested with lighttpd 1.4.26
+
+# Load moules
+server.modules += ( 
+	"mod_access",
+	"mod_fastcgi",
+	"mod_accesslog"
+)
+
+# If you have domains with and without www prefix,
+# redirect one to the other.
+$HTTP["host"] =~ "^(myforums\.com)$" {
+	url.redirect = (
+		".*"	=> "http://www.%1$0"
+	)
+}
+
+$HTTP["host"] == "www.myforums.com" {
+	server.name				= "www.myforums.com"
+	server.document-root	= "/path/to/phpbb"
+	server.dir-listing		= "disable"
+	
+	index-file.names		= ( "index.php", "index.htm", "index.html" )
+	accesslog.filename		= "/var/log/lighttpd/access-www.myforums.com.log"
+	
+	# Deny access to internal phpbb files.	
+	$HTTP["url"] =~ "^/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload)" {
+		url.access-deny = ( "" )
+	}
+
+	# Deny access to version control system directories.
+	$HTTP["url"] =~ "/\.svn|/\.git" {
+		url.access-deny = ( "" )
+	}
+	
+	# Deny access to apache configuration files.
+	$HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
+		url.access-deny = ( "" )
+	}
+
+	fastcgi.server = ( ".php" => 
+		((
+			"bin-path" => "/usr/bin/php-cgi",
+			"socket" => "/tmp/php.socket",
+			"max-procs" => 4,
+			"idle-timeout" => 30,
+			"bin-environment" => ( 
+				"PHP_FCGI_CHILDREN" => "10",
+				"PHP_FCGI_MAX_REQUESTS" => "10000"
+			),
+			"bin-copy-environment" => (
+				"PATH", "SHELL", "USER"
+			),
+			"broken-scriptfilename" => "enable"
+		))
+	)
+}
-- 
cgit v1.2.1


From 8b3d068e8321a16451dddcef6da2cf1245506e55 Mon Sep 17 00:00:00 2001
From: Adam Reyher 
Date: Wed, 1 Dec 2010 14:14:46 -0500
Subject: [ticket/9575] Change 'administrate' to 'administer'

PHPBB3-9575
---
 phpBB/language/en/acp/common.php | 2 +-
 phpBB/language/en/acp/groups.php | 2 +-
 phpBB/language/en/memberlist.php | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 2c549f8130..8c71e936b3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -255,7 +255,7 @@ $lang = array_merge($lang, array(
 	'MOVE_UP'				=> 'Move up',
 
 	'NOTIFY'				=> 'Notification',
-	'NO_ADMIN'				=> 'You are not authorised to administrate this board.',
+	'NO_ADMIN'				=> 'You are not authorised to administer this board.',
 	'NO_EMAILS_DEFINED'		=> 'No valid e-mail addresses found.',
 	'NO_PASSWORD_SUPPLIED'	=> 'You need to enter your password to access the Administration Control Panel.',
 
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index e8c1a3c494..3444b98303 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -36,7 +36,7 @@ if (empty($lang) || !is_array($lang))
 // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
 
 $lang = array_merge($lang, array(
-	'ACP_GROUPS_MANAGE_EXPLAIN'		=> 'From this panel you can administrate all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
+	'ACP_GROUPS_MANAGE_EXPLAIN'		=> 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
 	'ADD_USERS'						=> 'Add users',
 	'ADD_USERS_EXPLAIN'				=> 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.',
 
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index e7a9c6b88d..213f766610 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -131,7 +131,7 @@ $lang = array_merge($lang, array(
 	'SORT_POST_COUNT'		=> 'Post count',
 
 	'USERNAME_BEGINS_WITH'	=> 'Username begins with',
-	'USER_ADMIN'			=> 'Administrate user',
+	'USER_ADMIN'			=> 'Administer user',
 	'USER_BAN'				=> 'Banning',
 	'USER_FORUM'			=> 'User statistics',
 	'USER_LAST_REMINDED'	=> array(
-- 
cgit v1.2.1


From e6a6f00562953f507bb05f4c61d40a0800f70bff Mon Sep 17 00:00:00 2001
From: Adam Reyher 
Date: Wed, 1 Dec 2010 14:29:28 -0500
Subject: [ticket/9928] Do not link "login to your board" to the "send
 statistics" page.

PHPBB3-9928
---
 phpBB/language/en/install.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'phpBB')

diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 14923e836e..91ecb10848 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -370,7 +370,7 @@ $lang = array_merge($lang, array(
 
 // Updater
 $lang = array_merge($lang, array(
-	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the Send statistics module in your ACP.',
+	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the Send statistics module in your ACP.',
 	'ARCHIVE_FILE'				=> 'Source file within archive',
 
 	'BACK'				=> 'Back',
-- 
cgit v1.2.1


From 7a3d6a8168c7cd7da4f3ff462579ed562d0432a1 Mon Sep 17 00:00:00 2001
From: RMcGirr83 
Date: Mon, 29 Nov 2010 07:10:19 -0500
Subject: [ticket/8736] guest can have 255 chars long username

when you post as a guest (anonymous) you can fill the field username with 255
chars. that will destroy the prosilver and subsilver2 style at viewtopic.
settings for username in ACP: 6-16 Chars

PHPBB3-8736
---
 phpBB/posting.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'phpBB')

diff --git a/phpBB/posting.php b/phpBB/posting.php
index f775699cee..7368026136 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -861,11 +861,18 @@ if ($submit || $preview || $refresh)
 	{
 		include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
 
+		$user->add_lang('ucp');
+
 		if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)
 		{
-			$user->add_lang('ucp');
 			$error[] = $user->lang[$result . '_USERNAME'];
 		}
+
+		if (($result = validate_string($post_data['username'], false, $config['min_name_chars'], $config['max_name_chars'])) !== false)
+		{
+			$min_max_amount = ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars'];
+			$error[] = sprintf($user->lang['FIELD_' . $result], $user->lang['USERNAME'], $min_max_amount);
+		}
 	}
 
 	if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
-- 
cgit v1.2.1


From 0491bfbc2d5e7d98a7a15b5d0096c2647b821709 Mon Sep 17 00:00:00 2001
From: Igor Wiedler 
Date: Sun, 5 Dec 2010 14:09:39 +0100
Subject: [ticket/9575] Also change 'administrate' to 'administer' in templates

PHPBB3-9575
---
 phpBB/adm/style/acp_forums.html | 2 +-
 phpBB/adm/style/acp_styles.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 9f9216a068..d27cea28f7 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -58,7 +58,7 @@
 
 		/**
 		* Init the wanted display functionality if javascript is enabled.
-		* If javascript is not available, the user is still able to properly administrate.
+		* If javascript is not available, the user is still able to properly administer.
 		*/
 		onload = function()
 		{
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index 5bde4008ad..cb4361dd6f 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -77,7 +77,7 @@
 
 		/**
 		* Init the wanted display functionality if javascript is enabled.
-		* If javascript is not available, the user is still able to properly administrate.
+		* If javascript is not available, the user is still able to properly administer.
 		*/
 		onload = function()
 		{
-- 
cgit v1.2.1


From 7dd06e8113d4a571d8681a9a11f2b06ca7a7beb8 Mon Sep 17 00:00:00 2001
From: Igor Wiedler 
Date: Sun, 5 Dec 2010 14:35:19 +0100
Subject: [ticket/9939] Fix JavaScript error in admin recaptcha template

PHPBB3-9939
---
 phpBB/adm/style/captcha_recaptcha.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'phpBB')

diff --git a/phpBB/adm/style/captcha_recaptcha.html b/phpBB/adm/style/captcha_recaptcha.html
index 586c494868..d3038fd714 100644
--- a/phpBB/adm/style/captcha_recaptcha.html
+++ b/phpBB/adm/style/captcha_recaptcha.html
@@ -5,7 +5,7 @@
 		// 
 		
-- 
cgit v1.2.1


From d7287ec633577886e5f92543c2a610d4aaa93d53 Mon Sep 17 00:00:00 2001
From: ChrisTX 
Date: Sun, 21 Nov 2010 23:02:56 +0100
Subject: [feature/acm-wincache] Adding caching module for WinCache's User
 Cache.

PHPBB3-9942
---
 phpBB/includes/acm/acm_wincache.php | 84 +++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 phpBB/includes/acm/acm_wincache.php

(limited to 'phpBB')

diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php
new file mode 100644
index 0000000000..0501ab74c5
--- /dev/null
+++ b/phpBB/includes/acm/acm_wincache.php
@@ -0,0 +1,84 @@
+key_prefix . $var, $success);
+
+		return ($success) ? $result : false;
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return wincache_ucache_delete($this->key_prefix . $var);
+	}
+}
-- 
cgit v1.2.1


From b88582199d09931e23b939784fc266fbc0473d30 Mon Sep 17 00:00:00 2001
From: rxu 
Date: Sun, 17 Oct 2010 15:42:13 +0800
Subject: [ticket/9851] "Search new posts" should require login.

The newposts search uses user_lastvisit, so it should require user to log in.

PHPBB3-9851
---
 phpBB/language/en/search.php |  1 +
 phpBB/search.php             | 56 +++++++++++++++++++++++++++-----------------
 2 files changed, 35 insertions(+), 22 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index d93fe6b56a..cd38cd615f 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -54,6 +54,7 @@ $lang = array_merge($lang, array(
 
 	'LOGIN_EXPLAIN_EGOSEARCH'	=> 'The board requires you to be registered and logged in to view your own posts.',
 	'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
+	'LOGIN_EXPLAIN_NEWPOSTS'	=> 'The board requires you to be registered and logged in to view new posts since your last visit.',
 
 	'MAX_NUM_SEARCH_KEYWORDS_REFINE'	=> 'You specified too many words to search for. Please do not enter more than %1$d words.',
 
diff --git a/phpBB/search.php b/phpBB/search.php
index 2a13e20477..2aa61401cf 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -47,32 +47,44 @@ $sort_dir		= request_var('sd', 'd');
 $return_chars	= request_var('ch', ($topic_id) ? -1 : 300);
 $search_forum	= request_var('fid', array(0));
 
-// We put login boxes for the case if search_id is egosearch or unreadposts
+// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
 // because a guest should be able to log in even if guests search is not permitted
 
-// Egosearch is an author search
-if ($search_id == 'egosearch')
+switch ($search_id)
 {
-	$author_id = $user->data['user_id'];
-
-	if ($user->data['user_id'] == ANONYMOUS)
-	{
-		login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
-	}
-}
+	// Egosearch is an author search
+	case 'egosearch':
+		$author_id = $user->data['user_id'];
+		if ($user->data['user_id'] == ANONYMOUS)
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
+		}
+	break;
 
-// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
-if ($search_id == 'unreadposts')
-{
-	if (!$config['load_unreads_search'])
-	{
-		$template->assign_var('S_NO_SEARCH', true);
-		trigger_error('NO_SEARCH_UNREADS');
-	}
-	else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
-	{
-		login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
-	}
+	// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
+	case 'unreadposts':
+		if (!$config['load_unreads_search'])
+		{
+			$template->assign_var('S_NO_SEARCH', true);
+			trigger_error('NO_SEARCH_UNREADS');
+		}
+		else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+		}
+	break;
+	
+	// The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
+	case 'newposts':
+		if ($user->data['user_id'] == ANONYMOUS)
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
+		}
+	break;
+	
+	default:
+		// There's nothing to do here for now ;)
+	break;
 }
 
 // Is user able to search? Has search been disabled?
-- 
cgit v1.2.1


From e4488fe78819b5dd7b1e7edd8c8defe07d264b37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= 
Date: Wed, 15 Dec 2010 09:39:28 +0100
Subject: [ticket/9948] Inline quicktime files won't show

When attaching a quicktime file and placing it
inline the movie won't be shown due to the size
the movie box is being given.

PHPBB3-9948
---
 phpBB/styles/prosilver/template/attachment.html  | 4 ++--
 phpBB/styles/subsilver2/template/attachment.html | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index cc5aacff2f..4c0a326f1e 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -70,12 +70,12 @@
 				
 			
 		
-			
+			
 				
 				
 				
 				
-				
+				
 			
 		
 			
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index 833bd4d55f..b5b547b2e6 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -67,12 +67,12 @@
 				
 			
 		
-			
+			
 				
 				
 				
 				
-				 
+				 
 			
 		
 			
-- 
cgit v1.2.1


From fc9516a2e3e4b039b8f4f07604b6914a54a71757 Mon Sep 17 00:00:00 2001
From: Andreas Fischer 
Date: Thu, 16 Dec 2010 01:19:40 +0100
Subject: [ticket/9859] Remove years from the credit line.

PHPBB3-9859
---
 phpBB/styles/prosilver/template/overall_footer.html  | 2 +-
 phpBB/styles/subsilver2/template/overall_footer.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'phpBB')

diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 4da1308e14..aeb6dc9ba3 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -30,7 +30,7 @@
 	The phpBB Group : 2006
 //-->
 
-	
-	
-	
-	
+
 	
diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html
index ac9e826dd8..03ca369562 100644
--- a/phpBB/adm/style/overall_footer.html
+++ b/phpBB/adm/style/overall_footer.html
@@ -6,18 +6,7 @@
 		
 		
 	
-	
-	
-	
+
 	
 
-
-
 
 	
 
-
-
 	
-