diff options
-rw-r--r-- | phpBB/composer.json | 2 | ||||
-rw-r--r-- | phpBB/composer.lock | 4 | ||||
-rw-r--r-- | phpBB/docs/README.html | 6 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
-rw-r--r-- | phpBB/includes/bbcode.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 16 | ||||
-rw-r--r-- | phpBB/install/convert/convertor.php | 2 | ||||
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 2 | ||||
-rwxr-xr-x | phpBB/install/phpbbcli.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/install.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/controller/resolver.php | 18 | ||||
-rw-r--r-- | phpBB/phpbb/db/tools/mssql.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/module/module_manager.php | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/style.cfg | 4 | ||||
-rw-r--r-- | tests/controller/controller_test.php | 58 | ||||
-rw-r--r-- | tests/controller/ext/vendor2/foo/controller.php | 17 | ||||
-rw-r--r-- | tests/text_processing/tickets_data/PHPBB3-14260.html | 1 | ||||
-rw-r--r-- | tests/text_processing/tickets_data/PHPBB3-14260.txt | 1 |
20 files changed, 111 insertions, 41 deletions
diff --git a/phpBB/composer.json b/phpBB/composer.json index d6a4213c4a..b0c9b57cb6 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -62,7 +62,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.2.x-dev" } } } diff --git a/phpBB/composer.lock b/phpBB/composer.lock index f565c424fa..968447fd63 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e61304256160e9e0c521a4996912d65d", - "content-hash": "64ae8ac9ac0cc8b1f47e58f43e2d7461", + "hash": "9cbb41222e71eb86e0ef9118baafc691", + "content-hash": "03a990fa2d088c89afe4824d2d53e873", "packages": [ { "name": "bantu/ini-get-wrapper", diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 20afc310db..a7906ac802 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="keywords" content="" /> -<meta name="description" content="phpBB 3.3.x Readme" /> +<meta name="description" content="phpBB 3.2.x Readme" /> <title>phpBB • Readme</title> <link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" /> @@ -21,7 +21,7 @@ <div id="doc-description"> <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> - <h1>phpBB 3.3.x Readme</h1> + <h1>phpBB 3.2.x Readme</h1> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> @@ -324,7 +324,7 @@ <div class="content"> - <p>phpBB 3.3.x takes advantage of new features added in PHP 5.4. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 5.4.0 and the maximum supported version is PHP 7.0.</p> + <p>phpBB 3.2.x takes advantage of new features added in PHP 5.4. We recommend that you upgrade to the latest stable release of PHP to run phpBB. The minimum version required is PHP 5.4.0 and the maximum supported version is PHP 7.0.</p> <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p> diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index ab413bf1d7..07ec6713a0 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1431,7 +1431,7 @@ class acp_attachments $row['group_name'] = $user->lang['NOT_ASSIGNED']; $group_name[] = $row; - for ($i = 0; $i < sizeof($group_name); $i++) + for ($i = 0, $groups_size = sizeof($group_name); $i < $groups_size; $i++) { if ($default_group === false) { diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index c5d2d0ea09..3ea9d81887 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1420,7 +1420,7 @@ class acp_forums $diff = sizeof($moved_forums) * 2; $moved_ids = array(); - for ($i = 0; $i < sizeof($moved_forums); ++$i) + for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i) { $moved_ids[] = $moved_forums[$i]['forum_id']; } diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index e8969e552e..4b2aa90ebc 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -226,6 +226,11 @@ class bbcode ), 'preg' => array( '#\[quote(?:="(.*?)")?:$uid\]((?!\[quote(?:=".*?")?:$uid\]).)?#is' => function ($match) { + if (!isset($match[2])) + { + $match[2] = ''; + } + return $this->bbcode_second_pass_quote($match[1], $match[2]); }, ) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a0073ec158..a84cbd9311 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2999,8 +2999,8 @@ function add_permission_language() $lang_files = $finder ->prefix('permissions_') ->suffix(".$phpEx") - ->core_path('language/' . $user->lang_name . '/') - ->extension_directory('/language/' . $user->lang_name) + ->core_path('language/') + ->extension_directory('/language') ->find(); foreach ($lang_files as $lang_file => $ext_name) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 3575768782..27d3658e36 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -479,7 +479,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false $dir->close(); } - for ($i = 0; $i < sizeof($dirlist); ++$i) + for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i) { $dir = $dirlist[$i]; @@ -1425,7 +1425,7 @@ function get_path($src_path, $src_url, $test_file) $path_array = array(); $phpbb_parts = explode('/', $script_path); - for ($i = 0; $i < sizeof($url_parts); ++$i) + for ($i = 0, $end = sizeof($url_parts); $i < $end; ++$i) { if ($i < sizeof($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i]) { @@ -1435,7 +1435,7 @@ function get_path($src_path, $src_url, $test_file) else { $path = ''; - for ($j = $i; $j < sizeof($phpbb_parts); ++$j) + for ($j = $i, $end2 = sizeof($phpbb_parts); $j < $end2; ++$j) { $path .= '../'; } @@ -2267,7 +2267,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals "\n\n" ); - for ($i = 0; $i < sizeof($str_from); ++$i) + for ($i = 0, $end = sizeof($str_from); $i < $end; ++$i) { $origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is'; $replx[] = $str_to[$i]; @@ -2276,7 +2276,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m)) { - for ($i = 0; $i < sizeof($m[1]); ++$i) + for ($i = 0, $end = sizeof($m[1]); $i < $end; ++$i) { if ($m[1][$i] == $m[2][$i]) { @@ -2340,7 +2340,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour $parts = explode('/', $trg); unset($parts[sizeof($parts) - 1]); - for ($i = 0; $i < sizeof($parts); ++$i) + for ($i = 0, $end = sizeof($parts); $i < $end; ++$i) { $path .= $parts[$i] . '/'; @@ -2440,7 +2440,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ if ($copy_subdirs) { - for ($i = 0; $i < sizeof($dirlist); ++$i) + for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i) { $dir = $dirlist[$i]; @@ -2475,7 +2475,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ $convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__); } - for ($i = 0; $i < sizeof($filelist); ++$i) + for ($i = 0, $end = sizeof($filelist); $i < $end; ++$i) { copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path); } diff --git a/phpBB/install/convert/convertor.php b/phpBB/install/convert/convertor.php index 769f8bb637..5a3799a7a1 100644 --- a/phpBB/install/convert/convertor.php +++ b/phpBB/install/convert/convertor.php @@ -373,7 +373,7 @@ class convertor $val = array($val); } - for ($j = 0; $j < sizeof($val); ++$j) + for ($j = 0, $size = sizeof($val); $j < $size; ++$j) { if (preg_match('/LEFT JOIN ([a-z0-9_]+) AS ([a-z0-9_]+)/i', $val[$j], $m)) { diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index d0885dc620..977670c94c 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.3.0-a1-dev', + 'phpbb_version' => '3.2.0-b3-dev', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php index 4b86f64e2a..87eab84b5a 100755 --- a/phpBB/install/phpbbcli.php +++ b/phpBB/install/phpbbcli.php @@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli') define('IN_PHPBB', true); define('IN_INSTALL', true); define('PHPBB_ENVIRONMENT', 'production'); -define('PHPBB_VERSION', '3.3.0-a1-dev'); +define('PHPBB_VERSION', '3.2.0-b3-dev'); $phpbb_root_path = __DIR__ . '/../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 39d53ece7b..9a727be649 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -523,7 +523,7 @@ $lang = array_merge($lang, array( // Finish conversion 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.3. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.2. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.', 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP upload for attachments is enabled at the old board. Please disable the FTP upload option and make sure a valid upload directory is specified, then copy all attachment files to this new web accessible directory. Once you have done this, restart the convertor.', 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php index 4f432c3323..f8dffc12de 100644 --- a/phpBB/phpbb/controller/resolver.php +++ b/phpBB/phpbb/controller/resolver.php @@ -126,9 +126,21 @@ class resolver implements ControllerResolverInterface */ public function getArguments(Request $request, $controller) { - // At this point, $controller contains the object and method name - list($object, $method) = $controller; - $mirror = new \ReflectionMethod($object, $method); + // At this point, $controller should be a callable + if (is_array($controller)) + { + list($object, $method) = $controller; + $mirror = new \ReflectionMethod($object, $method); + } + else if (is_object($controller) && !$controller instanceof \Closure) + { + $mirror = new \ReflectionObject($controller); + $mirror = $mirror->getMethod('__invoke'); + } + else + { + $mirror = new \ReflectionFunction($controller); + } $arguments = array(); $parameters = $mirror->getParameters(); diff --git a/phpBB/phpbb/db/tools/mssql.php b/phpBB/phpbb/db/tools/mssql.php index a90a85bbb2..87719acd21 100644 --- a/phpBB/phpbb/db/tools/mssql.php +++ b/phpBB/phpbb/db/tools/mssql.php @@ -605,7 +605,7 @@ class mssql extends tools if (!empty($column_data['default'])) { // Add new default value constraint - $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']'; + $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $column_data['default'] . ' FOR [' . $column_name . ']'; } if (!empty($indexes)) diff --git a/phpBB/phpbb/module/module_manager.php b/phpBB/phpbb/module/module_manager.php index a812d06736..7ae16cdb61 100644 --- a/phpBB/phpbb/module/module_manager.php +++ b/phpBB/phpbb/module/module_manager.php @@ -356,7 +356,7 @@ class module_manager $diff = sizeof($moved_modules) * 2; $moved_ids = array(); - for ($i = 0; $i < sizeof($moved_modules); ++$i) + for ($i = 0, $size = sizeof($moved_modules); $i < $size; ++$i) { $moved_ids[] = $moved_modules[$i]['module_id']; } diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index e0b87f2398..690c35ca7a 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = prosilver copyright = © phpBB Limited, 2007 -style_version = 3.3.0-dev -phpbb_version = 3.3.0-dev +style_version = 3.2.0-b3-dev +phpbb_version = 3.2.0-b3-dev # Defining a different template bitfield # template_bitfield = lNg= diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php index abc1124a90..d921d0eade 100644 --- a/tests/controller/controller_test.php +++ b/tests/controller/controller_test.php @@ -11,6 +11,9 @@ * */ +include_once(__DIR__ . '/ext/vendor2/foo/controller.php'); +include_once(__DIR__.'/phpbb/controller/foo.php'); + use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -64,7 +67,7 @@ class phpbb_controller_controller_test extends phpbb_test_case $this->assertNull($routes->get('controller_noroute')); } - public function test_controller_resolver() + protected function get_foo_container() { $container = new ContainerBuilder(); // YamlFileLoader only uses one path at a time, so we need to loop @@ -75,26 +78,59 @@ class phpbb_controller_controller_test extends phpbb_test_case $loader->load('services.yml'); } - // Autoloading classes within the tests folder does not work - // so I'll include them manually. - if (!class_exists('vendor2\\foo\\controller')) - { - include(__DIR__ . '/ext/vendor2/foo/controller.php'); - } - if (!class_exists('phpbb\\controller\\foo')) - { - include(__DIR__.'/phpbb/controller/foo.php'); - } + return $container; + } + + public function test_controller_resolver() + { + $container = $this->get_foo_container(); $resolver = new \phpbb\controller\resolver($container, dirname(__FILE__) . '/'); $symfony_request = new Request(); $symfony_request->attributes->set('_controller', 'foo.controller:handle'); $this->assertEquals($resolver->getController($symfony_request), array(new foo\controller, 'handle')); + $this->assertEquals(array('foo'), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request))); $symfony_request = new Request(); $symfony_request->attributes->set('_controller', 'core_foo.controller:bar'); $this->assertEquals($resolver->getController($symfony_request), array(new phpbb\controller\foo, 'bar')); + $this->assertEquals(array(), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request))); + } + + public function data_get_arguments() + { + return array( + array(array(new foo\controller(), 'handle2'), array('foo', 0)), + array(array(new foo\controller(), 'handle_fail'), array('default'), array('no_default' => 'default')), + array(new foo\controller(), array(), array()), + array(array(new foo\controller(), 'handle_fail'), array(), array(), '\phpbb\controller\exception', 'CONTROLLER_ARGUMENT_VALUE_MISSING'), + array('', array(), array(), '\ReflectionException', 'Function () does not exist'), + array(new phpbb\controller\foo, array(), array(), '\ReflectionException', 'Method __invoke does not exist'), + ); + } + + /** + * @dataProvider data_get_arguments + */ + public function test_get_arguments($input, $expected, $set_attributes = array(), $exception = '', $exception_message = '') + { + $container = $this->get_foo_container(); + + $resolver = new \phpbb\controller\resolver($container, dirname(__FILE__) . '/'); + $symfony_request = new Request(); + + foreach ($set_attributes as $name => $value) + { + $symfony_request->attributes->set($name, $value); + } + + if (!empty($exception)) + { + $this->setExpectedException($exception, $exception_message); + } + + $this->assertEquals($expected, $resolver->getArguments($symfony_request, $input)); } } diff --git a/tests/controller/ext/vendor2/foo/controller.php b/tests/controller/ext/vendor2/foo/controller.php index ce2233b3c9..cabcae042b 100644 --- a/tests/controller/ext/vendor2/foo/controller.php +++ b/tests/controller/ext/vendor2/foo/controller.php @@ -11,8 +11,23 @@ class controller * * @return null */ - public function handle() + public function handle($optional = 'foo') { return new Response('Test', 200); } + + public function handle2($foo = 'foo', $very_optional = 0) + { + return new Response('Test2', 200); + } + + public function handle_fail($no_default) + { + return new Response('Test_fail', 200); + } + + public function __invoke() + { + $this->handle(); + } } diff --git a/tests/text_processing/tickets_data/PHPBB3-14260.html b/tests/text_processing/tickets_data/PHPBB3-14260.html new file mode 100644 index 0000000000..c7e7cad237 --- /dev/null +++ b/tests/text_processing/tickets_data/PHPBB3-14260.html @@ -0,0 +1 @@ +<a href="http://example.org/article/S0883-9441%2811%290483-7/pdf" class="postlink">http://example.org/article/S0883-9441(11)0483-7/pdf</a>
\ No newline at end of file diff --git a/tests/text_processing/tickets_data/PHPBB3-14260.txt b/tests/text_processing/tickets_data/PHPBB3-14260.txt new file mode 100644 index 0000000000..f95523c00e --- /dev/null +++ b/tests/text_processing/tickets_data/PHPBB3-14260.txt @@ -0,0 +1 @@ +http://example.org/article/S0883-9441(11)0483-7/pdf
\ No newline at end of file |