diff options
48 files changed, 795 insertions, 397 deletions
diff --git a/build/build.xml b/build/build.xml index b7e5e3e194..5b2a4ed3e5 100644 --- a/build/build.xml +++ b/build/build.xml @@ -4,7 +4,7 @@ <!-- a few settings for the build --> <property name="newversion" value="3.3.0-RC2-dev" /> <property name="prevversion" value="3.2.8" /> - <property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.3.0-b1, 3.3.0-b2, 3.3.0-RC1" /> + <property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1, 3.2.0-b2, 3.2.0-RC1, 3.2.0-RC2, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.9-RC1, 3.3.0-b1, 3.3.0-b2, 3.3.0-RC1" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/build/sami-all.conf.php b/build/sami-all.conf.php index 4bf812eb02..91f12f296e 100644 --- a/build/sami-all.conf.php +++ b/build/sami-all.conf.php @@ -26,6 +26,7 @@ $config['versions'] = Sami\Version\GitVersionCollection::create(__DIR__ . '/../' ->add('3.0.x') ->add('3.1.x') ->add('3.2.x') + ->add('3.3.x') ->add('master') ; diff --git a/build/sami-checkout.conf.php b/build/sami-checkout.conf.php index abbf1d257e..69d13d07c3 100644 --- a/build/sami-checkout.conf.php +++ b/build/sami-checkout.conf.php @@ -32,7 +32,7 @@ $iterator = Symfony\Component\Finder\Finder::create() ; $config = array( - 'theme' => 'enhanced', + 'theme' => 'default', 'title' => 'phpBB API Documentation', 'build_dir' => __DIR__.'/api/output/%version%', 'cache_dir' => __DIR__.'/api/cache/%version%', diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index ce55d81375..b8d337cfd8 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -95,112 +95,116 @@ <!-- EVENT acp_main_notice_after --> <div class="lside"> - <table class="table1 zebra-table no-header" data-no-responsive-header="true"> + <table class="table2 zebra-table no-header" data-no-responsive-header="true"> <thead> <tr> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> + <th>{{ lang('STATISTIC') }}</th> + <th>{{ lang('VALUE') }}</th> </tr> </thead> + <tbody> <tr> - <td class="tabled">{L_NUMBER_POSTS}{L_COLON}</td> - <td class="tabled"><strong>{TOTAL_POSTS}</strong></td> + <td class="tabled">{{ lang('BOARD_STARTED') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ START_DATE }}</strong></td> </tr> <tr> - <td class="tabled">{L_POSTS_PER_DAY}{L_COLON}</td> - <td class="tabled"><strong>{POSTS_PER_DAY}</strong></td> + <td class="tabled">{{ lang('AVATAR_DIR_SIZE') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ AVATAR_DIR_SIZE }}</strong></td> </tr> <tr> - <td class="tabled">{L_NUMBER_TOPICS}{L_COLON}</td> - <td class="tabled"><strong>{TOTAL_TOPICS}</strong></td> + <td class="tabled">{{ lang('DATABASE_SIZE') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ DBSIZE }}</strong></td> </tr> <tr> - <td class="tabled">{L_TOPICS_PER_DAY}{L_COLON}</td> - <td class="tabled"><strong>{TOPICS_PER_DAY}</strong></td> + <td class="tabled">{{ lang('UPLOAD_DIR_SIZE') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ UPLOAD_DIR_SIZE }}</strong></td> </tr> <tr> - <td class="tabled">{L_NUMBER_USERS}{L_COLON}</td> - <td class="tabled"><strong>{TOTAL_USERS}</strong></td> + <td class="tabled">{{ lang('DATABASE_SERVER_INFO') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ DATABASE_INFO }}</strong></td> </tr> <tr> - <td class="tabled">{L_USERS_PER_DAY}{L_COLON}</td> - <td class="tabled"><strong>{USERS_PER_DAY}</strong></td> + <td class="tabled">{{ lang('GZIP_COMPRESSION') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ GZIP_COMPRESSION }}</strong></td> </tr> <tr> - <td class="tabled">{L_NUMBER_FILES}{L_COLON}</td> - <td class="tabled"><strong>{TOTAL_FILES}</strong></td> + <td class="tabled">{{ lang('PHP_VERSION') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ PHP_VERSION_INFO }}</strong></td> </tr> <tr> - <td class="tabled">{L_FILES_PER_DAY}{L_COLON}</td> - <td class="tabled"><strong>{FILES_PER_DAY}</strong></td> + {% if S_TOTAL_ORPHAN %} + <td class="tabled">{{ lang('NUMBER_ORPHAN') ~ lang('COLON') }}</td> + <td class="tabled"> + {% if TOTAL_ORPHAN > 0 %} + <a href="{{ U_ATTACH_ORPHAN }}" title="{{ lang('MORE_INFORMATION') }}"><strong>{{ TOTAL_ORPHAN }}</strong></a> + {% else %} + <strong>{{ TOTAL_ORPHAN }}</strong> + {% endif %} + </td> + {% else %} + {% endif %} </tr> + {% if S_VERSIONCHECK %} <tr> - <td class="tabled"> </td> - <td class="tabled"> </td> + <td class="tabled">{{ lang('BOARD_VERSION') ~ lang('COLON') }}</td> + <td class="tabled"> + <strong><a href="{{ U_VERSIONCHECK }}" {% if S_VERSION_UP_TO_DATE %}style="color: #228822;" {% elseif not S_VERSIONCHECK_FAIL %}style="color: #BC2A4D;" {% endif %}title="{{ lang('MORE_INFORMATION') }}">{{ BOARD_VERSION }}</a></strong> [ <a href="{{ U_VERSIONCHECK_FORCE }}">{{ lang('VERSIONCHECK_FORCE_UPDATE') }}</a> ] + </td> </tr> + {% endif %} </tbody> </table> - <table class="table1 zebra-table no-header" data-no-responsive-header="true"> + + <table class="table2 zebra-table no-header" data-no-responsive-header="true"> <thead> <tr> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> + <th>{{ lang('STATISTIC') }}</th> + <th>{{ lang('VALUE') }}</th> </tr> </thead> + <tbody> <tr> - <td class="tabled">{L_BOARD_STARTED}{L_COLON}</td> - <td class="tabled"><strong>{START_DATE}</strong></td> + <td class="tabled">{{ lang('NUMBER_POSTS') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ TOTAL_POSTS }}</strong></td> </tr> <tr> - <td class="tabled">{L_AVATAR_DIR_SIZE}{L_COLON}</td> - <td class="tabled"><strong>{AVATAR_DIR_SIZE}</strong></td> + <td class="tabled">{{ lang('POSTS_PER_DAY') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ POSTS_PER_DAY }}</strong></td> </tr> <tr> - <td class="tabled">{L_DATABASE_SIZE}{L_COLON}</td> - <td class="tabled"><strong>{DBSIZE}</strong></td> + <td class="tabled">{{ lang('NUMBER_TOPICS') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ TOTAL_TOPICS }}</strong></td> </tr> <tr> - <td class="tabled">{L_UPLOAD_DIR_SIZE}{L_COLON}</td> - <td class="tabled"><strong>{UPLOAD_DIR_SIZE}</strong></td> + <td class="tabled">{{ lang('TOPICS_PER_DAY') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ TOPICS_PER_DAY }}</strong></td> </tr> <tr> - <td class="tabled">{L_DATABASE_SERVER_INFO}{L_COLON}</td> - <td class="tabled"><strong>{DATABASE_INFO}</strong></td> + <td class="tabled">{{ lang('NUMBER_USERS') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ TOTAL_USERS }}</strong></td> </tr> <tr> - <td class="tabled">{L_GZIP_COMPRESSION}{L_COLON}</td> - <td class="tabled"><strong>{GZIP_COMPRESSION}</strong></td> + <td class="tabled">{{ lang('USERS_PER_DAY') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ USERS_PER_DAY }}</strong></td> </tr> <tr> - <td class="tabled">{L_PHP_VERSION}{L_COLON}</td> - <td class="tabled"><strong>{PHP_VERSION_INFO}</strong></td> + <td class="tabled">{{ lang('NUMBER_FILES') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ TOTAL_FILES }}</strong></td> </tr> <tr> - <!-- IF S_TOTAL_ORPHAN --> - <td class="tabled">{L_NUMBER_ORPHAN}{L_COLON}</td> - <td class="tabled"> - <!-- IF TOTAL_ORPHAN > 0 --> - <a href="{U_ATTACH_ORPHAN}" title="{L_MORE_INFORMATION}"><strong>{TOTAL_ORPHAN}</strong></a> - <!-- ELSE --> - <strong>{TOTAL_ORPHAN}</strong> - <!-- ENDIF --> - </td> - <!-- ELSE --> - <!-- ENDIF --> + <td class="tabled">{{ lang('FILES_PER_DAY') ~ lang('COLON') }}</td> + <td class="tabled"><strong>{{ FILES_PER_DAY }}</strong></td> </tr> - <!-- IF S_VERSIONCHECK --> <tr> - <td class="tabled">{L_BOARD_VERSION}{L_COLON}</td> - <td class="tabled"> - <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;" <!-- ELSEIF not S_VERSIONCHECK_FAIL -->style="color: #BC2A4D;" <!-- ENDIF -->title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [ <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> ] - </td> + <td class="tabled"> </td> + <td class="tabled"> </td> </tr> - <!-- ENDIF --> </tbody> </table> </div> + <!-- IF S_ACTION_OPTIONS --> <fieldset> <legend>{L_STATISTIC_RESYNC_OPTIONS}</legend> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index a44de6561e..3243d0eb24 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -728,8 +728,20 @@ td { border-collapse: separate; } +.table2 { + display: inline-block; + border-spacing: 1px; + border-collapse: separate; +} + +.lside { + display: flex; + align-items: stretch; + width: 100%; +} + .tabled { - width: 25%; + width: 1%; } dt#color_palette_placeholder table { diff --git a/phpBB/composer.json b/phpBB/composer.json index c047c225a2..57c7d7452d 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -25,7 +25,7 @@ "phpbb/phpbb-core": "self.version" }, "require": { - "php": ">=7.1", + "php": "^7.1.3", "ext-json": "*", "bantu/ini-get-wrapper": "~1.0", "google/recaptcha": "~1.1", @@ -43,6 +43,7 @@ "symfony/finder": "~3.4", "symfony/http-foundation": "~3.4", "symfony/http-kernel": "~3.4", + "symfony/process": "^3.4", "symfony/proxy-manager-bridge": "~3.4", "symfony/routing": "~3.4", "symfony/twig-bridge": "~3.4", @@ -59,7 +60,8 @@ "squizlabs/php_codesniffer": "~3.4", "symfony/browser-kit": "~3.4", "symfony/css-selector": "~3.4", - "symfony/dom-crawler": "~3.4" + "symfony/dom-crawler": "~3.4", + "sami/sami": "^4.1" }, "extra": { "branch-alias": { @@ -68,7 +70,7 @@ }, "config": { "platform": { - "php": "7.1" + "php": "7.1.3" } } } diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 7529a9e883..272c0fb9da 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b31f688c19bfc55c9a6f4c388c885301", + "content-hash": "bbbc187ca0c5d8f13e6358d529412446", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -85,16 +85,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.0", + "version": "6.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", "shasum": "" }, "require": { @@ -148,7 +148,7 @@ "rest", "web service" ], - "time": "2019-12-07T18:20:45+00:00" + "time": "2019-12-23T11:57:10+00:00" }, { "name": "guzzlehttp/promises", @@ -848,16 +848,16 @@ }, { "name": "s9e/text-formatter", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "26d6ee3a931a25acfea3096f62f0cc42172f3859" + "reference": "65a0605f163b8ffcf7145357f167b153f31cd168" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/26d6ee3a931a25acfea3096f62f0cc42172f3859", - "reference": "26d6ee3a931a25acfea3096f62f0cc42172f3859", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/65a0605f163b8ffcf7145357f167b153f31cd168", + "reference": "65a0605f163b8ffcf7145357f167b153f31cd168", "shasum": "" }, "require": { @@ -882,7 +882,7 @@ }, "type": "library", "extra": { - "version": "2.3.0" + "version": "2.3.1" }, "autoload": { "psr-4": { @@ -912,7 +912,7 @@ "parser", "shortcodes" ], - "time": "2019-11-17T16:03:56+00:00" + "time": "2019-12-26T19:14:01+00:00" }, { "name": "symfony/config", @@ -1768,6 +1768,55 @@ "time": "2019-11-27T13:56:44+00:00" }, { + "name": "symfony/process", + "version": "v3.4.36", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "9a4545c01e1e4f473492bd52b71e574dcc401ca2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/9a4545c01e1e4f473492bd52b71e574dcc401ca2", + "reference": "9a4545c01e1e4f473492bd52b71e574dcc401ca2", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-11-28T10:05:51+00:00" + }, + { "name": "symfony/proxy-manager-bridge", "version": "v3.4.36", "source": { @@ -2228,6 +2277,120 @@ ], "packages-dev": [ { + "name": "blackfire/php-sdk", + "version": "v1.21.0", + "source": { + "type": "git", + "url": "https://github.com/blackfireio/php-sdk.git", + "reference": "1aa41771641ac268c5a2a0fc520e0da0e1f6698a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/blackfireio/php-sdk/zipball/1aa41771641ac268c5a2a0fc520e0da0e1f6698a", + "reference": "1aa41771641ac268c5a2a0fc520e0da0e1f6698a", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "php": ">=5.2.0" + }, + "require-dev": { + "symfony/http-client": "^4.3" + }, + "suggest": { + "ext-blackfire": "The C version of the Blackfire probe", + "ext-zlib": "To push config to remote profiling targets" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "files": [ + "src/autostart.php" + ], + "psr-4": { + "Blackfire\\": "src/Blackfire" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Blackfire.io", + "email": "support@blackfire.io" + } + ], + "description": "Blackfire.io PHP SDK", + "keywords": [ + "performance", + "profiler", + "uprofiler", + "xhprof" + ], + "time": "2019-12-05T12:48:12+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.2.5", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2019-12-11T14:44:42+00:00" + }, + { "name": "doctrine/instantiator", "version": "1.3.0", "source": { @@ -2450,17 +2613,66 @@ "time": "2018-12-11T02:04:35+00:00" }, { + "name": "michelf/php-markdown", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/c83178d49e372ca967d1a8c77ae4e051b3a3c75c", + "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": ">=4.3 <5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Michelf\\": "Michelf/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2019-12-02T02:32:27+00:00" + }, + { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", "shasum": "" }, "require": { @@ -2495,7 +2707,58 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2019-12-15T19:12:40+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" }, { "name": "phar-io/manifest", @@ -2693,91 +2956,38 @@ "time": "2018-01-25T13:18:09+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2018-08-07T13:53:10+00:00" - }, - { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "php": ">=5.3.3" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ + "psr-0": { + "phpDocumentor": [ "src/" ] } @@ -2789,88 +2999,40 @@ "authors": [ { "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "email": "mike.vanriel@naenius.com" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "shasum": "" - }, - "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -2903,7 +3065,7 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2019-12-22T21:05:45+00:00" }, { "name": "phpunit/dbunit", @@ -3295,6 +3457,119 @@ "time": "2019-12-06T05:14:37+00:00" }, { + "name": "pimple/pimple", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2018-01-21T07:42:36+00:00" + }, + { + "name": "sami/sami", + "version": "v4.1.2", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Sami.git", + "reference": "19b8a82b858bd31544c468317c8307188ccb4022" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/19b8a82b858bd31544c468317c8307188ccb4022", + "reference": "19b8a82b858bd31544c468317c8307188ccb4022", + "shasum": "" + }, + "require": { + "blackfire/php-sdk": "^1.5.18", + "michelf/php-markdown": "~1.3", + "nikic/php-parser": "~3.0", + "php": "^7.1.3", + "phpdocumentor/reflection-docblock": "~2.0", + "pimple/pimple": "~3.0", + "symfony/console": "~3.0|~4.0", + "symfony/filesystem": "~3.0|~4.0", + "symfony/finder": "~3.0|~4.0", + "symfony/process": "~3.0|~4.0", + "symfony/yaml": "~3.0|~4.0", + "twig/twig": "~2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "~4.0" + }, + "bin": [ + "sami.php" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Sami\\": "Sami/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Sami, an API documentation generator", + "homepage": "http://sami.sensiolabs.org", + "keywords": [ + "phpdoc" + ], + "abandoned": true, + "time": "2018-07-02T13:20:39+00:00" + }, + { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", "source": { @@ -4079,55 +4354,6 @@ "time": "2019-10-24T15:33:53+00:00" }, { - "name": "symfony/process", - "version": "v3.4.36", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "9a4545c01e1e4f473492bd52b71e574dcc401ca2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9a4545c01e1e4f473492bd52b71e574dcc401ca2", - "reference": "9a4545c01e1e4f473492bd52b71e574dcc401ca2", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2019-11-28T10:05:51+00:00" - }, - { "name": "theseer/tokenizer", "version": "1.1.3", "source": { @@ -4166,54 +4392,6 @@ ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], @@ -4222,11 +4400,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1", + "php": "^7.1.3", "ext-json": "*" }, "platform-dev": [], "platform-overrides": { - "php": "7.1" + "php": "7.1.3" } } diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8eb9639db3..557fca202f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -53,6 +53,7 @@ <li><a href="#v330b2">Changes since 3.3.0-b2</a></li> <li><a href="#v330b1">Changes since 3.3.0-b1</a></li> <li><a href="#v32x">Changes since 3.2.x</a></li> + <li><a href="#v328">Changes since 3.2.8</a></li> <li><a href="#v328rc1">Changes since 3.2.8-RC1</a></li> <li><a href="#v327">Changes since 3.2.7</a></li> <li><a href="#v326">Changes since 3.2.6</a></li> @@ -305,6 +306,61 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16185">PHPBB3-16185</a>] - Use Xenial build environment on travis-ci</li> </ul> + <a name="v328"></a><h3>Changes since 3.2.8</h3> + <h4>Bug</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14815">PHPBB3-14815</a>] - The facebook page link is not displayed properly in memberlist.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15643">PHPBB3-15643</a>] - $phpbb_filesystem->resolve_path() may trigger open_basedir restriction</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15902">PHPBB3-15902</a>] - Out of range error with Sphinx search</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16056">PHPBB3-16056</a>] - JPEG dimensions undetectable for some kind of jpeg files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16076">PHPBB3-16076</a>] - Limit attachment size by extension group</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16141">PHPBB3-16141</a>] - plupload chunk_size calculation incorrect when one or more settings are 'unlimited'</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16150">PHPBB3-16150</a>] - Post title link urls not reliable when shared</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16156">PHPBB3-16156</a>] - Bots see both register and logout links in the navbar</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16157">PHPBB3-16157</a>] - Incorrect FORM_INVALID error message while sending email form</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16181">PHPBB3-16181</a>] - OAuth provider id needs to be quoted</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16184">PHPBB3-16184</a>] - Mark read button only works once</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16199">PHPBB3-16199</a>] - Guest posting CAPTCHA is being generated with no guest posting auth</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16209">PHPBB3-16209</a>] - Nginx example configuration file blocks an image in the ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16210">PHPBB3-16210</a>] - Terms of use should not be skippable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16211">PHPBB3-16211</a>] - COPPA should not be skippable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16216">PHPBB3-16216</a>] - Disable xdebug in travis builds</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16217">PHPBB3-16217</a>] - Enable opcache in travis CI builds</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16228">PHPBB3-16228</a>] - BBCode definitions with an optional attribute and a non-TEXT content are not merged correctly</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16242">PHPBB3-16242</a>] - Redirect loop when install folder doesn't exist</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16252">PHPBB3-16252</a>] - Ignore non-BBCodes when looking for unauthorized markup</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16257">PHPBB3-16257</a>] - Typo in Email Settings section</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16258">PHPBB3-16258</a>] - Sample Sphinx configuration file causes delta index to only include the most recent post</li> + </ul> + <h4>Improvement</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16084">PHPBB3-16084</a>] - Pointless radio button for database backup in 3.2.7 </li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16139">PHPBB3-16139</a>] - Add core.viewtopic_modify_quick_reply_template_vars</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16140">PHPBB3-16140</a>] - Add new event to UCP Edit Profile Page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16143">PHPBB3-16143</a>] - Add core events for move topics</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16144">PHPBB3-16144</a>] - NO_STYLE_DATA - Provide extra fallback to board's default style for $user.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16146">PHPBB3-16146</a>] - Add core event for after move the forum</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16148">PHPBB3-16148</a>] - Add template events to acp_groups.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16151">PHPBB3-16151</a>] - Enable Emojis and rich text in forum name</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16153">PHPBB3-16153</a>] - Enable Emojis and rich text in topic title</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16159">PHPBB3-16159</a>] - Wrap post times in html time tag</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16174">PHPBB3-16174</a>] - Event for disabling cookie creation</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16182">PHPBB3-16182</a>] - Add core.generate_smilies_modify_rowset</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16183">PHPBB3-16183</a>] - Add core.generate_smilies_count_sql_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16203">PHPBB3-16203</a>] - Enable Emojis and rich text in sent Emails</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16247">PHPBB3-16247</a>] - Quote PM has no identifier</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16251">PHPBB3-16251</a>] - Shortened link text shouldn't override custom plugins</li> + </ul> + <h4>Task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-15422">PHPBB3-15422</a>] - Remove the unnecessary helpline function and help_line variable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16147">PHPBB3-16147</a>] - Updated tokens legend in BBCodes ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16160">PHPBB3-16160</a>] - Add script for generating package json file</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16172">PHPBB3-16172</a>] - Add "Rank:" or "Group rank:" in the memberlist</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16224">PHPBB3-16224</a>] - Update composer dependencies</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-16246">PHPBB3-16246</a>] - Prettify and update README Automated Testing section</li> + </ul> + <a name="v328rc1"></a><h3>Changes since 3.2.8-RC1</h3> <h4>Bug</h4> <ul> diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index 848998cfeb..c5a9472a1c 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -70,7 +70,7 @@ http { } # Deny access to internal phpbb files. - location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) { + location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb(?!\w+)|store|vendor) { deny all; # deny was ignored before 0.8.40 for connections over IPv6. # Use internal directive to prohibit access on older versions. diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 84dbbf02ba..5e39055f50 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -207,7 +207,10 @@ class acp_bbcodes $db->sql_freeresult($result); // Grab the end, interrogate the last closing tag - if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded))) + if (isset($info['test']) && $info['test'] === '1' + || in_array(strtolower($data['bbcode_tag']), $hard_coded) + || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)) + ) { trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING); } diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 2441a37edc..cd72a8748a 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -530,13 +530,16 @@ class acp_board if ($submit) { - if (strpos($data['type'], 'password') === 0 && $config_value === '********') + if (isset($data['type']) && strpos($data['type'], 'password') === 0 && $config_value === '********') { - // Do not update password fields if the content is ********, - // because that is the password replacement we use to not - // send the password to the output + /** + * Do not update password fields if the content is ********, + * because that is the password replacement we use to not + * send the password to the output + */ continue; } + $config->set($config_name, $config_value); if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable'])) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index c31b63a403..21c630d495 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -44,7 +44,7 @@ class bbcode /** * Init bbcode cache entries if bitfield is specified * - * @param string $bbcode_bitfield The bbcode bitfield + * @param string $bitfield The bbcode bitfield */ function bbcode_set_bitfield($bitfield = '') { diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 510d98ec11..e90c11f884 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -445,7 +445,7 @@ class p_master break; default: - if (!preg_match('#(?:' . implode(array_keys($valid_tokens), ')|(?:') . ')#', $token)) + if (!preg_match('#(?:' . implode(')|(?:', array_keys($valid_tokens)) . ')#', $token)) { $token = ''; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e1c28223dc..d6214c4614 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -46,6 +46,7 @@ class bbcode_firstpass extends bbcode var $message = ''; var $warn_msg = array(); var $parsed_items = array(); + var $mode; /** * Parse BBCode @@ -1128,8 +1129,6 @@ class parse_message extends bbcode_firstpass var $allow_quote_bbcode = true; var $allow_url_bbcode = true; - var $mode; - /** * The plupload object used for dealing with attachments * @var \phpbb\plupload\plupload diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index cb9013805d..a01a4f1bd1 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -592,7 +592,7 @@ $lang = array_merge($lang, array( 'SMTP_PORT' => 'SMTP server port', 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', 'SMTP_SERVER' => 'SMTP server address', - 'SMTP_SERVER_EXPLAIN' => 'Do not provide a protocol (<samp>ssl://</samp> or <samp>tsl://</samp>) unless your mail host tells you to do so.', + 'SMTP_SERVER_EXPLAIN' => 'Do not provide a protocol (<samp>ssl://</samp> or <samp>tls://</samp>) unless your mail host tells you to do so.', 'SMTP_SETTINGS' => 'SMTP settings', 'SMTP_USERNAME' => 'SMTP username', 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 43b58969a5..35c218cd8c 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -656,8 +656,8 @@ switch ($mode) $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); - $foe = ($row['foe']) ? true : false; - $friend = ($row['friend']) ? true : false; + $foe = (bool) $row['foe'] ?? false; + $friend = (bool) $row['friend'] ?? false; $db->sql_freeresult($result); if ($config['load_onlinetrack']) @@ -670,7 +670,7 @@ switch ($mode) $db->sql_freeresult($result); $member['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0; - $member['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0; + $member['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0; unset($row); } diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index 6a78136e5f..43699f7d6e 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -40,8 +40,8 @@ class ldap extends base /** * LDAP Authentication Constructor * - * @param driver_interface $db DBAL driver interface * @param config $config Config object + * @param driver_interface $db DBAL driver interface * @param language $language Language object * @param user $user User object */ diff --git a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php index ea9ef43788..239e661989 100644 --- a/phpBB/phpbb/auth/provider/oauth/service/service_interface.php +++ b/phpBB/phpbb/auth/provider/oauth/service/service_interface.php @@ -73,8 +73,6 @@ interface service_interface /** * Returns the external library service provider once it has been set - * - * @param \OAuth\Common\Service\ServiceInterface|null */ public function get_external_service_provider(); diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index efc4f5ec0f..b16549ffb7 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -49,6 +49,8 @@ class remote extends \phpbb\avatar\driver\driver */ public function process_form($request, $template, $user, $row, &$error) { + global $phpbb_dispatcher; + $url = $request->variable('avatar_remote_url', ''); $width = $request->variable('avatar_remote_width', 0); $height = $request->variable('avatar_remote_height', 0); @@ -84,6 +86,24 @@ class remote extends \phpbb\avatar\driver\driver return false; } + /** + * Event to make custom validation of avatar upload + * + * @event core.ucp_profile_avatar_upload_validation + * @var string url Image url + * @var string width Image width + * @var string height Image height + * @var array error Error message array + * @since 3.2.9-RC1 + */ + $vars = array('url', 'width', 'height', 'error'); + extract($phpbb_dispatcher->trigger_event('core.ucp_profile_avatar_upload_validation', compact($vars))); + + if (!empty($error)) + { + return false; + } + // Check if this url looks alright // Do not allow specifying the port (see RFC 3986) or IP addresses if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.('. implode('|', $this->allowed_extensions) . ')$#i', $url) || diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index df8bcf44f9..511c6bc01b 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -145,9 +145,11 @@ class run extends \phpbb\console\command\command * and returns with status 2. * * @see execute - * @param string $task_name The name of the task that should be run. + * * @param InputInterface $input The input stream used to get the argument and verbose option. * @param OutputInterface $output The output stream, used for printing verbose-mode and error information. + * @param string $task_name The name of the task that should be run. + * * @return int 0 if all is well, 2 if no task matches $task_name. */ protected function run_one(InputInterface $input, OutputInterface $output, $task_name) diff --git a/phpBB/phpbb/console/command/update/check.php b/phpBB/phpbb/console/command/update/check.php index 85c6cf7379..4cd7d2155c 100644 --- a/phpBB/phpbb/console/command/update/check.php +++ b/phpBB/phpbb/console/command/update/check.php @@ -223,6 +223,7 @@ class check extends \phpbb\console\command\command * Check if all the available extensions are up to date * * @param SymfonyStyle $io IO handler, for formatted and unified IO + * @param string $stability Stability specifier string * @param bool $recheck Disallow the use of the cache * @return int */ diff --git a/phpBB/phpbb/db/migration/data/v32x/v329rc1.php b/phpBB/phpbb/db/migration/data/v32x/v329rc1.php new file mode 100644 index 0000000000..271bf62859 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v329rc1.php @@ -0,0 +1,36 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v329rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.9-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v328', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.9-RC1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php index dc43678625..8ac8f4ed72 100644 --- a/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php +++ b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php @@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v330; class remove_email_hash extends \phpbb\db\migration\migration { + static public function depends_on() + { + return ['\phpbb\db\migration\data\v30x\release_3_0_0']; + } + public function update_schema() { return [ diff --git a/phpBB/phpbb/install/module_base.php b/phpBB/phpbb/install/module_base.php index 93c10bd656..4464a89716 100644 --- a/phpBB/phpbb/install/module_base.php +++ b/phpBB/phpbb/install/module_base.php @@ -131,7 +131,7 @@ abstract class module_base implements module_interface $name, )); - $this->install_config->increment_current_task_progress($this->task_step_count[$name]); + $this->install_config->increment_current_task_progress($this->task_step_count[$name] ?? false); } else { diff --git a/phpBB/phpbb/language/language_file_loader.php b/phpBB/phpbb/language/language_file_loader.php index b6816afd16..2910dd3c4a 100644 --- a/phpBB/phpbb/language/language_file_loader.php +++ b/phpBB/phpbb/language/language_file_loader.php @@ -151,6 +151,7 @@ class language_file_loader * * @param string $path Path to language directory * @param string $filename Filename to load language strings from + * @param array $locales Array containing language fallback options * * @return string Relative path to language file * diff --git a/phpBB/phpbb/passwords/driver/argon2i.php b/phpBB/phpbb/passwords/driver/argon2i.php index 49d7d6393e..bf4d6ec33a 100644 --- a/phpBB/phpbb/passwords/driver/argon2i.php +++ b/phpBB/phpbb/passwords/driver/argon2i.php @@ -37,10 +37,23 @@ class argon2i extends base_native { parent::__construct($config, $helper); - // Don't allow cost factors to be below default settings - $this->memory_cost = max($memory_cost, 1024); - $this->threads = max($threads, 2); - $this->time_cost = max($time_cost, 2); + // Workaround to prevent "Use of undefined constant" warning on some unsupported PHP installations + if (!defined('PASSWORD_ARGON2I')) + { + define('PASSWORD_ARGON2_DEFAULT_MEMORY_COST', 1024); + define('PASSWORD_ARGON2_DEFAULT_TIME_COST', 2); + define('PASSWORD_ARGON2_DEFAULT_THREADS', 1); + } + + /** + * For Sodium implementation of argon2 algorithm (since PHP 7.4), set special value of 1 for "threads" cost factor + * See https://wiki.php.net/rfc/sodium.argon.hash and PHPBB3-16266 + * Don't allow cost factors to be below default settings where possible + */ + $this->memory_cost = max($memory_cost, PASSWORD_ARGON2_DEFAULT_MEMORY_COST); + $this->time_cost = max($time_cost, PASSWORD_ARGON2_DEFAULT_TIME_COST); + $this->threads = (defined('PASSWORD_ARGON2_PROVIDER') && PASSWORD_ARGON2_PROVIDER == 'sodium') ? + PASSWORD_ARGON2_DEFAULT_THREADS : max($threads, PASSWORD_ARGON2_DEFAULT_THREADS); } /** diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 5a5b8a1874..80d7e914db 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -325,6 +325,8 @@ class plupload * by PHP and actually exists, if not, it generates an error * * @param string $form_name The name of the file in the form data + * @param int $chunk Chunk number + * @param string $file_path File path * * @return null */ diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index 5c30f9b062..4d7bc9ea48 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -268,7 +268,7 @@ class request implements \phpbb\request\request_interface * whatever). * * @param string|array $var_name See \phpbb\request\request_interface::variable - * @param mixed $Default See \phpbb\request\request_interface::variable + * @param mixed $default See \phpbb\request\request_interface::variable * * @return mixed The server variable value. */ diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php index 54dd8cef15..a1fbf0ae45 100644 --- a/phpBB/phpbb/request/request_interface.php +++ b/phpBB/phpbb/request/request_interface.php @@ -104,7 +104,7 @@ interface request_interface * * @return mixed The header value. */ - public function header($var_name, $default = ''); + public function header($header_name, $default = ''); /** * Checks whether a certain variable was sent via POST. diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php index 8bdc31e128..42ac6eaba2 100644 --- a/phpBB/phpbb/search/fulltext_mysql.php +++ b/phpBB/phpbb/search/fulltext_mysql.php @@ -83,7 +83,7 @@ class fulltext_mysql extends \phpbb\search\base * @param string $phpEx PHP file extension * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\config\config $config Config object - * @param \phpbb\db\driver\driver_interface Database object + * @param \phpbb\db\driver\driver_interface $db Database object * @param \phpbb\user $user User object * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object */ diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index cb0c98baa6..23460d3381 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -109,6 +109,12 @@ class fulltext_native extends \phpbb\search\base * Initialises the fulltext_native search backend with min/max word length * * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure + * @param string $phpbb_root_path phpBB root path + * @param string $phpEx PHP file extension + * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config Config object + * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\user $user User object * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object */ public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher) diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 6230f92da3..f7dcd5d937 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -644,7 +644,7 @@ class fulltext_sphinx $this->sphinx->SetFilter('deleted', array(0)); - $this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES); + $this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page)); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('"', '"', $this->search_query)), $this->indexes); // Could be connection to localhost:9312 failed (errno=111, @@ -675,7 +675,7 @@ class fulltext_sphinx { $start = floor(($result_count - 1) / $per_page) * $per_page; - $this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES); + $this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page)); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('"', '"', $this->search_query)), $this->indexes); // Could be connection to localhost:9312 failed (errno=111, diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index ebc97c204a..0f9169ff8b 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -109,61 +109,61 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case ->will($this->returnValue('example')); $expected = array( - 'user_id' => '1', - 'user_type' => '0', - 'group_id' => '3', + 'user_id' => 1, + 'user_type' => 0, + 'group_id' => 3, 'user_permissions' => '', - 'user_perm_from' => '0', + 'user_perm_from' => 0, 'user_ip' => '', - 'user_regdate' => '0', + 'user_regdate' => 0, 'username' => 'foobar', 'username_clean' => 'foobar', 'user_password' => '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i', - 'user_passchg' => '0', + 'user_passchg' => 0, 'user_email' => 'example@example.com', 'user_birthday' => '', - 'user_lastvisit' => '0', - 'user_lastmark' => '0', - 'user_lastpost_time' => '0', + 'user_lastvisit' => 0, + 'user_lastmark' => 0, + 'user_lastpost_time' => 0, 'user_lastpage' => '', 'user_last_confirm_key' => '', - 'user_last_search' => '0', - 'user_warnings' => '0', - 'user_last_warning' => '0', - 'user_login_attempts' => '0', - 'user_inactive_reason' => '0', - 'user_inactive_time' => '0', - 'user_posts' => '0', + 'user_last_search' => 0, + 'user_warnings' => 0, + 'user_last_warning' => 0, + 'user_login_attempts' => 0, + 'user_inactive_reason' => 0, + 'user_inactive_time' => 0, + 'user_posts' => 0, 'user_lang' => '', 'user_timezone' => '', 'user_dateformat' => 'd M Y H:i', - 'user_style' => '0', - 'user_rank' => '0', + 'user_style' => 0, + 'user_rank' => 0, 'user_colour' => '', - 'user_new_privmsg' => '0', - 'user_unread_privmsg' => '0', - 'user_last_privmsg' => '0', - 'user_message_rules' => '0', - 'user_full_folder' => '-3', - 'user_emailtime' => '0', - 'user_topic_show_days' => '0', + 'user_new_privmsg' => 0, + 'user_unread_privmsg' => 0, + 'user_last_privmsg' => 0, + 'user_message_rules' => 0, + 'user_full_folder' => -3, + 'user_emailtime' => 0, + 'user_topic_show_days' => 0, 'user_topic_sortby_type' => 't', 'user_topic_sortby_dir' => 'd', - 'user_post_show_days' => '0', + 'user_post_show_days' => 0, 'user_post_sortby_type' => 't', 'user_post_sortby_dir' => 'a', - 'user_notify' => '0', - 'user_notify_pm' => '1', - 'user_notify_type' => '0', - 'user_allow_pm' => '1', - 'user_allow_viewonline' => '1', - 'user_allow_viewemail' => '1', - 'user_allow_massemail' => '1', - 'user_options' => '230271', + 'user_notify' => 0, + 'user_notify_pm' => 1, + 'user_notify_type' => 0, + 'user_allow_pm' => 1, + 'user_allow_viewonline' => 1, + 'user_allow_viewemail' => 1, + 'user_allow_massemail' => 1, + 'user_options' => 230271, 'user_avatar' => '', 'user_avatar_type' => '', - 'user_avatar_width' => '0', - 'user_avatar_height' => '0', + 'user_avatar_width' => 0, + 'user_avatar_height' => 0, 'user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => '', @@ -171,11 +171,11 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_actkey' => '', 'user_newpasswd' => '', 'user_form_salt' => '', - 'user_new' => '1', - 'user_reminded' => '0', - 'user_reminded_time' => '0', + 'user_new' => 1, + 'user_reminded' => 0, + 'user_reminded_time' => 0, 'reset_token' => '', - 'reset_token_expiration' => '0', + 'reset_token_expiration' => 0, ); $this->assertEquals($expected, $this->provider->autologin()); diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php index b569d371f1..6e1fad9ad1 100644 --- a/tests/bbcode/parser_test.php +++ b/tests/bbcode/parser_test.php @@ -255,6 +255,7 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case $symfony_request = new \phpbb\symfony_request($request); $bbcode = new bbcode_firstpass(); + $bbcode->mode = 'post'; $bbcode->message = $message; $bbcode->bbcode_init(false); $bbcode->parse_bbcode(); diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index 2744bf132c..8402f9dd3e 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -122,6 +122,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case public function test_no_task() { + global $phpbb_root_path, $phpEx; + $tasks = array( ); @@ -163,6 +165,8 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case public function test_no_task_verbose() { + global $phpbb_root_path, $phpEx; + $tasks = array( ); diff --git a/tests/console/user/base.php b/tests/console/user/base.php index b845ab1639..74f04cf686 100644 --- a/tests/console/user/base.php +++ b/tests/console/user/base.php @@ -112,7 +112,8 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); - return $row['user_id']; + $user_id = $row ? $row['user_id'] : null; + return $user_id; } public function getInputStream($input) diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php index 4f978219c2..1c1796a1fc 100644 --- a/tests/content_visibility/delete_post_test.php +++ b/tests/content_visibility/delete_post_test.php @@ -287,7 +287,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case */ public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum, $expected_user) { - global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx; + global $auth, $cache, $config, $db, $user, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx; $config = new \phpbb\config\config(array( 'num_posts' => 3, diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 447c10d10e..bdaf8ee682 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -74,7 +74,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case protected function generate_route_objects() { - global $request; + global $request, $phpbb_root_path, $phpEx; $this->request = new phpbb_mock_request(); $this->request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER); diff --git a/tests/files/types_base_test.php b/tests/files/types_base_test.php index a5533f2bc0..28c5a12c3d 100644 --- a/tests/files/types_base_test.php +++ b/tests/files/types_base_test.php @@ -79,6 +79,7 @@ class phpbb_files_types_base_test extends phpbb_test_case $php_ini->expects($this->any()) ->method('getString') ->willReturn($max_filesize); + $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $php_ini, $this->request); $type_form = new \phpbb\files\types\local($this->factory, $this->language, $php_ini, $this->request); $file = $this->getMockBuilder('\phpbb\files\filespec') ->disableOriginalConstructor() @@ -86,6 +87,7 @@ class phpbb_files_types_base_test extends phpbb_test_case $file->expects($this->any()) ->method('get') ->willReturn($filename); + $type_form->set_upload($upload); $type_form->check_upload_size($file); $this->assertSame($expected, $file->error); diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php index f740decab8..e6929b1549 100644 --- a/tests/functions/obtain_online_test.php +++ b/tests/functions/obtain_online_test.php @@ -161,6 +161,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case global $config, $user, $auth, $phpbb_dispatcher; $config['load_online_guests'] = $display_guests; $user = new phpbb_mock_lang(); + $user->data['user_id'] = 100; $user->lang = $this->load_language(); $auth = $this->createMock('\phpbb\auth\auth'); $acl_get_map = array( diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php index 3a4b63b5e8..31837f015b 100644 --- a/tests/functions/validate_username_test.php +++ b/tests/functions/validate_username_test.php @@ -130,11 +130,13 @@ class phpbb_functions_validate_data_test extends phpbb_database_test_case */ public function test_validate_username($allow_name_chars, $expected) { - global $cache, $config, $db; + global $cache, $config, $db, $user; $db = $this->db; $cache = $this->cache; $cache->put('_disallowed_usernames', array('barfoo')); + $user = new phpbb_mock_user(); + $user->data['username_clean'] = 'username'; $config['allow_name_chars'] = $allow_name_chars; diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php index c112a0c368..4a82a0eeb7 100644 --- a/tests/functions_user/delete_user_test.php +++ b/tests/functions_user/delete_user_test.php @@ -23,9 +23,14 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case { parent::setUp(); - global $cache, $config, $db, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path; + global $cache, $config, $db, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx; $db = $this->db = $this->new_dbal(); + + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $lang = new \phpbb\language\language($lang_loader); + $user = new \phpbb\user($lang, '\phpbb\datetime'); + $config = new \phpbb\config\config(array( 'load_online_time' => 5, 'search_type' => '\phpbb\search\fulltext_mysql', @@ -59,16 +64,16 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case array( 'retain', false, array( - array('post_id' => 1, 'poster_id' => ANONYMOUS, 'post_username' => ''), + array('post_id' => 1, 'poster_id' => ANONYMOUS, 'post_username' => 'Guest'), array('post_id' => 2, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'), - array('post_id' => 3, 'poster_id' => ANONYMOUS, 'post_username' => ''), + array('post_id' => 3, 'poster_id' => ANONYMOUS, 'post_username' => 'Guest'), array('post_id' => 4, 'poster_id' => ANONYMOUS, 'post_username' => 'Other'), ), array( array( 'topic_id' => 1, - 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => '', 'topic_first_poster_colour' => '', - 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => '', 'topic_last_poster_colour' => '', + 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Guest', 'topic_first_poster_colour' => '', + 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Guest', 'topic_last_poster_colour' => '', ), array( 'topic_id' => 2, @@ -77,8 +82,8 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case ), array( 'topic_id' => 3, - 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => '', 'topic_first_poster_colour' => '', - 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => '', 'topic_last_poster_colour' => '', + 'topic_poster' => ANONYMOUS, 'topic_first_poster_name' => 'Guest', 'topic_first_poster_colour' => '', + 'topic_last_poster_id' => ANONYMOUS, 'topic_last_poster_name' => 'Guest', 'topic_last_poster_colour' => '', ), array( 'topic_id' => 4, @@ -87,9 +92,9 @@ class phpbb_functions_user_delete_user_test extends phpbb_database_test_case ), ), array( - array('forum_id' => 1, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => '', 'forum_last_poster_colour' => ''), + array('forum_id' => 1, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Guest', 'forum_last_poster_colour' => ''), array('forum_id' => 2, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Other', 'forum_last_poster_colour' => ''), - array('forum_id' => 3, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => '', 'forum_last_poster_colour' => ''), + array('forum_id' => 3, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Guest', 'forum_last_poster_colour' => ''), array('forum_id' => 4, 'forum_last_poster_id' => ANONYMOUS, 'forum_last_poster_name' => 'Other', 'forum_last_poster_colour' => ''), ), ), diff --git a/tests/functions_user/group_user_attributes_test.php b/tests/functions_user/group_user_attributes_test.php index 6968b1cd3a..dd86d23b34 100644 --- a/tests/functions_user/group_user_attributes_test.php +++ b/tests/functions_user/group_user_attributes_test.php @@ -131,6 +131,7 @@ class phpbb_functions_user_group_user_attributes_test extends phpbb_database_tes $user = new phpbb_mock_user; $user->ip = ''; + $user->data['user_id'] = $user_id; $cache = new phpbb_mock_cache; $db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php index 503e2c2fca..fd8a2cb3df 100644 --- a/tests/log/delete_test.php +++ b/tests/log/delete_test.php @@ -22,7 +22,7 @@ class phpbb_log_delete_test extends phpbb_database_test_case protected function setUp(): void { - global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth; + global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth, $user; $db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php index c26644088e..edab371769 100644 --- a/tests/log/function_view_log_test.php +++ b/tests/log/function_view_log_test.php @@ -411,6 +411,8 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 2 => 'plural (%d)', ), ); + $user->session_id = false; + $user->data['user_id'] = 10; $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); diff --git a/tests/migrator/get_callable_from_step_test.php b/tests/migrator/get_callable_from_step_test.php index f08caf3181..b0abb6199c 100644 --- a/tests/migrator/get_callable_from_step_test.php +++ b/tests/migrator/get_callable_from_step_test.php @@ -15,7 +15,7 @@ class get_callable_from_step_test extends phpbb_database_test_case { public function setUp(): void { - global $phpbb_root_path, $php_ext, $table_prefix, $phpbb_log; + global $phpbb_root_path, $php_ext, $table_prefix, $phpbb_log, $user; parent::setUp(); @@ -24,6 +24,7 @@ class get_callable_from_step_test extends phpbb_database_test_case $factory = new \phpbb\db\tools\factory(); $cache_service = $this->getMockBuilder('\phpbb\cache\service')->disableOriginalConstructor()->getMock(); $user = $this->getMockBuilder('\phpbb\user')->disableOriginalConstructor()->getMock(); + $user->ip = '127.0.0.1'; $module_manager = new \phpbb\module\module_manager( $this->getMockBuilder('\phpbb\cache\driver\dummy')->disableOriginalConstructor()->getMock(), $db, diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php index 88257430a7..1349b98953 100644 --- a/tests/migrator/schema_generator_test.php +++ b/tests/migrator/schema_generator_test.php @@ -26,6 +26,8 @@ class schema_generator_test extends phpbb_test_case public function setUp(): void { + global $phpbb_root_path, $phpEx; + parent::setUp(); $this->config = new \phpbb\config\config(array()); @@ -33,6 +35,8 @@ class schema_generator_test extends phpbb_test_case $factory = new \phpbb\db\tools\factory(); $this->db_tools = $factory->get($this->db); $this->table_prefix = 'phpbb_'; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; } protected function get_schema_generator(array $class_names) diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 8300431dfe..fc11ca0bc7 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -21,10 +21,15 @@ class phpbb_passwords_helper_test extends \phpbb_test_case $this->driver_helper = new \phpbb\passwords\driver\helper($config); $phpbb_root_path = dirname(__FILE__) . '/../../phpBB/'; $php_ext = 'php'; + + // Initialize argon2 default options + $this->argon2_default_cost_options = [ + 'memory_cost' => 1024, + 'time_cost' => 2, + 'threads' => 2 + ]; $this->passwords_drivers = array( - 'passwords.driver.argon2i' => new \phpbb\passwords\driver\argon2i($config, $this->driver_helper), - 'passwords.driver.argon2id' => new \phpbb\passwords\driver\argon2id($config, $this->driver_helper), 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $this->driver_helper, 10), 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $this->driver_helper, 10), 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $this->driver_helper), @@ -39,13 +44,26 @@ class phpbb_passwords_helper_test extends \phpbb_test_case ); $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $this->driver_helper, $phpbb_root_path, $php_ext); $this->passwords_drivers['passwords.driver.bcrypt_wcf2'] = new \phpbb\passwords\driver\bcrypt_wcf2($this->passwords_drivers['passwords.driver.bcrypt'], $this->driver_helper); + + $pwhash_supported = function_exists('password_hash') && function_exists('password_needs_rehash') && function_exists('password_verify'); + if (defined('PASSWORD_ARGON2I') && $pwhash_supported) + { + $this->passwords_drivers['passwords.driver.argon2i'] = new \phpbb\passwords\driver\argon2i($config, $this->driver_helper); + $this->argon2_default_cost_options = $this->passwords_drivers['passwords.driver.argon2i']->get_options(); + } + + if (defined('PASSWORD_ARGON2ID') && $pwhash_supported) + { + $this->passwords_drivers['passwords.driver.argon2id'] = new \phpbb\passwords\driver\argon2id($config, $this->driver_helper); + $this->argon2_default_cost_options = $this->passwords_drivers['passwords.driver.argon2id']->get_options(); + } } public function data_helper_encode64() { return array( - array('foobar', 6, 'axqPW3aQ'), - array('foobar', 7, 'axqPW3aQ..'), + array('foobars', 6, 'axqPW3aQ'), + array('foobarss', 7, 'axqPW3aQn/'), array('foobar', 5, 'axqPW34'), ); } @@ -418,20 +436,34 @@ class phpbb_passwords_helper_test extends \phpbb_test_case public function data_needs_rehash() { - return array( + $data_array = [ array('passwords.driver.bcrypt_2y', '$2y$10$somerandomhash', false), array('passwords.driver.bcrypt', '$2a$10$somerandomhash', false), array('passwords.driver.salted_md5', 'foobar', false), array('passwords.driver.bcrypt_2y', '$2y$9$somerandomhash', true), array('passwords.driver.bcrypt', '$2a$04$somerandomhash', true), - array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=2$NEF0S1JSN04yNGQ1UVRKdA$KYGNI9CbjoKh1UEu1PpdlqbuLbveGwkMcwcT2Un9pPM', false), - array('passwords.driver.argon2i', '$argon2i$v=19$m=128,t=2,p=2$M29GUi51QjdKLjIzbC9scQ$6h1gZDqn7JTmVdQ0lJh1x5nyvgO/DaJWUKOFJ0itCJ0', true), - array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=1,p=2$UnFHb2F4NER3M0xWWmxMUQ$u3javvoAZJeIyR1P3eg0tb8VjEeXvQPagqwetonq1NA', true), - array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=1$bm5SeGJ3R3ZRY1A0YXJPNg$v1A9m4sJW+ge0RBtpJ4w9861+J9xkguKBAsZHrG8LQU', true), - array('passwords.driver.argon2id', '$argon2id$v=19$m=1024,t=2,p=2$MXB4OW5sczE5TnFPYkEuYQ$2bxaMIp8+9x37O6v8zkqpBU72ohCibUrtgVZw7vyr5Q', false), - array('passwords.driver.argon2id', '$argon2id$v=19$m=128,t=2,p=2$RWV2VFAuWXk5bTVjbktOLg$Nt7Z7koa25SVRSKr3RKqjwKz26FENDuU+aL1DfMcWRo', true), - array('passwords.driver.argon2id', '$argon2id$v=19$m=1024,t=1,p=2$Rmw5M21IUFZDVEltYU0uTA$GIObGbHV6sOw5OQEtF8z+2ESztT96OWhCk17sUlwLAY', true), - ); + ]; + + if (isset($this->passwords_drivers['passwords.driver.argon2i'])) + { + $data_array = array_merge($data_array, [ + array('passwords.driver.argon2i', '$argon2i$v=19$m=' . $this->argon2_default_cost_options['memory_cost'] . ',t=' . $this->argon2_default_cost_options['time_cost'] . ',p=' . $this->argon2_default_cost_options['threads'] . '$NEF0S1JSN04yNGQ1UVRKdA$KYGNI9CbjoKh1UEu1PpdlqbuLbveGwkMcwcT2Un9pPM', false), + array('passwords.driver.argon2i', '$argon2i$v=19$m=128,t=2,p=2$M29GUi51QjdKLjIzbC9scQ$6h1gZDqn7JTmVdQ0lJh1x5nyvgO/DaJWUKOFJ0itCJ0', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=1,p=2$UnFHb2F4NER3M0xWWmxMUQ$u3javvoAZJeIyR1P3eg0tb8VjEeXvQPagqwetonq1NA', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=1$bm5SeGJ3R3ZRY1A0YXJPNg$v1A9m4sJW+ge0RBtpJ4w9861+J9xkguKBAsZHrG8LQU', true), + ]); + } + + if (isset($this->passwords_drivers['passwords.driver.argon2id'])) + { + $data_array = array_merge($data_array, [ + array('passwords.driver.argon2id', '$argon2id$v=19$m=' . $this->argon2_default_cost_options['memory_cost'] . ',t=' . $this->argon2_default_cost_options['time_cost'] . ',p=' . $this->argon2_default_cost_options['threads'] . '$MXB4OW5sczE5TnFPYkEuYQ$2bxaMIp8+9x37O6v8zkqpBU72ohCibUrtgVZw7vyr5Q', false), + array('passwords.driver.argon2id', '$argon2id$v=19$m=128,t=2,p=2$RWV2VFAuWXk5bTVjbktOLg$Nt7Z7koa25SVRSKr3RKqjwKz26FENDuU+aL1DfMcWRo', true), + array('passwords.driver.argon2id', '$argon2id$v=19$m=1024,t=1,p=2$Rmw5M21IUFZDVEltYU0uTA$GIObGbHV6sOw5OQEtF8z+2ESztT96OWhCk17sUlwLAY', true), + ]); + } + + return $data_array; } /** |
