phpBB is no longer supported on PHP4 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.2.0.
+phpBB is no longer supported on PHP4 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.2.
Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.
-This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.2.0 to 5.3.x without problem.
+This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 5.3.2 to 5.4.x without problem.
7.i. Notice on PHP security issues
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 55fbf6d4e8..5581c10786 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -2347,7 +2347,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))... -'FOO_BAR' => 'PHP version < 5.2.0.<br /> +'FOO_BAR' => 'PHP version < 5.3.2.<br /> Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.', ...
... -'FOO_BAR' => 'PHP version < 5.2.0.<br /> +'FOO_BAR' => 'PHP version < 5.3.2.<br /> Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.', ...
... -'FOO_BAR' => 'PHP version < 5.2.0.<br /> +'FOO_BAR' => 'PHP version < 5.3.2.<br /> Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.', ...
Permissions are highly granular and grouped into four major sections, which are:
Global Permissions
-These are used to control access on a global level and apply to the entire bulletin board. They are further divided into Users’ Permissions, Groups’ Permissions, Administrators and Global Moderators.
+These are used to control access on a global level and apply to the entire bulletin board. They are further divided into User Permissions, Group Permissions, Administrators and Global Moderators.
Forum Based Permissions
-These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, Users’ Forum Permissions and Groups’ Forum Permissions.
+These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, User Forum Permissions and Group Forum Permissions.
Permission Roles
These are used to create different sets of permissions for the different permission types later being able to be assigned on a role-based basis. The default roles should cover the administration of bulletin boards large and small, though within each of the four divisions, you can add/edit/delete roles as you see fit.
@@ -82,13 +82,13 @@ $lang = array_merge($lang, array( 'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN' => 'Here you can copy forum permissions from one forum to one or more other forums.', 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', - 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual user permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', - 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User’s permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups.', 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups.', 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums.', @@ -224,8 +224,8 @@ $lang = array_merge($lang, array( 'SELECT_TYPE' => 'Select type', 'SET_PERMISSIONS' => 'Set permissions', 'SET_ROLE_PERMISSIONS' => 'Set role permissions', - 'SET_USERS_PERMISSIONS' => 'Set users permissions', - 'SET_USERS_FORUM_PERMISSIONS' => 'Set users forum permissions', + 'SET_USERS_PERMISSIONS' => 'Set user permissions', + 'SET_USERS_FORUM_PERMISSIONS' => 'Set user forum permissions', 'TRACE_DEFAULT' => 'By default every permission is NO (unset). So the permission can be overwritten by other settings.', 'TRACE_FOR' => 'Trace for', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 7741ff8d1f..94edddc6f5 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -185,7 +185,11 @@ $lang = array_merge($lang, array( 'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.', 'EXPAND_VIEW' => 'Expand view', 'EXTENSION' => 'Extension', + 'EXTENSION_CONTROLLER_MISSING' => 'The extension %s is missing a controller class and cannot be accessed through the front-end.', + 'EXTENSION_CLASS_WRONG_TYPE' => 'The extension controller class %s is not an instance of the phpbb_extension_controller_interface.', + 'EXTENSION_DISABLED' => 'The extension %s is not enabled.', 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension %s has been deactivated and can no longer be displayed.', + 'EXTENSION_DOES_NOT_EXIST' => 'The extension %s does not exist.', 'FAQ' => 'FAQ', 'FAQ_EXPLAIN' => 'Frequently Asked Questions', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 254db4a5c1..ca6045a921 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -300,10 +300,10 @@ $lang = array_merge($lang, array( 'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.', 'PHP_SAFE_MODE' => 'Safe mode', 'PHP_SETTINGS' => 'PHP version and settings', - 'PHP_SETTINGS_EXPLAIN' => 'Required - You must be running at least version 5.2.0 of PHP in order to install phpBB. If safe mode is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', + 'PHP_SETTINGS_EXPLAIN' => 'Required - You must be running at least version 5.3.2 of PHP in order to install phpBB. If safe mode is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', 'PHP_URL_FOPEN_SUPPORT' => 'PHP setting allow_url_fopen is enabled', 'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => 'Optional - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.', - 'PHP_VERSION_REQD' => 'PHP version >= 5.2.0', + 'PHP_VERSION_REQD' => 'PHP version >= 5.3.2', 'POST_ID' => 'Post ID', 'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using %s as table prefix.', 'PREPROCESS_STEP' => 'Executing pre-processing functions/queries', diff --git a/phpBB/report.php b/phpBB/report.php index e29001d389..29b46a6211 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -71,8 +71,9 @@ if ($post_id) trigger_error('POST_NOT_EXIST'); } - $forum_id = (int) $report_data['forum_id']; - $topic_id = (int) $report_data['topic_id']; + $forum_id = (int) $report_data['forum_id']; + $topic_id = (int) $report_data['topic_id']; + $reported_post_text = $report_data['post_text']; $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -130,6 +131,8 @@ else $message .= '' . sprintf($user->lang['RETURN_PM'], '', ''); trigger_error($message); } + + $reported_post_text = $report_data['message_text']; } // Submit report? @@ -155,7 +158,8 @@ if ($submit && $reason_id) 'user_notify' => (int) $user_notify, 'report_closed' => 0, 'report_time' => (int) time(), - 'report_text' => (string) $report_text + 'report_text' => (string) $report_text, + 'reported_post_text' => $reported_post_text, ); $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 85c87b8cca..ab0c83a56f 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -106,7 +106,7 @@ onload_functions.push('subPanels()');
{postrow.POST_SUBJECT}
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 67627f9785..1c4b67044d 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -17,7 +17,7 @@
+
+ {topic_review_row.MESSAGE}
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
new file mode 100644
index 0000000000..4ee0e68718
--- /dev/null
+++ b/tests/functional/extension_controller_test.php
@@ -0,0 +1,153 @@
+phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+ }
+
+ /**
+ * Check an extension at ./ext/foobar/ which should have the class
+ * phpbb_ext_foobar_controller
+ */
+ public function test_foobar()
+ {
+ $this->phpbb_extension_manager->enable('foobar');
+ $crawler = $this->request('GET', 'index.php?ext=foobar');
+ $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text());
+ $this->phpbb_extension_manager->purge('foobar');
+ }
+
+ /**
+ * Check an extension at ./ext/foo/bar/ which should have the class
+ * phpbb_ext_foo_bar_controller
+ */
+ public function test_foo_bar()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+ $crawler = $this->request('GET', 'index.php?ext=foo/bar');
+ $this->assertContains("This is for testing purposes.", $crawler->filter('#page-body')->text());
+ $this->phpbb_extension_manager->purge('foo/bar');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/class which has class
+ * phpbb_ext_foobar_controller
+ */
+ public function test_error_class_name()
+ {
+ $this->phpbb_extension_manager->enable('error/class');
+ $crawler = $this->request('GET', 'index.php?ext=error/class');
+ $this->assertContains("The extension error/class is missing a controller class and cannot be accessed through the front-end.", $crawler->filter('#message')->text());
+ $this->phpbb_extension_manager->purge('error/class');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/classtype which has class
+ * phpbb_ext_error_classtype_controller but does not implement phpbb_extension_controller_interface
+ */
+ public function test_error_class_type()
+ {
+ $this->phpbb_extension_manager->enable('error/classtype');
+ $crawler = $this->request('GET', 'index.php?ext=error/classtype');
+ $this->assertContains("The extension controller class phpbb_ext_error_classtype_controller is not an instance of the phpbb_extension_controller_interface.", $crawler->filter('#message')->text());
+ $this->phpbb_extension_manager->purge('error/classtype');
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/disabled that is (obviously)
+ * a disabled extension
+ */
+ public function test_error_ext_disabled()
+ {
+ $crawler = $this->request('GET', 'index.php?ext=error/disabled');
+ $this->assertContains("The extension error/disabled is not enabled", $crawler->filter('#message')->text());
+ }
+
+ /**
+ * Check the error produced by extension at ./ext/error/404 that is (obviously)
+ * not existant
+ */
+ public function test_error_ext_missing()
+ {
+ $crawler = $this->request('GET', 'index.php?ext=error/404');
+ $this->assertContains("The extension error/404 does not exist.", $crawler->filter('#message')->text());
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/class/controller.php b/tests/functional/fixtures/ext/error/class/controller.php
new file mode 100644
index 0000000000..eb2ae362a6
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/class/controller.php
@@ -0,0 +1,17 @@
+set_ext_dir_prefix($phpbb_root_path . 'ext/error/class/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/class/ext.php b/tests/functional/fixtures/ext/error/class/ext.php
new file mode 100644
index 0000000000..f97ad2b838
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/class/ext.php
@@ -0,0 +1,6 @@
+set_ext_dir_prefix($phpbb_root_path . 'ext/error/classtype/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/classtype/ext.php b/tests/functional/fixtures/ext/error/classtype/ext.php
new file mode 100644
index 0000000000..35b1cd15a2
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/classtype/ext.php
@@ -0,0 +1,6 @@
+set_ext_dir_prefix($phpbb_root_path . 'ext/error/disabled/');
+
+ $template->set_filenames(array(
+ 'body' => 'index_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/error/disabled/ext.php b/tests/functional/fixtures/ext/error/disabled/ext.php
new file mode 100644
index 0000000000..aec8051848
--- /dev/null
+++ b/tests/functional/fixtures/ext/error/disabled/ext.php
@@ -0,0 +1,6 @@
+set_ext_dir_prefix($phpbb_root_path . 'ext/foo/bar/');
+
+ $template->set_filenames(array(
+ 'body' => 'foobar_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php
new file mode 100644
index 0000000000..3a2068631e
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/ext.php
@@ -0,0 +1,6 @@
+
+
+This is for testing purposes.
+
+
diff --git a/tests/functional/fixtures/ext/foobar/controller.php b/tests/functional/fixtures/ext/foobar/controller.php
new file mode 100644
index 0000000000..bf8d8139ae
--- /dev/null
+++ b/tests/functional/fixtures/ext/foobar/controller.php
@@ -0,0 +1,17 @@
+set_ext_dir_prefix($phpbb_root_path . 'ext/foobar/');
+
+ $template->set_filenames(array(
+ 'body' => 'foobar_body.html'
+ ));
+
+ page_header('Test extension');
+ page_footer();
+ }
+}
diff --git a/tests/functional/fixtures/ext/foobar/ext.php b/tests/functional/fixtures/ext/foobar/ext.php
new file mode 100644
index 0000000000..7cf443d369
--- /dev/null
+++ b/tests/functional/fixtures/ext/foobar/ext.php
@@ -0,0 +1,6 @@
+
+
+This is for testing purposes.
+
+
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index b5e6f7e377..69c62af297 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -14,6 +14,10 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $client;
protected $root_url;
+ protected $cache = null;
+ protected $db = null;
+ protected $extension_manager = null;
+
static protected $config = array();
static protected $already_installed = false;
@@ -66,6 +70,60 @@ class phpbb_functional_test_case extends phpbb_test_case
}
}
+ protected function get_db()
+ {
+ global $phpbb_root_path, $phpEx;
+ // so we don't reopen an open connection
+ if (!($this->db instanceof dbal))
+ {
+ if (!class_exists('dbal_' . self::$config['dbms']))
+ {
+ include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
+ }
+ $sql_db = 'dbal_' . self::$config['dbms'];
+ $this->db = new $sql_db();
+ $this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
+ }
+ return $this->db;
+ }
+
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new phpbb_cache_driver_file;
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
+ protected function get_extension_manager()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ if (!$this->extension_manager)
+ {
+ $this->extension_manager = new phpbb_extension_manager(
+ $this->get_db(),
+ self::$config['table_prefix'] . 'ext',
+ $phpbb_root_path,
+ ".$phpEx",
+ $this->get_cache_driver()
+ );
+ }
+
+ return $this->extension_manager;
+ }
+
protected function install_board()
{
global $phpbb_root_path, $phpEx;
|