diff options
86 files changed, 677 insertions, 274 deletions
diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index af9e00a614..7ab2608e13 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -51,7 +51,8 @@ <td><strong title="{enabled.NAME}">{enabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_enabled_name_after --></td> <td style="text-align: center;"> <!-- IF enabled.S_VERSIONCHECK --> - <strong <!-- IF enabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{enabled.META_VERSION}</strong> + <strong class="<!-- IF enabled.S_UP_TO_DATE -->current-ext<!-- ELSE -->outdated-ext<!-- ENDIF -->">{enabled.META_VERSION}</strong> + <!-- IF not enabled.S_UP_TO_DATE --><i class="fa fa-exclamation-circle outdated-ext" aria-hidden="true"></i><!-- ENDIF --> <!-- ELSE --> {enabled.META_VERSION} <!-- ENDIF --> @@ -76,7 +77,8 @@ <td><strong title="{disabled.NAME}">{disabled.META_DISPLAY_NAME}</strong><!-- EVENT acp_ext_list_disabled_name_after --></td> <td style="text-align: center;"> <!-- IF disabled.S_VERSIONCHECK --> - <strong <!-- IF disabled.S_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF -->>{disabled.META_VERSION}</strong> + <strong class="<!-- IF disabled.S_UP_TO_DATE -->current-ext<!-- ELSE -->outdated-ext<!-- ENDIF -->">{disabled.META_VERSION}</strong> + <!-- IF not disabled.S_UP_TO_DATE --><i class="fa fa-exclamation-circle outdated-ext" aria-hidden="true"></i><!-- ENDIF --> <!-- ELSE --> {disabled.META_VERSION} <!-- ENDIF --> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 2322b3da88..41d0ae8d42 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -2506,6 +2506,14 @@ fieldset.permissions .padding { /* Classes for additional tasks ---------------------------------------- */ +.current-ext { + color: #228822; +} + +.outdated-ext { + color: #BC2A4D; +} + .phpinfo { overflow: auto; width: 99%; diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 9345d07dbf..c1bdf26e02 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -346,19 +346,20 @@ }, { "name": "marc1706/fast-image-size", - "version": "v1.1.3", + "version": "v1.1.4", "source": { "type": "git", "url": "https://github.com/marc1706/fast-image-size.git", - "reference": "5f7e8377746524e2b8a49a631c1fc9afeb9d8bee" + "reference": "c4ded0223a4e49ae45a2183a69f6afac5baf7250" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/marc1706/fast-image-size/zipball/5f7e8377746524e2b8a49a631c1fc9afeb9d8bee", - "reference": "5f7e8377746524e2b8a49a631c1fc9afeb9d8bee", + "url": "https://api.github.com/repos/marc1706/fast-image-size/zipball/c4ded0223a4e49ae45a2183a69f6afac5baf7250", + "reference": "c4ded0223a4e49ae45a2183a69f6afac5baf7250", "shasum": "" }, "require": { + "ext-mbstring": "*", "php": ">=5.3.0" }, "require-dev": { @@ -393,7 +394,7 @@ "php", "size" ], - "time": "2017-03-26 12:48:28" + "time": "2017-10-23 18:52:01" }, { "name": "ocramius/proxy-manager", @@ -660,16 +661,16 @@ }, { "name": "s9e/text-formatter", - "version": "0.11.0", + "version": "0.11.2", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "664b3eaf52baaae4d93548f5e20246fa5942b2b9" + "reference": "735a56076e29348d838ce6c2658996daae86718f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/664b3eaf52baaae4d93548f5e20246fa5942b2b9", - "reference": "664b3eaf52baaae4d93548f5e20246fa5942b2b9", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/735a56076e29348d838ce6c2658996daae86718f", + "reference": "735a56076e29348d838ce6c2658996daae86718f", "shasum": "" }, "require": { @@ -721,20 +722,20 @@ "parser", "shortcodes" ], - "time": "2017-08-04 23:06:38" + "time": "2017-10-02 16:58:51" }, { "name": "symfony/config", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "0b8541d18507d10204a08384640ff6df3c739ebe" + "reference": "1dbeaa8e2db4b29159265867efff075ad961558c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/0b8541d18507d10204a08384640ff6df3c739ebe", - "reference": "0b8541d18507d10204a08384640ff6df3c739ebe", + "url": "https://api.github.com/repos/symfony/config/zipball/1dbeaa8e2db4b29159265867efff075ad961558c", + "reference": "1dbeaa8e2db4b29159265867efff075ad961558c", "shasum": "" }, "require": { @@ -777,20 +778,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" + "time": "2017-10-04 18:56:36" }, { "name": "symfony/console", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "efa4d466b67c2fc9bf9419a981e683e1f99fa029" + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/efa4d466b67c2fc9bf9419a981e683e1f99fa029", - "reference": "efa4d466b67c2fc9bf9419a981e683e1f99fa029", + "url": "https://api.github.com/repos/symfony/console/zipball/f81549d2c5fdee8d711c9ab3c7e7362353ea5853", + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853", "shasum": "" }, "require": { @@ -838,20 +839,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-05-28 14:07:33" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/debug", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "344f50ce827413b3640bfcb1e37386a67d06ea1f" + "reference": "eaaec993ca5e8067e204b2ee653cdd142961f33e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/344f50ce827413b3640bfcb1e37386a67d06ea1f", - "reference": "344f50ce827413b3640bfcb1e37386a67d06ea1f", + "url": "https://api.github.com/repos/symfony/debug/zipball/eaaec993ca5e8067e204b2ee653cdd142961f33e", + "reference": "eaaec993ca5e8067e204b2ee653cdd142961f33e", "shasum": "" }, "require": { @@ -895,20 +896,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-04-19 19:56:30" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/dependency-injection", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "155b770e68150139779295864d6b6cb3172cd821" + "reference": "2562562610dbdabbb98c6ceb60459a351811c734" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/155b770e68150139779295864d6b6cb3172cd821", - "reference": "155b770e68150139779295864d6b6cb3172cd821", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2562562610dbdabbb98c6ceb60459a351811c734", + "reference": "2562562610dbdabbb98c6ceb60459a351811c734", "shasum": "" }, "require": { @@ -958,20 +959,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-05-25 22:57:22" + "time": "2017-10-02 07:17:52" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531" + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fc8e2b4118ff316550596357325dfd92a51f531", - "reference": "7fc8e2b4118ff316550596357325dfd92a51f531", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fe089232554357efb8d4af65ce209fc6e5a2186", + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186", "shasum": "" }, "require": { @@ -1018,20 +1019,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-04-26 16:56:54" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/filesystem", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "19c11158da8d110cc5289c063bf2ec4cc1ce9e7c" + "reference": "5e3af878f144089faddd4060a48cadae4fc44dee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/19c11158da8d110cc5289c063bf2ec4cc1ce9e7c", - "reference": "19c11158da8d110cc5289c063bf2ec4cc1ce9e7c", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/5e3af878f144089faddd4060a48cadae4fc44dee", + "reference": "5e3af878f144089faddd4060a48cadae4fc44dee", "shasum": "" }, "require": { @@ -1067,20 +1068,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-05-28 14:07:33" + "time": "2017-10-02 08:46:46" }, { "name": "symfony/finder", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528" + "reference": "a945724b201f74d543e356f6059c930bb8d10c92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b058a6f0cb6ee9b6b727aae03d5a62474a308528", - "reference": "b058a6f0cb6ee9b6b727aae03d5a62474a308528", + "url": "https://api.github.com/repos/symfony/finder/zipball/a945724b201f74d543e356f6059c930bb8d10c92", + "reference": "a945724b201f74d543e356f6059c930bb8d10c92", "shasum": "" }, "require": { @@ -1116,20 +1117,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-05-25 22:57:22" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/http-foundation", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "03bf5ded5a4b54473e7551df5cfab854f7434ed4" + "reference": "e6e0170e134bf25d03030b71a19ca409e036157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/03bf5ded5a4b54473e7551df5cfab854f7434ed4", - "reference": "03bf5ded5a4b54473e7551df5cfab854f7434ed4", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e6e0170e134bf25d03030b71a19ca409e036157a", + "reference": "e6e0170e134bf25d03030b71a19ca409e036157a", "shasum": "" }, "require": { @@ -1171,20 +1172,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-05-19 11:49:58" + "time": "2017-10-05 23:06:47" }, { "name": "symfony/http-kernel", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "ae9dd4cfde4a3efa94475863fc330825715fe549" + "reference": "d912b76d7db324f7650da9d1132be78c5f7ceb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ae9dd4cfde4a3efa94475863fc330825715fe549", - "reference": "ae9dd4cfde4a3efa94475863fc330825715fe549", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d912b76d7db324f7650da9d1132be78c5f7ceb93", + "reference": "d912b76d7db324f7650da9d1132be78c5f7ceb93", "shasum": "" }, "require": { @@ -1195,7 +1196,8 @@ "symfony/http-foundation": "~2.7.20|~2.8.13|~3.1.6" }, "conflict": { - "symfony/config": "<2.7" + "symfony/config": "<2.7", + "twig/twig": "<1.34|<2.4,>=2" }, "require-dev": { "symfony/browser-kit": "~2.3|~3.0.0", @@ -1253,20 +1255,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-05-29 19:14:58" + "time": "2017-10-05 23:24:02" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", "shasum": "" }, "require": { @@ -1278,7 +1280,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1312,20 +1314,20 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-php54", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0" + "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/90e085822963fdcc9d1c5b73deb3d2e5783b16a0", - "reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/d7810a14b2c6c1aff415e1bb755f611b3d5327bc", + "reference": "d7810a14b2c6c1aff415e1bb755f611b3d5327bc", "shasum": "" }, "require": { @@ -1334,7 +1336,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1370,20 +1372,20 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/polyfill-php55", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67" + "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", - "reference": "03e3f0350bca2220e3623a0e340eef194405fc67", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b64e7f0c37ecf144ecc16668936eef94e628fbfd", + "reference": "b64e7f0c37ecf144ecc16668936eef94e628fbfd", "shasum": "" }, "require": { @@ -1393,7 +1395,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -1426,20 +1428,20 @@ "portable", "shim" ], - "time": "2016-11-14 01:06:16" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/proxy-manager-bridge", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/proxy-manager-bridge.git", - "reference": "991c0fcd1d461ee9c7cde7d2c44d1ed7f4cc36ae" + "reference": "2513b97c244414c45d2c64e2f421b718daacebaa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/991c0fcd1d461ee9c7cde7d2c44d1ed7f4cc36ae", - "reference": "991c0fcd1d461ee9c7cde7d2c44d1ed7f4cc36ae", + "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/2513b97c244414c45d2c64e2f421b718daacebaa", + "reference": "2513b97c244414c45d2c64e2f421b718daacebaa", "shasum": "" }, "require": { @@ -1480,20 +1482,20 @@ ], "description": "Symfony ProxyManager Bridge", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/routing", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "a8f328c7e701b7bb05a93fca62a5ab2b6b3e500e" + "reference": "74808bc927c173935edc31e331d742698b055d0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/a8f328c7e701b7bb05a93fca62a5ab2b6b3e500e", - "reference": "a8f328c7e701b7bb05a93fca62a5ab2b6b3e500e", + "url": "https://api.github.com/repos/symfony/routing/zipball/74808bc927c173935edc31e331d742698b055d0a", + "reference": "74808bc927c173935edc31e331d742698b055d0a", "shasum": "" }, "require": { @@ -1555,32 +1557,35 @@ "uri", "url" ], - "time": "2017-04-12 14:07:15" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/twig-bridge", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "362aa855b5819355811b58f8b5f15679196a181e" + "reference": "624cfc984d47ac5d3a940ba53bd14c4550c8a9e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/362aa855b5819355811b58f8b5f15679196a181e", - "reference": "362aa855b5819355811b58f8b5f15679196a181e", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/624cfc984d47ac5d3a940ba53bd14c4550c8a9e4", + "reference": "624cfc984d47ac5d3a940ba53bd14c4550c8a9e4", "shasum": "" }, "require": { "php": ">=5.3.9", - "twig/twig": "~1.28|~2.0" + "twig/twig": "~1.34|~2.4" + }, + "conflict": { + "symfony/form": "<2.8.23" }, "require-dev": { "symfony/asset": "~2.7|~3.0.0", "symfony/console": "~2.8|~3.0.0", "symfony/expression-language": "~2.4|~3.0.0", "symfony/finder": "~2.3|~3.0.0", - "symfony/form": "^2.8.19", + "symfony/form": "^2.8.23", "symfony/http-kernel": "~2.8|~3.0.0", "symfony/polyfill-intl-icu": "~1.0", "symfony/routing": "~2.2|~3.0.0", @@ -1636,20 +1641,20 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/yaml", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02" + "reference": "842fb6df22180244b4c65935ce1a88d324e5ff9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/93ccdde79f4b079c7558da4656a3cb1c50c68e02", - "reference": "93ccdde79f4b079c7558da4656a3cb1c50c68e02", + "url": "https://api.github.com/repos/symfony/yaml/zipball/842fb6df22180244b4c65935ce1a88d324e5ff9e", + "reference": "842fb6df22180244b4c65935ce1a88d324e5ff9e", "shasum": "" }, "require": { @@ -1685,24 +1690,24 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:31:55" + "time": "2017-10-05 14:38:30" }, { "name": "twig/twig", - "version": "v1.33.2", + "version": "v1.35.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "dd6ca96227917e1e85b41c7c3cc6507b411e0927" + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/dd6ca96227917e1e85b41c7c3cc6507b411e0927", - "reference": "dd6ca96227917e1e85b41c7c3cc6507b411e0927", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f", + "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f", "shasum": "" }, "require": { - "php": ">=5.2.7" + "php": ">=5.3.3" }, "require-dev": { "psr/container": "^1.0", @@ -1712,12 +1717,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.33-dev" + "dev-master": "1.35-dev" } }, "autoload": { "psr-0": { "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1747,7 +1755,7 @@ "keywords": [ "templating" ], - "time": "2017-04-20 17:39:48" + "time": "2017-09-27 18:06:46" }, { "name": "zendframework/zend-code", @@ -2294,22 +2302,22 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -2320,7 +2328,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -2353,7 +2361,7 @@ "spy", "stub" ], - "time": "2017-03-02 20:05:34" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/dbunit", @@ -2664,16 +2672,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.35", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -2732,7 +2740,7 @@ "testing", "xunit" ], - "time": "2017-02-06 05:18:07" + "time": "2017-06-21 08:07:12" }, { "name": "phpunit/phpunit-mock-objects", @@ -3345,16 +3353,16 @@ }, { "name": "symfony/browser-kit", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "4386755566fc8d29bddf89694663b0e96cb01e61" + "reference": "87a03da13c5110e6638e874803437dcd5c76d472" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/4386755566fc8d29bddf89694663b0e96cb01e61", - "reference": "4386755566fc8d29bddf89694663b0e96cb01e61", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/87a03da13c5110e6638e874803437dcd5c76d472", + "reference": "87a03da13c5110e6638e874803437dcd5c76d472", "shasum": "" }, "require": { @@ -3398,20 +3406,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-04-12 14:07:15" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/css-selector", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "ba3204654efa779691fac9e948a96b4a7067e4ab" + "reference": "ef01ca1352deb0c029cf496a89a6b175659c1ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ba3204654efa779691fac9e948a96b4a7067e4ab", - "reference": "ba3204654efa779691fac9e948a96b4a7067e4ab", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ef01ca1352deb0c029cf496a89a6b175659c1ec3", + "reference": "ef01ca1352deb0c029cf496a89a6b175659c1ec3", "shasum": "" }, "require": { @@ -3451,20 +3459,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-05-01 14:31:55" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/dom-crawler", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "b19d01ec41c704497b0bee78bce8bf97619c0649" + "reference": "6433e25f338ff174dc9429283354faf06df05f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b19d01ec41c704497b0bee78bce8bf97619c0649", - "reference": "b19d01ec41c704497b0bee78bce8bf97619c0649", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/6433e25f338ff174dc9429283354faf06df05f67", + "reference": "6433e25f338ff174dc9429283354faf06df05f67", "shasum": "" }, "require": { @@ -3507,20 +3515,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-05-25 22:57:22" + "time": "2017-10-01 21:00:16" }, { "name": "symfony/process", - "version": "v2.8.21", + "version": "v2.8.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9" + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d54232f5682fda2f8bbebff7c81b864646867ab9", - "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9", + "url": "https://api.github.com/repos/symfony/process/zipball/26c9fb02bf06bd6b90f661a5bd17e510810d0176", + "reference": "26c9fb02bf06bd6b90f661a5bd17e510810d0176", "shasum": "" }, "require": { @@ -3556,7 +3564,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-05-08 01:19:21" + "time": "2017-10-01 21:00:16" } ], "aliases": [], diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml index 697e147d85..a327b74ac4 100644 --- a/phpBB/config/default/container/services_console.yml +++ b/phpBB/config/default/container/services_console.yml @@ -3,7 +3,6 @@ services: class: phpbb\console\exception_subscriber arguments: - '@language' - - '%debug.exceptions%' tags: - { name: kernel.event_subscriber } diff --git a/phpBB/config/default/container/services_feed.yml b/phpBB/config/default/container/services_feed.yml index d3e7924f2f..e8bac4b5ce 100644 --- a/phpBB/config/default/container/services_feed.yml +++ b/phpBB/config/default/container/services_feed.yml @@ -18,9 +18,10 @@ services: class: phpbb\feed\helper arguments: - '@config' + - '@service_container' + - '@path_helper' + - '@text_formatter.renderer' - '@user' - - '%core.root_path%' - - '%core.php_ext%' feed.forum: class: phpbb\feed\forum @@ -78,6 +79,10 @@ services: - '@dispatcher' - '%core.php_ext%' + feed.quote_helper: + class: phpbb\feed\quote_helper + parent: text_formatter.s9e.quote_helper + feed.topic: class: phpbb\feed\topic shared: false diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf index ce929b6e54..55c01a1fc9 100644 --- a/phpBB/docs/nginx.sample.conf +++ b/phpBB/docs/nginx.sample.conf @@ -18,11 +18,11 @@ http { gzip_vary on; gzip_http_version 1.1; gzip_min_length 700; - + # Compression levels over 6 do not give an appreciable improvement # in compression ratio, but take more resources. gzip_comp_level 6; - + # IE 6 and lower do not support gzip with Vary correctly. gzip_disable "msie6"; # Before nginx 0.7.63: @@ -49,9 +49,7 @@ http { server_name myforums.com; # A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites: - rewrite ^ http://www.myforums.com$request_uri permanent; - # Equivalent to: - #rewrite ^(.*)$ http://www.myforums.com$1 permanent; + return 301 http://www.myforums.com$request_uri; } # The actual board domain. @@ -72,7 +70,7 @@ http { } # Deny access to internal phpbb files. - location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|phpbb|store|vendor) { + location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|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_board.php b/phpBB/includes/acp/acp_board.php index e044384c9f..77e6133fe6 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -552,7 +552,7 @@ class acp_board if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable'])) { - enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', log(FORUM_FLAG_QUICK_REPLY, 2)); + enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', round(log(FORUM_FLAG_QUICK_REPLY, 2))); } } } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index b954f90451..5b31417b83 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -398,7 +398,7 @@ class acp_styles // Reset default style for users who use selected styles $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_style = 0 + SET user_style = ' . (int) $this->default_style . ' WHERE user_style IN (' . implode(', ', $ids) . ')'; $this->db->sql_query($sql); @@ -1249,7 +1249,7 @@ class acp_styles // Change default style for users $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_style = 0 + SET user_style = ' . (int) $this->default_style . ' WHERE user_style = ' . $id; $this->db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index cf442bbc33..090cb32ebb 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -813,16 +813,22 @@ class acp_users break; default: + $u_action = $this->u_action; + /** * Run custom quicktool code * * @event core.acp_users_overview_run_quicktool - * @var array user_row Current user data * @var string action Quick tool that should be run + * @var array user_row Current user data + * @var string u_action The u_action link * @since 3.1.0-a1 + * @changed 3.2.2-RC1 Added u_action */ - $vars = array('action', 'user_row'); + $vars = array('action', 'user_row', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_run_quicktool', compact($vars))); + + unset($u_action); break; } @@ -1485,12 +1491,14 @@ class acp_users * Validate profile data in ACP before submitting to the database * * @event core.acp_users_profile_validate - * @var bool submit Flag indicating if submit button has been pressed * @var array data Array with user profile data + * @var int user_id The user id + * @var array user_row Array with the full user data * @var array error Array with the form errors * @since 3.1.4-RC1 + * @changed 3.1.12-RC1 Removed submit, added user_id, user_row */ - $vars = array('submit', 'data', 'error'); + $vars = array('data', 'user_id', 'user_row', 'error'); extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars))); if (!sizeof($error)) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6a36210dca..2cd62d7bac 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1644,7 +1644,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false, */ function generate_board_url($without_script_path = false) { - global $config, $user, $request; + global $config, $user, $request, $symfony_request; $server_name = $user->host; @@ -1661,7 +1661,8 @@ function generate_board_url($without_script_path = false) } else { - $server_port = $request->server('SERVER_PORT', 0); + $server_port = (int) $symfony_request->getPort(); + $forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO'); if (!empty($forwarded_proto) && $forwarded_proto === 'https') @@ -4069,11 +4070,6 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false) if ($driver) { $html = $driver->get_custom_html($user, $row, $alt); - if (!empty($html)) - { - return $html; - } - $avatar_data = $driver->get_data($row); } else @@ -4081,7 +4077,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false) $avatar_data['src'] = ''; } - if (!empty($avatar_data['src'])) + if (empty($html) && !empty($avatar_data['src'])) { if ($lazy) { diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 32bee14eef..171a73a8de 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -537,7 +537,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Create last post link information, if appropriate if ($row['forum_last_post_id']) { - if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post'])) + if ($row['forum_password_last_post'] === '' && $auth->acl_gets('f_read', 'f_list_topics', $row['forum_id_last_post'])) { $last_post_subject = censor_text($row['forum_last_post_subject']); $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']); diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 835db44b90..029588bb23 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -205,7 +205,7 @@ class ucp_notifications } $template->assign_vars(array( - strtoupper($block) . '_COLS' => sizeof($notification_methods) + 2, + strtoupper($block) . '_COLS' => sizeof($notification_methods) + 1, )); } diff --git a/phpBB/index.php b/phpBB/index.php index 83535b50af..4e37782206 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -123,8 +123,10 @@ $db->sql_freeresult($result); $legend = implode($user->lang['COMMA_SEPARATOR'], $legend); // Generate birthday list if required ... +$show_birthdays = ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')); + $birthdays = $birthday_list = array(); -if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) +if ($show_birthdays) { $time = $user->create_datetime(); $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); @@ -215,7 +217,7 @@ $template->assign_vars(array( 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', - 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, + 'S_DISPLAY_BIRTHDAY_LIST' => $show_birthdays, 'S_INDEX' => true, 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index ca0e8bd614..fa61f45366 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -328,6 +328,7 @@ INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_icons', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_ignoreflood', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_img', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list_topics', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_noapprove', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_poll', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_post', 1); @@ -565,13 +566,13 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_'; # Read Only Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe', 'f_print'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_list_topics', 'f_read', 'f_search', 'f_subscribe', 'f_print'); # Limited Access (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); # Bot Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_print'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_list_topics', 'f_read', 'f_print'); # On Moderation Queue (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index e6c56a5bbb..0578651739 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -357,7 +357,7 @@ $lang = array_merge($lang, array( 'COOKIE_NOTICE' => 'Cookie notice', 'COOKIE_NOTICE_EXPLAIN' => 'If enabled a cookie notice will be displayed to users when visiting your board. This might be required by law depending on the content of your board and enabled extensions.', 'COOKIE_PATH' => 'Cookie path', - 'COOKIE_PATH_EXPLAIN' => 'Note that this is always a slash, it does not matter what your board URL is.', + 'COOKIE_PATH_EXPLAIN' => 'This will usually be the same as your script path or simply a slash to make the cookie accessible across the site domain.', 'COOKIE_SECURE' => 'Cookie secure', 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.', 'ONLINE_LENGTH' => 'View online time span', @@ -371,7 +371,7 @@ $lang = array_merge($lang, array( 'ACP_CONTACT_SETTINGS_EXPLAIN' => 'Here you can enable and disable the contact page and also add a text that is displayed on the page.', 'CONTACT_US_ENABLE' => 'Enable contact page', - 'CONTACT_US_ENABLE_EXPLAIN' => 'This page allows users to send emails to board administrators', + 'CONTACT_US_ENABLE_EXPLAIN' => 'This page allows users to send emails to board administrators. Please note that board-wide emails option must be enabled as well. You can find this option in General > Client Communication > Email settings.', 'CONTACT_US_INFO' => 'Contact information', 'CONTACT_US_INFO_EXPLAIN' => 'The message is displayed on the contact page', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index f986eced38..64740b311b 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -107,6 +107,7 @@ $lang = array_merge($lang, array( // Forum Permissions $lang = array_merge($lang, array( 'ACL_F_LIST' => 'Can see forum', + 'ACL_F_LIST_TOPICS' => 'Can see topics', 'ACL_F_READ' => 'Can read forum', 'ACL_F_SEARCH' => 'Can search the forum', 'ACL_F_SUBSCRIBE' => 'Can subscribe forum', diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 9946a3eda4..cab205ddf9 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -53,7 +53,7 @@ $lang = array_merge($lang, array( 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', // Not used anymore 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]', // Not used anymore 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]', // Not used anymore - 'NO_READ_ACCESS' => 'You do not have the required permissions to read topics within this forum.', + 'NO_READ_ACCESS' => 'You do not have the required permissions to view or read topics within this forum.', 'NO_UNREAD_POSTS_HOT' => 'No unread posts [ Popular ]', 'NO_UNREAD_POSTS_LOCKED' => 'No unread posts [ Locked ]', diff --git a/phpBB/phpbb/cache/driver/memcached.php b/phpBB/phpbb/cache/driver/memcached.php index 808e15afe8..7d66759ec2 100644 --- a/phpBB/phpbb/cache/driver/memcached.php +++ b/phpBB/phpbb/cache/driver/memcached.php @@ -65,7 +65,7 @@ class memcached extends \phpbb\cache\driver\memory $this->memcached->setOption(\Memcached::OPT_COMPRESSION, false); } - foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u) + foreach (explode(',', PHPBB_ACM_MEMCACHED) as $u) { preg_match('#(.*)/(\d+)#', $u, $parts); $this->memcached->addServer(trim($parts[1]), (int) trim($parts[2])); diff --git a/phpBB/phpbb/console/exception_subscriber.php b/phpBB/phpbb/console/exception_subscriber.php index b920d4abae..b240993203 100644 --- a/phpBB/phpbb/console/exception_subscriber.php +++ b/phpBB/phpbb/console/exception_subscriber.php @@ -29,12 +29,10 @@ class exception_subscriber implements EventSubscriberInterface * Construct method * * @param \phpbb\language\language $language Language object - * @param bool $debug Debug mode */ - public function __construct(\phpbb\language\language $language, $debug = false) + public function __construct(\phpbb\language\language $language) { $this->language = $language; - $this->debug = $debug; } /** @@ -52,14 +50,7 @@ class exception_subscriber implements EventSubscriberInterface $parameters = array_merge(array($original_exception->getMessage()), $original_exception->get_parameters()); $message = call_user_func_array(array($this->language, 'lang'), $parameters); - if ($this->debug) - { - $exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception); - } - else - { - $exception = new \RuntimeException($message , $original_exception->getCode()); - } + $exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception); $event->setException($exception); } diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 2c7b7edf2e..f50ab33830 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -160,12 +160,12 @@ class style_update_p1 extends \phpbb\db\migration\migration FROM ' . STYLES_TABLE . " WHERE style_name = 'prosilver'"; $result = $this->sql_query($sql); - $default_style = $this->db->sql_fetchfield('style_id'); + $default_style = (int) $this->db->sql_fetchfield('style_id'); $this->db->sql_freeresult($result); $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . (int) $default_style; $this->sql_query($sql); } else @@ -183,9 +183,9 @@ class style_update_p1 extends \phpbb\db\migration\migration } // Reset styles for users - $this->sql_query('UPDATE ' . USERS_TABLE . ' - SET user_style = 0 - WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . " + SET user_style = '" . (int) $valid_styles[0] . "' + WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true)); } } } diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php new file mode 100644 index 0000000000..49727e5a62 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -0,0 +1,31 @@ +<?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 f_list_topics_permission_add extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function update_data() + { + return array( + array('permission.add', array('f_list_topics', false, 'f_read')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php new file mode 100644 index 0000000000..282c6bef2f --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -0,0 +1,50 @@ +<?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 fix_user_styles extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'styles_fix'))), + ); + } + + public function styles_fix() + { + $default_style = (int) $this->config['default_style']; + + // Get enabled styles + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $this->db->sql_query($sql); + $enabled_styles = $result->fetch_array(); + $this->db->sql_freeresult($result); + + // Set the default style to users who have an invalid style + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $default_style . ' + WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true)); + } +} diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index d7d7f18d2b..6c026c3ae1 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -503,11 +503,14 @@ class migrator return; } - foreach ($this->migration_state as $name => $state) + foreach ($this->migrations as $name) { - if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on'])) + $state = $this->migration_state($name); + + if ($state && in_array($migration, $state['migration_depends_on']) && ($state['migration_schema_done'] || $state['migration_data_done'])) { $this->revert_do($name); + return; } } diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php index 1c4abeb108..1ba2ab8987 100644 --- a/phpBB/phpbb/event/dispatcher.php +++ b/phpBB/phpbb/event/dispatcher.php @@ -57,7 +57,12 @@ class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_int return $event; } - return parent::dispatch($eventName, $event); + foreach ((array) $eventName as $name) + { + $event = parent::dispatch($name, $event); + } + + return $event; } /** diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index 26d7e2b426..7b80863305 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -196,13 +196,13 @@ class php_exporter $content = file_get_contents($this->path . $this->current_file); $num_events_found = 0; - if (strpos($content, "dispatcher->trigger_event('") || strpos($content, "dispatcher->dispatch('")) + if (strpos($content, 'dispatcher->trigger_event(') || strpos($content, 'dispatcher->dispatch(')) { $this->set_content(explode("\n", $content)); for ($i = 0, $num_lines = sizeof($this->file_lines); $i < $num_lines; $i++) { $event_line = false; - $found_trigger_event = strpos($this->file_lines[$i], "dispatcher->trigger_event('"); + $found_trigger_event = strpos($this->file_lines[$i], 'dispatcher->trigger_event('); $arguments = array(); if ($found_trigger_event !== false) { @@ -216,7 +216,7 @@ class php_exporter } else { - $found_dispatch = strpos($this->file_lines[$i], "dispatcher->dispatch('"); + $found_dispatch = strpos($this->file_lines[$i], 'dispatcher->dispatch('); if ($found_dispatch !== false) { $event_line = $i; @@ -316,17 +316,17 @@ class php_exporter if ($is_dispatch) { - $regex = '#\$([a-z](?:[a-z0-9_]|->)*)'; - $regex .= '->dispatch\('; - $regex .= '\'' . $this->preg_match_event_name() . '\''; - $regex .= '\);#'; + $regex = '#\$[a-z](?:[a-z0-9_]|->)*'; + $regex .= '->dispatch\((\[)?'; + $regex .= '\'' . $this->preg_match_event_name() . '(?(1)\', \'(?2))+\''; + $regex .= '(?(1)\])\);#'; } else { - $regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)'; - $regex .= '->trigger_event\('; - $regex .= '\'' . $this->preg_match_event_name() . '\''; - $regex .= ', compact\(\$vars\)\)\);#'; + $regex = '#extract\(\$[a-z](?:[a-z0-9_]|->)*'; + $regex .= '->trigger_event\((\[)?'; + $regex .= '\'' . $this->preg_match_event_name() . '(?(1)\', \'(?2))+\''; + $regex .= '(?(1)\]), compact\(\$vars\)\)\);#'; } $match = array(); @@ -359,7 +359,7 @@ class php_exporter public function get_vars_from_array() { $line = ltrim($this->file_lines[$this->current_event_line - 1], "\t"); - if ($line === ');') + if ($line === ');' || $line === '];') { $vars_array = $this->get_vars_from_multi_line_array(); } @@ -370,7 +370,7 @@ class php_exporter foreach ($vars_array as $var) { - if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var)) + if (!preg_match('#^[a-z_][a-z0-9_]*$#i', $var)) { throw new \LogicException("Found invalid var '{$var}' in array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3); } @@ -392,11 +392,11 @@ class php_exporter public function get_vars_from_single_line_array($line, $throw_multiline = true) { $match = array(); - preg_match('#^\$vars = (?:\[|array\()\'([a-zA-Z0-9_\' ,]+)\'[\)\]];$#', $line, $match); + preg_match('#^\$vars = (?:(\[)|array\()\'([a-z0-9_\' ,]+)\'(?(1)\]|\));$#i', $line, $match); - if (isset($match[1])) + if (isset($match[2])) { - $vars_array = explode("', '", $match[1]); + $vars_array = explode("', '", $match[2]); if ($throw_multiline && sizeof($vars_array) > 6) { throw new \LogicException('Should use multiple lines for $vars definition ' @@ -420,7 +420,7 @@ class php_exporter { $current_vars_line = 2; $var_lines = array(); - while (ltrim($this->file_lines[$this->current_event_line - $current_vars_line], "\t") !== '$vars = array(') + while (!in_array(ltrim($this->file_lines[$this->current_event_line - $current_vars_line], "\t"), ['$vars = array(', '$vars = ['])) { $var_lines[] = substr(trim($this->file_lines[$this->current_event_line - $current_vars_line]), 0, -1); @@ -485,7 +485,7 @@ class php_exporter foreach ($doc_vars as $var) { - if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var)) + if (!preg_match('#^[a-z_][a-z0-9_]*$#i', $var)) { throw new \LogicException("Found invalid @var '{$var}' in docblock for event " . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 4); diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php index e15d1e131e..7d50b7ce7d 100644 --- a/phpBB/phpbb/feed/helper.php +++ b/phpBB/phpbb/feed/helper.php @@ -13,41 +13,52 @@ namespace phpbb\feed; +use phpbb\config\config; +use phpbb\path_helper; +use phpbb\textformatter\s9e\renderer; +use phpbb\user; +use Symfony\Component\DependencyInjection\ContainerInterface; + /** * Class with some helpful functions used in feeds */ class helper { - /** @var \phpbb\config\config */ + /** @var config */ protected $config; - /** @var \phpbb\user */ - protected $user; + /** @var ContainerInterface */ + protected $container; - /** @var string */ - protected $phpbb_root_path; + /** @var path_helper */ + protected $path_helper; - /** @var string */ - protected $phpEx; + /** @var renderer */ + protected $renderer; + + /** @var user */ + protected $user; /** * Constructor * - * @param \phpbb\config\config $config Config object - * @param \phpbb\user $user User object - * @param string $phpbb_root_path Root path - * @param string $phpEx PHP file extension + * @param config $config Config object + * @param ContainerInterface $container Service container object + * @param path_helper $path_helper Path helper object + * @param renderer $renderer TextFormatter renderer object + * @param user $user User object */ - public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $phpEx) + public function __construct(config $config, ContainerInterface $container, path_helper $path_helper, renderer $renderer, user $user) { $this->config = $config; + $this->container = $container; + $this->path_helper = $path_helper; + $this->renderer = $renderer; $this->user = $user; - $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; } /** - * Run links through append_sid(), prepend generate_board_url() and remove session id + * Returns the board url (and caches it in the function) */ public function get_board_url() { @@ -104,16 +115,12 @@ class helper return ''; } - // Prepare some bbcodes for better parsing - $content = preg_replace("#\[quote(=".*?")?:$uid\]\s*(.*?)\s*\[/quote:$uid\]#si", "[quote$1:$uid]<br />$2<br />[/quote:$uid]", $content); - - $content = generate_text_for_display($content, $uid, $bitfield, $options); + // Setup our own quote_helper to remove all attributes from quotes + $this->renderer->configure_quote_helper($this->container->get('feed.quote_helper')); - // Add newlines - $content = str_replace('<br />', '<br />' . "\n", $content); + $this->renderer->set_smilies_path($this->get_board_url() . '/' . $this->config['smilies_path']); - // Convert smiley Relative paths to Absolute path, Windows style - $content = str_replace($this->phpbb_root_path . $this->config['smilies_path'], $this->get_board_url() . '/' . $this->config['smilies_path'], $content); + $content = generate_text_for_display($content, $uid, $bitfield, $options); // Remove "Select all" link and mouse events $content = str_replace('<a href="#" onclick="selectCode(this); return false;">' . $this->user->lang['SELECT_ALL_CODE'] . '</a>', '', $content); @@ -152,7 +159,7 @@ class helper $content .= implode('<br />', $post_attachments); // Convert attachments' relative path to absolute path - $content = str_replace($this->phpbb_root_path . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $content); + $content = str_replace($this->path_helper->get_web_root_path() . 'download/file.' . $this->path_helper->get_php_ext(), $this->get_board_url() . '/download/file.' . $this->path_helper->get_php_ext(), $content); } // Remove Comments from inline attachments [ia] diff --git a/phpBB/phpbb/feed/quote_helper.php b/phpBB/phpbb/feed/quote_helper.php new file mode 100644 index 0000000000..843d075028 --- /dev/null +++ b/phpBB/phpbb/feed/quote_helper.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\feed; + +/** + * Modified quote_helper for feeds (basically just removing all attributes) + */ +class quote_helper extends \phpbb\textformatter\s9e\quote_helper +{ + /** + * {@inheritdoc} + */ + public function inject_metadata($xml) + { + // In feeds we don't want any attributes, so delete all of them + return \s9e\TextFormatter\Utils::replaceAttributes( + $xml, + 'QUOTE', + function () + { + return []; + } + ); + } +} diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php index 7ae0bde56b..ea9ee97b9d 100644 --- a/phpBB/phpbb/feed/topics_active.php +++ b/phpBB/phpbb/feed/topics_active.php @@ -119,7 +119,7 @@ class topics_active extends topic_base FROM ' . FORUMS_TABLE . ' WHERE forum_type = ' . FORUM_POST . ' AND ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_EXCLUDE, '= 0') . ' - AND ' . $this->db->sql_bit_and('forum_flags', log(FORUM_FLAG_ACTIVE_TOPICS, 2), '<> 0'); + AND ' . $this->db->sql_bit_and('forum_flags', round(log(FORUM_FLAG_ACTIVE_TOPICS, 2)), '<> 0'); $result = $this->db->sql_query($sql); $forum_ids = array(); diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 5aad7ee326..dcc4cdde51 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -933,6 +933,20 @@ class log implements \phpbb\log\log_interface $forum_auth['f_read'][$row['topic_id']] = $row['forum_id']; } + /** + * Allow modifying SQL query after topic data is retrieved (inside loop). + * + * @event core.phpbb_log_get_topic_auth_sql_after + * @var array forum_auth Forum permissions + * @var array row One row of data from SQL query + * @since 3.2.2-RC1 + */ + $vars = array( + 'forum_auth', + 'row', + ); + extract($this->dispatcher->trigger_event('core.phpbb_log_get_topic_auth_sql_after', compact($vars))); + if ($this->auth->acl_gets('a_', 'm_', $row['forum_id'])) { $forum_auth['m_'][$row['topic_id']] = $row['forum_id']; diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php index a5a95b096d..40af5eda6b 100644 --- a/phpBB/phpbb/pagination.php +++ b/phpBB/phpbb/pagination.php @@ -136,6 +136,11 @@ class pagination */ public function generate_template_pagination($base_url, $block_var_name, $start_name, $num_items, $per_page, $start = 1, $reverse_count = false, $ignore_on_page = false) { + if (empty($base_url)) + { + return; + } + $total_pages = ceil($num_items / $per_page); $on_page = $this->get_on_page($per_page, $start); $u_previous_page = $u_next_page = ''; diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index c9181e6202..7697884b6a 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -260,6 +260,7 @@ class permissions // Forum Permissions 'f_list' => array('lang' => 'ACL_F_LIST', 'cat' => 'actions'), + 'f_list_topics' => array('lang' => 'ACL_F_LIST_TOPICS', 'cat' => 'actions'), 'f_read' => array('lang' => 'ACL_F_READ', 'cat' => 'actions'), 'f_search' => array('lang' => 'ACL_F_SEARCH', 'cat' => 'actions'), 'f_subscribe' => array('lang' => 'ACL_F_SUBSCRIBE', 'cat' => 'actions'), diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 89c615e087..59c3d55076 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -648,7 +648,7 @@ class fulltext_sphinx $this->sphinx->SetFilter('deleted', array(0)); $this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES); - $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + $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, // msg=Connection refused) during rotate, retry if so @@ -656,7 +656,7 @@ class fulltext_sphinx while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) { usleep(SPHINX_CONNECT_WAIT_TIME); - $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('"', '"', $this->search_query)), $this->indexes); } if ($this->sphinx->GetLastError()) @@ -679,7 +679,7 @@ class fulltext_sphinx $start = floor(($result_count - 1) / $per_page) * $per_page; $this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES); - $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + $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, // msg=Connection refused) during rotate, retry if so @@ -687,7 +687,7 @@ class fulltext_sphinx while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) { usleep(SPHINX_CONNECT_WAIT_TIME); - $result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes); + $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('"', '"', $this->search_query)), $this->indexes); } } diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index d4097f53ee..5899dff2f5 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -278,24 +278,6 @@ class user extends \phpbb\session $db->sql_freeresult($result); } - // User has wrong style - if (!$this->style && $style_id == $this->data['user_style']) - { - $style_id = $this->data['user_style'] = $config['default_style']; - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_style = $style_id - WHERE user_id = {$this->data['user_id']}"; - $db->sql_query($sql); - - $sql = 'SELECT * - FROM ' . STYLES_TABLE . " s - WHERE s.style_id = $style_id"; - $result = $db->sql_query($sql, 3600); - $this->style = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - } - if (!$this->style) { trigger_error('NO_STYLE_DATA', E_USER_ERROR); diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 16d972056d..e03ef412e4 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -165,7 +165,7 @@ <i class="icon fa-file fa-fw icon-red icon-md" aria-hidden="true"></i><span class="sr-only">{NEW_POST}</span> </a> <!-- ENDIF --> - <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> + <!-- IF topicrow.U_VIEW_TOPIC --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a><!-- ELSE -->{topicrow.TOPIC_TITLE}<!-- ENDIF --> <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --> <a href="{topicrow.U_MCP_QUEUE}" title="{L_TOPIC_UNAPPROVED}"> <i class="icon fa-question fa-fw icon-blue" aria-hidden="true"></i><span class="sr-only">{L_TOPIC_UNAPPROVED}</span> @@ -224,7 +224,7 @@ <dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd> <dd class="lastpost"> <span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - <!-- IF not S_IS_BOT --> + <!-- IF not S_IS_BOT and topicrow.U_LAST_POST --> <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}"> <i class="icon fa-external-link-square fa-fw icon-lightgray icon-md" aria-hidden="true"></i><span class="sr-only">{VIEW_LATEST_POST}</span> </a> diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 3040282b90..cd420b7614 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -18,7 +18,7 @@ ul.topiclist dl { } ul.topiclist li.row dl { - padding: 2px 0; + margin: 2px 0; } ul.topiclist dt, ul.topiclist dd { @@ -70,6 +70,11 @@ ul.topiclist dd { box-sizing: border-box; } +ul.topiclist li.row dd { + padding: 4px 0 999px 0; + margin-bottom: -995px; +} + ul.topiclist dfn { /* Labels for post/view counts */ position: absolute; @@ -137,7 +142,6 @@ dl.row-item { background-position: 10px 50%; /* Position of folder icon */ background-repeat: no-repeat; background-size: 32px; - image-rendering: -webkit-optimize-contrast; } dl.row-item dt { diff --git a/phpBB/styles/prosilver/theme/images/announce_read.gif b/phpBB/styles/prosilver/theme/images/announce_read.gif Binary files differindex b61cc54140..a3b3d7b234 100644 --- a/phpBB/styles/prosilver/theme/images/announce_read.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_read_locked.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif Binary files differindex 8c7393edf9..0a6cf64341 100644 --- a/phpBB/styles/prosilver/theme/images/announce_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif Binary files differindex e3f6e622a3..56af0ab071 100644 --- a/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_read_mine.gif b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif Binary files differindex d57e5d04e5..c333e3b124 100644 --- a/phpBB/styles/prosilver/theme/images/announce_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_read_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_unread.gif b/phpBB/styles/prosilver/theme/images/announce_unread.gif Binary files differindex eb9edd1520..9f75cc3e53 100644 --- a/phpBB/styles/prosilver/theme/images/announce_unread.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif Binary files differindex 054b0ae38d..4ad85bb684 100644 --- a/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif Binary files differindex a37b165b4f..30db89439e 100644 --- a/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif Binary files differindex 55f649cc4b..3a2cbcac10 100644 --- a/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/announce_unread_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_link.gif b/phpBB/styles/prosilver/theme/images/forum_link.gif Binary files differindex 42d445838b..09f8dfa75a 100644 --- a/phpBB/styles/prosilver/theme/images/forum_link.gif +++ b/phpBB/styles/prosilver/theme/images/forum_link.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_read.gif b/phpBB/styles/prosilver/theme/images/forum_read.gif Binary files differindex 79d605ad7c..891fa20c07 100644 --- a/phpBB/styles/prosilver/theme/images/forum_read.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_read_locked.gif b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif Binary files differindex 5eaf460a59..2348240638 100644 --- a/phpBB/styles/prosilver/theme/images/forum_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif Binary files differindex b7b8176e4e..5b4d30f7ec 100644 --- a/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif +++ b/phpBB/styles/prosilver/theme/images/forum_read_subforum.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_unread.gif b/phpBB/styles/prosilver/theme/images/forum_unread.gif Binary files differindex 8df11e7782..e925da82bd 100644 --- a/phpBB/styles/prosilver/theme/images/forum_unread.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif Binary files differindex 63ac3fbedf..5ff59b7421 100644 --- a/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif Binary files differindex c5a2da1e31..7d6ddb93be 100644 --- a/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif +++ b/phpBB/styles/prosilver/theme/images/forum_unread_subforum.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_read.gif b/phpBB/styles/prosilver/theme/images/sticky_read.gif Binary files differindex c56a3833f9..e8142ddb20 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_read.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif Binary files differindex 854a8f06de..fcd8b85e0b 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif Binary files differindex 0d559c0767..0a8dc2a6c1 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif Binary files differindex 3cd077355a..37c4ed01f6 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_read_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread.gif b/phpBB/styles/prosilver/theme/images/sticky_unread.gif Binary files differindex 0d201657e3..88a212d7c0 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_unread.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif Binary files differindex 4535708752..0241da2ab5 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif Binary files differindex bb14033781..8d69b447b2 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif Binary files differindex c7ae656f02..6529102053 100644 --- a/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/sticky_unread_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_moved.gif b/phpBB/styles/prosilver/theme/images/topic_moved.gif Binary files differindex 707b9f5d3d..8e9c1f41f6 100644 --- a/phpBB/styles/prosilver/theme/images/topic_moved.gif +++ b/phpBB/styles/prosilver/theme/images/topic_moved.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read.gif b/phpBB/styles/prosilver/theme/images/topic_read.gif Binary files differindex a3b706eb11..5ed739ee9b 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read_hot.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif Binary files differindex d118fdcc4f..81a42d0a67 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read_hot.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_hot.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif Binary files differindex 2e16f96e33..b98808cadf 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_hot_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read_locked.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif Binary files differindex 3154d38463..61bb1effa2 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read_locked.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif Binary files differindex ac0248c2be..dbe901919a 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_read_mine.gif b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif Binary files differindex b0e9455d0e..8fb165c46c 100644 --- a/phpBB/styles/prosilver/theme/images/topic_read_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_read_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread.gif b/phpBB/styles/prosilver/theme/images/topic_unread.gif Binary files differindex de500726ec..43ea76b4de 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif Binary files differindex 1937164e08..a45bc4bc19 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif Binary files differindex 28fdd88f4b..dc673266be 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_hot_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif Binary files differindex 177dae74f4..68dd3422d7 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif Binary files differindex 2b6b854e33..4f5a36efe9 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_locked_mine.gif diff --git a/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif Binary files differindex fd16eeedef..24e9817ce1 100644 --- a/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif +++ b/phpBB/styles/prosilver/theme/images/topic_unread_mine.gif diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9cc75988f7..79d75a18f8 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -87,7 +87,7 @@ if (isset($_GET['e']) && !$user->data['is_registered']) } // Permissions check -if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id))) +if (!$auth->acl_gets('f_list', 'f_list_topics', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id))) { if ($user->data['user_id'] != ANONYMOUS) { @@ -161,7 +161,22 @@ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); $topics_count = $phpbb_content_visibility->get_count('forum_topics', $forum_data, $forum_id); $start = $pagination->validate_start($start, $config['topics_per_page'], $topics_count); -page_header($forum_data['forum_name'] . ($start ? ' - ' . $user->lang('PAGE_TITLE_NUMBER', $pagination->get_on_page($config['topics_per_page'], $start)) : ''), true, $forum_id); +$page_title = $forum_data['forum_name'] . ($start ? ' - ' . $user->lang('PAGE_TITLE_NUMBER', $pagination->get_on_page($config['topics_per_page'], $start)) : ''); + +/** +* You can use this event to modify the page title of the viewforum page +* +* @event core.viewforum_modify_page_title +* @var string page_title Title of the viewforum page +* @var array forum_data Array with forum data +* @var int forum_id The forum ID +* @var int start Start offset used to calculate the page +* @since 3.2.2-RC1 +*/ +$vars = array('page_title', 'forum_data', 'forum_id', 'start'); +extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_page_title', compact($vars))); + +page_header($page_title, true, $forum_id); $template->set_filenames(array( 'body' => 'viewforum_body.html') @@ -181,7 +196,7 @@ if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & // Ok, if someone has only list-access, we only display the forum list. // We also make this circumstance available to the template in case we want to display a notice. ;) -if (!$auth->acl_get('f_read', $forum_id)) +if (!$auth->acl_gets('f_read', 'f_list_topics', $forum_id)) { $template->assign_vars(array( 'S_NO_READ_ACCESS' => true, @@ -732,7 +747,7 @@ if (sizeof($shadow_topic_list)) } // Do not include those topics the user has no permission to access - if (!$auth->acl_get('f_read', $row['forum_id'])) + if (!$auth->acl_gets('f_read', 'f_list_topics', $row['forum_id'])) { // We need to remove any trace regarding this topic. :) unset($rowset[$orig_topic_id]); @@ -875,7 +890,7 @@ if (sizeof($topic_list)) // Generate all the URIs ... $view_topic_url_params = 'f=' . $row['forum_id'] . '&t=' . $topic_id; - $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); + $view_topic_url = $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params) : false; $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id'])); $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id'])); @@ -929,8 +944,8 @@ if (sizeof($topic_list)) 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, - 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', - 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_NEWEST_POST' => $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread' : false, + 'U_LAST_POST' => $auth->acl_get('f_read', $forum_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'] : false, 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_VIEW_TOPIC' => $view_topic_url, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d4bf5b2490..3f117eef6b 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -263,6 +263,10 @@ if (!$topic_data) $forum_id = (int) $topic_data['forum_id']; +// If the request is missing the f parameter, the forum id in the user session data is 0 at the moment. +// Let's fix that now so that the user can't hide from the forum's Who Is Online list. +$user->page['forum'] = $forum_id; + // Now we know the forum_id and can check the permissions if ($topic_data['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_approve', $forum_id)) { @@ -2017,10 +2021,13 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post * @var array topic_data Array with topic data + * @var array user_cache Array with cached user data + * @var array post_edit_list Array with post edited list * @since 3.1.0-a1 * @changed 3.1.0-a3 Added vars start, current_row_number, end, attachments * @changed 3.1.0-b3 Added topic_data array, total_posts * @changed 3.1.0-RC3 Added poster_id + * @changed 3.2.2-RC1 Added user_cache and post_edit_list */ $vars = array( 'start', @@ -2034,6 +2041,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'user_poster_data', 'post_row', 'topic_data', + 'user_cache', + 'post_edit_list', ); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php index 4e85737c4f..b569d371f1 100644 --- a/tests/bbcode/parser_test.php +++ b/tests/bbcode/parser_test.php @@ -249,9 +249,10 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case $this->markTestIncomplete($incomplete); } - global $user, $request; + global $user, $request, $symfony_request; $user = new phpbb_mock_user; $request = new phpbb_mock_request; + $symfony_request = new \phpbb\symfony_request($request); $bbcode = new bbcode_firstpass(); $bbcode->message = $message; diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php index 3f8ad6022f..f95970a6bb 100644 --- a/tests/bbcode/url_bbcode_test.php +++ b/tests/bbcode/url_bbcode_test.php @@ -52,9 +52,10 @@ class phpbb_url_bbcode_test extends phpbb_test_case */ public function test_url($description, $message, $expected) { - global $user, $request; + global $user, $request, $symfony_request; $user = new phpbb_mock_user; $request = new phpbb_mock_request; + $symfony_request = new \phpbb\symfony_request($request); $bbcode = new bbcode_firstpass(); $bbcode->message = $message; diff --git a/tests/dbal/migration/revert_table.php b/tests/dbal/migration/revert_table.php new file mode 100644 index 0000000000..162421be85 --- /dev/null +++ b/tests/dbal/migration/revert_table.php @@ -0,0 +1,39 @@ +<?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. +* +*/ + +class phpbb_dbal_migration_revert_table extends \phpbb\db\migration\migration +{ + function update_schema() + { + return array( + 'add_tables' => array( + 'phpbb_foobar' => array( + 'COLUMNS' => array( + 'module_id' => array('UINT:3', NULL, 'auto_increment'), + 'bar_column' => array('UINT', 1), + ), + 'PRIMARY_KEY' => 'module_id', + ), + ), + ); + } + + function revert_schema() + { + return array( + 'drop_tables' => array( + 'phpbb_foobar', + ), + ); + } +} diff --git a/tests/dbal/migration/revert_table_with_dependency.php b/tests/dbal/migration/revert_table_with_dependency.php new file mode 100644 index 0000000000..f26ad076e6 --- /dev/null +++ b/tests/dbal/migration/revert_table_with_dependency.php @@ -0,0 +1,52 @@ +<?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. +* +*/ + +class phpbb_dbal_migration_revert_table_with_dependency extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('phpbb_dbal_migration_revert_table'); + } + + function update_schema() + { + return array( + 'add_columns' => array( + 'phpbb_foobar' => array( + 'baz_column' => array('UINT', 1), + ), + ), + 'drop_columns' => array( + 'phpbb_foobar' => array( + 'bar_column', + ), + ), + ); + } + + function revert_schema() + { + return array( + 'add_columns' => array( + 'phpbb_foobar' => array( + 'bar_column' => array('UINT', 1), + ), + ), + 'drop_columns' => array( + 'phpbb_foobar' => array( + 'baz_column', + ), + ), + ); + } +} diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index f7275a4bbe..372b2dbe1e 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -17,16 +17,26 @@ require_once dirname(__FILE__) . '/migration/if.php'; require_once dirname(__FILE__) . '/migration/recall.php'; require_once dirname(__FILE__) . '/migration/revert.php'; require_once dirname(__FILE__) . '/migration/revert_with_dependency.php'; +require_once dirname(__FILE__) . '/migration/revert_table.php'; +require_once dirname(__FILE__) . '/migration/revert_table_with_dependency.php'; require_once dirname(__FILE__) . '/migration/fail.php'; require_once dirname(__FILE__) . '/migration/installed.php'; require_once dirname(__FILE__) . '/migration/schema.php'; class phpbb_dbal_migrator_test extends phpbb_database_test_case { + /** @var \phpbb\db\driver\driver_interface */ protected $db; + + /** @var \phpbb\db\tools\tools_interface */ protected $db_tools; + + /** @var \phpbb\db\migrator */ protected $migrator; + /** @var \phpbb\config\config */ + protected $config; + public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml'); @@ -241,6 +251,41 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertEquals(1, $migrator_test_revert_counter, 'Revert did call custom function again'); } + public function test_revert_table() + { + // Make sure there are no other migrations in the db, this could cause issues + $this->db->sql_query("DELETE FROM phpbb_migrations"); + $this->migrator->load_migration_state(); + + $this->migrator->set_migrations(array('phpbb_dbal_migration_revert_table', 'phpbb_dbal_migration_revert_table_with_dependency')); + + $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_table')); + $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_table_with_dependency')); + + // Install the migration first + while (!$this->migrator->finished()) + { + $this->migrator->update(); + } + + $this->assertTrue($this->migrator->migration_state('phpbb_dbal_migration_revert_table') !== false); + $this->assertTrue($this->migrator->migration_state('phpbb_dbal_migration_revert_table_with_dependency') !== false); + + $this->assertTrue($this->db_tools->sql_column_exists('phpbb_foobar', 'baz_column')); + $this->assertFalse($this->db_tools->sql_column_exists('phpbb_foobar', 'bar_column')); + + // Revert migrations + while ($this->migrator->migration_state('phpbb_dbal_migration_revert_table') !== false) + { + $this->migrator->revert('phpbb_dbal_migration_revert_table'); + } + + $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_table')); + $this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert_table_with_dependency')); + + $this->assertFalse($this->db_tools->sql_table_exists('phpbb_foobar')); + } + public function test_fail() { $this->migrator->set_migrations(array('phpbb_dbal_migration_fail')); diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php index 7bba5bf337..da28d24daa 100644 --- a/tests/event/dispatcher_test.php +++ b/tests/event/dispatcher_test.php @@ -29,5 +29,21 @@ class phpbb_event_dispatcher_test extends phpbb_test_case $result = $dispatcher->trigger_event('core.test_event', compact($vars)); $this->assertSame(array('foo' => 'foo2', 'bar' => 'bar2'), $result); + + // Test migrating events + $dispatcher->addListener('core.foo_br', function(\phpbb\event\data $event) { + $event['pi'] = '3.14159'; + }); + $dispatcher->addListener('core.foo_bar', function(\phpbb\event\data $event) { + $event['pi'] = '3.1'; + }); + + + $pi = '3'; + + $vars = array('pi'); + $result = $dispatcher->trigger_event(['core.foo_bar', 'core.foo_br'], compact($vars)); + + $this->assertSame(array('pi' => '3.14159'), $result); } } diff --git a/tests/event/fixtures/event_migration.test b/tests/event/fixtures/event_migration.test new file mode 100644 index 0000000000..b2df9f95df --- /dev/null +++ b/tests/event/fixtures/event_migration.test @@ -0,0 +1,30 @@ +<?php + + /** + * Modify pm and sender data before it is assigned to the template + * + * @event core.ucp_pm_view_message + * @var mixed id Active module category (can be int or string) + * @var string mode Active module + * @var int folder_id ID of the folder the message is in + * @var int msg_id ID of the private message + * @var array folder Array with data of user's message folders + * @var array message_row Array with message data + * @var array cp_row Array with senders custom profile field data + * @var array msg_data Template array with message data + * @var array user_info User data of the sender + * @since 3.1.0-a1 + * @changed 3.1.6-RC1 Added user_info into event + */ + $vars = array( + 'id', + 'mode', + 'folder_id', + 'msg_id', + 'folder', + 'message_row', + 'cp_row', + 'msg_data', + 'user_info', + ); + extract($phpbb_dispatcher->trigger_event(['core.ucp_pm_view_message', 'core.ucp_pm_view_messsage'], compact($vars))); diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php index 692a57f93c..21dbb1e1d4 100644 --- a/tests/event/php_exporter_test.php +++ b/tests/event/php_exporter_test.php @@ -38,6 +38,18 @@ class phpbb_event_php_exporter_test extends phpbb_test_case ), ), array( + 'event_migration.test', + array( + 'core.ucp_pm_view_message' => array( + 'event' => 'core.ucp_pm_view_message', + 'file' => 'event_migration.test', + 'arguments' => array('cp_row', 'folder', 'folder_id', 'id', 'message_row', 'mode', 'msg_data', 'msg_id', 'user_info'), + 'since' => '3.1.0-a1', + 'description' => 'Modify pm and sender data before it is assigned to the template', + ), + ), + ), + array( 'extra_description.test', array( 'extra_description.dispatch' => array( @@ -240,6 +252,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case array("\t\$phpbb_dispatcher->dispatch('dispatch.one2.thr_ee4');", 'dispatch.one2.thr_ee4'), array("\$this->dispatcher->dispatch('dispatch.one2');", 'dispatch.one2'), array("\$phpbb_dispatcher->dispatch('dis_patch.one');", 'dis_patch.one'), + array("\$phpbb_dispatcher->dispatch(['dis_patch.one', 'dis_patch.one2']);", 'dis_patch.one'), + array("\$phpbb_dispatcher->dispatch(['dis_patch.one', 'dis_patch.one2', 'dis_patch.two3']);", 'dis_patch.one'), ); } @@ -259,6 +273,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case array("\$phpbb_dispatcher->dispatch('');"), array("\$phpbb_dispatcher->dispatch('dispatch.2one');"), array("\$phpbb_dispatcher->dispatch('dispatch');"), + array("\$phpbb_dispatcher->dispatch(['dispatch.one']);"), + array("\$phpbb_dispatcher->dispatch(array('dispatch.one', 'dispatch.one2'));"), ); } @@ -279,6 +295,8 @@ class phpbb_event_php_exporter_test extends phpbb_test_case array("\textract(\$phpbb_dispatcher->trigger_event('dispatch.one2.thr_ee4', compact(\$vars)));", 'dispatch.one2.thr_ee4'), array("extract(\$this->dispatcher->trigger_event('dispatch.one2', compact(\$vars)));", 'dispatch.one2'), array("extract(\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars)));", 'dis_patch.one'), + array("extract(\$phpbb_dispatcher->trigger_event(['dis_patch.one', 'dis_patch.one2'], compact(\$vars)));", 'dis_patch.one'), + array("extract(\$phpbb_dispatcher->trigger_event(['dis_patch.one', 'dis_patch.one2', 'dis_patch.two3'], compact(\$vars)));", 'dis_patch.one'), ); } @@ -301,6 +319,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', \$vars));"), array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$var)));"), array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$array)));"), + array("extract(\$phpbb_dispatcher->trigger_event(['dispatch.one'], compact(\$vars)));"), array("\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars));", 'dis_patch.one'), ); } diff --git a/tests/feed/attachments_base_test.php b/tests/feed/attachments_base_test.php index dd432d13f5..573218be42 100644 --- a/tests/feed/attachments_base_test.php +++ b/tests/feed/attachments_base_test.php @@ -31,13 +31,25 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case $this->filesystem = new \phpbb\filesystem(); $config = new \phpbb\config\config(array()); + $path_helper = new \phpbb\path_helper( + new \phpbb\symfony_request( + new phpbb_mock_request() + ), + $this->filesystem, + $this->getMock('\phpbb\request\request'), + $phpbb_root_path, + 'php' + ); $user = new \phpbb\user( new \phpbb\language\language( new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx) ), '\phpbb\datetime' ); - $feed_helper = new \phpbb\feed\helper($config, $user, $phpbb_root_path, $phpEx); + $container = new phpbb_mock_container_builder(); + $this->get_test_case_helpers()->set_s9e_services($container); + $container->set('feed.quote_helper', new \phpbb\feed\quote_helper($user, $phpbb_root_path, 'php')); + $feed_helper = new \phpbb\feed\helper($config, $container, $path_helper, $container->get('text_formatter.renderer'), $user); $db = $this->new_dbal(); $cache = new \phpbb_mock_cache(); $auth = new \phpbb\auth\auth(); diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php index f32b4339a8..d481bde80d 100644 --- a/tests/functions/make_clickable_email_test.php +++ b/tests/functions/make_clickable_email_test.php @@ -17,9 +17,10 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case { parent::setUp(); - global $config, $user, $request; + global $config, $user, $request, $symfony_request; $user = new phpbb_mock_user(); $request = new phpbb_mock_request(); + $symfony_request = new \phpbb\symfony_request($request); } /** @@ -168,7 +169,7 @@ class phpbb_functions_make_clickable_email_test extends phpbb_test_case array('abc,def@example.com'), // invalid character , array('abc<def@example.com'), // invalid character < array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character > - + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php array('missingDomain@.com'), array('@missingLocal.org'), diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php index 48fc2c19fb..a351a6d527 100644 --- a/tests/functions/make_clickable_test.php +++ b/tests/functions/make_clickable_test.php @@ -146,9 +146,10 @@ class phpbb_functions_make_clickable_test extends phpbb_test_case { parent::setUp(); - global $config, $user, $request; + global $config, $user, $request, $symfony_request; $user = new phpbb_mock_user(); $request = new phpbb_mock_request(); + $symfony_request = new \phpbb\symfony_request($request); } /** diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index eb56049515..c9943c4302 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -572,6 +572,9 @@ class phpbb_functional_test_case extends phpbb_test_case $config['rand_seed'] = ''; $config['rand_seed_last_update'] = time() + 600; + // Prevent new user to have an invalid style + $config['default_style'] = 1; + // Required by user_add global $db, $cache, $phpbb_dispatcher, $phpbb_container; $db = $this->get_db(); diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 82b1b0043b..fd9b4e4c09 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -34,7 +34,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case public function get_factory($styles_path = null) { - global $config, $phpbb_root_path, $request, $user; + global $config, $phpbb_root_path, $request, $symfony_request, $user; if (!isset($styles_path)) { @@ -69,6 +69,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case 'server_protocol' => 'http://', )); $request = new phpbb_mock_request; + $symfony_request = new \phpbb\symfony_request($request); $user = new phpbb_mock_user; return $factory; @@ -152,7 +153,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case public function test_local_url() { - global $config, $user, $request; + global $config, $user, $request, $symfony_request; $config = new \phpbb\config\config(array( 'force_server_vars' => true, 'server_protocol' => 'http://', @@ -163,6 +164,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case )); $user = new phpbb_mock_user; $request = new phpbb_mock_request; + $symfony_request = new \phpbb\symfony_request($request); $fixture = __DIR__ . '/fixtures/local_url.xml'; $renderer = $this->get_test_case_helpers()->set_s9e_services(null, $fixture)->get('text_formatter.renderer'); |