diff options
43 files changed, 390 insertions, 157 deletions
diff --git a/build/build.xml b/build/build.xml index 0a5448f98d..ebc1f0be8b 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,9 +2,9 @@ <project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <!-- a few settings for the build --> - <property name="newversion" value="3.1.0-a1" /> - <property name="prevversion" value="3.0.12" /> - <property name="olderversions" value="3.0.11" /> + <property name="newversion" value="3.1.0-a2" /> + <property name="prevversion" value="3.1.0-a1" /> + <property name="olderversions" value="3.0.12" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index f61ed5f87f..84143a2362 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -141,10 +141,17 @@ services: class: phpbb\event\extension_subscriber_loader arguments: - @dispatcher - - @ext.manager + - @event.listener_collection calls: - [load, []] + event.listener_collection: + class: phpbb\di\service_collection + arguments: + - @service_container + tags: + - { name: service_collection, tag: event.listener } + ext.manager: class: phpbb\extension\manager arguments: @@ -237,6 +244,7 @@ services: - @notification.method_collection - @service_container - @user_loader + - @config - @dbal.conn - @cache - @user diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7c96dd1b78..b10d2772a2 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -46,6 +46,7 @@ <ol> <li><a href="#changelog">Changelog</a> <ol style="list-style-type: lower-roman;"> + <li><a href="#v310a1">Changes since 3.1.0-a1</a></li> <li><a href="#v30x">Changes since 3.0.x</a></li> <li><a href="#v3011">Changes since 3.0.11</a></li> <li><a href="#v3010">Changes since 3.0.10</a></li> @@ -87,7 +88,83 @@ <div class="content"> - <a name="v30x"></a><h3>1.i. Changes since 3.0.x</h3> + <a name="v310a1"></a><h3>1.i. Changes since 3.1.0-a1</h3> + +<h4>Bug</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-4776">PHPBB3-4776</a>] - Long post gets hidden behind posting profile</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10449">PHPBB3-10449</a>] - Lines spilling in subscriptions view</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10948">PHPBB3-10948</a>] - Color swatch in 3.1 does not display properly</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11030">PHPBB3-11030</a>] - I beam cursor in prosilver when hovering on browse button for uploading attachments</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11073">PHPBB3-11073</a>] - Reported/Unapproved moderator information in viewtopic is striked through instead of underlined</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11138">PHPBB3-11138</a>] - Resync features in ACP should not use AJAX</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11280">PHPBB3-11280</a>] - Double clicking "mark topics read" produces an error the second time</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11525">PHPBB3-11525</a>] - phpbb_avatar_manager::clean_row collapses user_id and group_id</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11534">PHPBB3-11534</a>] - Remote avatar does not properly check if remote file is an image</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11626">PHPBB3-11626</a>] - Auth ACP options should be moved to separate html file</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11663">PHPBB3-11663</a>] - In generate_text_for_storage the function does not check for errors of parse_message:parse() and act accordingly</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11691">PHPBB3-11691</a>] - Soft delete migration conversion should be staggered</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11739">PHPBB3-11739</a>] - Wrong name for UCP Module "Edit "Remember Me" login keys"</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11842">PHPBB3-11842</a>] - Create a new group Error with avatar driver</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11857">PHPBB3-11857</a>] - Avatar manager must not depend on entire container</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11872">PHPBB3-11872</a>] - MCP: Users with most warnings list is invalid</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11896">PHPBB3-11896</a>] - "Mark all notifications read" does not work</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11899">PHPBB3-11899</a>] - New ajax poll vote should give feedback while waiting for servers response</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11916">PHPBB3-11916</a>] - Remove files from hidden attach list after deletion</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11922">PHPBB3-11922</a>] - Migrator fails to remove columns on MSSQL when they have/had an index</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11923">PHPBB3-11923</a>] - UCP avatar error when user has no permissions to change his/her avatar</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11924">PHPBB3-11924</a>] - Add a script to export the events in wiki format</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11926">PHPBB3-11926</a>] - Plupload Migration has a broken dependency.</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11927">PHPBB3-11927</a>] - Missing Files after 3.1.0-A1 Automatic Updater</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11930">PHPBB3-11930</a>] - Avatar paths are incorrect when using app.php</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11935">PHPBB3-11935</a>] - Invalid HTML in "Sort By" form elements in Prosilver</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11936">PHPBB3-11936</a>] - Fixes to Notifications Window</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11939">PHPBB3-11939</a>] - Quick reply editor has unnecessary data-ajax attribute</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11943">PHPBB3-11943</a>] - $VAR = false has unexpected result</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11945">PHPBB3-11945</a>] - Focused buttons are hard to notice</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11947">PHPBB3-11947</a>] - Notification popup does not appear when clicking number in text</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11948">PHPBB3-11948</a>] - Extensions should be allowed to have more then 1 routing file</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11949">PHPBB3-11949</a>] - cannot upgrade to 3.1</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11960">PHPBB3-11960</a>] - Responsive design removed teampage names</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11972">PHPBB3-11972</a>] - Add template event posting_editor_subject_after</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11977">PHPBB3-11977</a>] - Ajax delete should disable moving options</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11982">PHPBB3-11982</a>] - Navigation is shown above AJAX background in ACP</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11983">PHPBB3-11983</a>] - Subscriptions argument missing from docblock in ucp_notifications</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11986">PHPBB3-11986</a>] - Undefined index: poster_id in file.php</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11987">PHPBB3-11987</a>] - {ROOT_PATH} in ACP leads to adm/</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11990">PHPBB3-11990</a>] - Remove result_mssqlnative from acp_database</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11991">PHPBB3-11991</a>] - PHP notices when closing reported posts entries in MCP</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11992">PHPBB3-11992</a>] - Wrong variable to close "Users with most warnings" block at MCP</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11994">PHPBB3-11994</a>] - Admin options for extensions are bad/misleading</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11995">PHPBB3-11995</a>] - Reverting a config.remove fails</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12002">PHPBB3-12002</a>] - Extension management page should use generate/check link hash</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12007">PHPBB3-12007</a>] - Default last_result of callable steps must be integer instead of false</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12008">PHPBB3-12008</a>] - "Prune notifications" cron task always ran, blocking others</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12016">PHPBB3-12016</a>] - Event listeners should be services</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12017">PHPBB3-12017</a>] - Extension tests are broken on current develop</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12018">PHPBB3-12018</a>] - Use path_helper for admin style CSS in sql report</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12023">PHPBB3-12023</a>] - New css files missing after update</li> +</ul> +<h4>Improvement</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11552">PHPBB3-11552</a>] - Responsive design for prosilver</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11746">PHPBB3-11746</a>] - Add "account activation required" notification for Administrators</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11921">PHPBB3-11921</a>] - Improve Notifications and PMs in the header</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11928">PHPBB3-11928</a>] - Replace AJAX loading info pop up with animation</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11957">PHPBB3-11957</a>] - Responsive design for admin control panel</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11973">PHPBB3-11973</a>] - Remove logic from language files where possible</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11974">PHPBB3-11974</a>] - All timezones should be translatable</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11975">PHPBB3-11975</a>] - Add ACP link next to MCP</li> +</ul> +<h4>Task</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11031">PHPBB3-11031</a>] - Bring phpBB2 converter up to speed with 3.1 changes</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11980">PHPBB3-11980</a>] - Setup PHP Code Sniffer</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11981">PHPBB3-11981</a>] - Review/Fix Code Sniffer complaints</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li> +</ul> + + <a name="v30x"></a><h3>1.ii. Changes since 3.0.x</h3> <h4>Bug</h4> <ul> @@ -768,7 +845,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li> </ul> - <a name="v3011"></a><h3>1.ii. Changes since 3.0.11</h3> + <a name="v3011"></a><h3>1.iii. Changes since 3.0.11</h3> <h4>Bug</h4> <ul> @@ -923,7 +1000,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li> </ul> - <a name="v3010"></a><h3>1.iii. Changes since 3.0.10</h3> + <a name="v3010"></a><h3>1.iv. Changes since 3.0.10</h3> <h4>Bug</h4> <ul> @@ -1048,7 +1125,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li> </ul> - <a name="v309"></a><h3>1.iv. Changes since 3.0.9</h3> + <a name="v309"></a><h3>1.v. Changes since 3.0.9</h3> <h4>Bug</h4> <ul> @@ -1184,7 +1261,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li> </ul> - <a name="v308"></a><h3>1.v. Changes since 3.0.8</h3> + <a name="v308"></a><h3>1.vi. Changes since 3.0.8</h3> <h4> Bug </h4> @@ -1552,7 +1629,7 @@ </ul> - <a name="v307-PL1"></a><h3>1.vi. Changes since 3.0.7-PL1</h3> + <a name="v307-PL1"></a><h3>1.vii. Changes since 3.0.7-PL1</h3> <h4> Security </h4> <ul> @@ -2010,13 +2087,13 @@ </ul> - <a name="v307"></a><h3>1.vii. Changes since 3.0.7</h3> + <a name="v307"></a><h3>1.viii. Changes since 3.0.7</h3> <ul> <li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li> </ul> - <a name="v306"></a><h3>1.viii. Changes since 3.0.6</h3> + <a name="v306"></a><h3>1.ix. Changes since 3.0.6</h3> <ul> <li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li> @@ -2120,7 +2197,7 @@ </ul> - <a name="v305"></a><h3>1.ix. Changes since 3.0.5</h3> + <a name="v305"></a><h3>1.x. Changes since 3.0.5</h3> <ul> <li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li> @@ -2342,7 +2419,7 @@ <li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li> </ul> - <a name="v304"></a><h3>1.x. Changes since 3.0.4</h3> + <a name="v304"></a><h3>1.xi. Changes since 3.0.4</h3> <ul> <li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li> @@ -2431,7 +2508,7 @@ <li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li> </ul> - <a name="v303"></a><h3>1.xi. Changes since 3.0.3</h3> + <a name="v303"></a><h3>1.xii. Changes since 3.0.3</h3> <ul> <li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li> @@ -2463,7 +2540,7 @@ <li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li> </ul> - <a name="v302"></a><h3>1.xii. Changes since 3.0.2</h3> + <a name="v302"></a><h3>1.xiii. Changes since 3.0.2</h3> <ul> <li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li> @@ -2562,7 +2639,7 @@ <li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li> </ul> - <a name="v301"></a><h3>1.xiii. Changes since 3.0.1</h3> + <a name="v301"></a><h3>1.xiv. Changes since 3.0.1</h3> <ul> <li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li> @@ -2610,7 +2687,7 @@ <li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li> </ul> - <a name="v300"></a><h3>1.xiv Changes since 3.0.0</h3> + <a name="v300"></a><h3>1.xv Changes since 3.0.0</h3> <ul> <li>[Change] Validate birthdays (Bug #15004)</li> @@ -2681,7 +2758,7 @@ <li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li> </ul> - <a name="v30rc8"></a><h3>1.xv. Changes since 3.0.RC8</h3> + <a name="v30rc8"></a><h3>1.xvi. Changes since 3.0.RC8</h3> <ul> <li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li> @@ -2690,7 +2767,7 @@ <li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li> </ul> - <a name="v30rc7"></a><h3>1.xvi. Changes since 3.0.RC7</h3> + <a name="v30rc7"></a><h3>1.xvii. Changes since 3.0.RC7</h3> <ul> <li>[Fix] Fixed MSSQL related bug in the update system</li> @@ -2725,7 +2802,7 @@ <li>[Fix] No duplication of active topics (Bug #15474)</li> </ul> - <a name="v30rc6"></a><h3>1.xvii. Changes since 3.0.RC6</h3> + <a name="v30rc6"></a><h3>1.xviii. Changes since 3.0.RC6</h3> <ul> <li>[Fix] Submitting language changes using acp_language (Bug #14736)</li> @@ -2735,7 +2812,7 @@ <li>[Fix] Able to request new password (Bug #14743)</li> </ul> - <a name="v30rc5"></a><h3>1.xviii. Changes since 3.0.RC5</h3> + <a name="v30rc5"></a><h3>1.xix. Changes since 3.0.RC5</h3> <ul> <li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li> @@ -2798,7 +2875,7 @@ <li>[Sec] New password hashing mechanism for storing passwords (#i42)</li> </ul> - <a name="v30rc4"></a><h3>1.xix. Changes since 3.0.RC4</h3> + <a name="v30rc4"></a><h3>1.xx. Changes since 3.0.RC4</h3> <ul> <li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li> @@ -2849,7 +2926,7 @@ <li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li> </ul> - <a name="v30rc3"></a><h3>1.xx. Changes since 3.0.RC3</h3> + <a name="v30rc3"></a><h3>1.xxi. Changes since 3.0.RC3</h3> <ul> <li>[Fix] Fixing some subsilver2 and prosilver style issues</li> @@ -2958,7 +3035,7 @@ </ul> - <a name="v30rc2"></a><h3>1.xxi. Changes since 3.0.RC2</h3> + <a name="v30rc2"></a><h3>1.xxii. Changes since 3.0.RC2</h3> <ul> <li>[Fix] Re-allow searching within the memberlist</li> @@ -3004,7 +3081,7 @@ </ul> - <a name="v30rc1"></a><h3>1.xxii. Changes since 3.0.RC1</h3> + <a name="v30rc1"></a><h3>1.xxiii. Changes since 3.0.RC1</h3> <ul> <li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 23e63ed7e4..b15b8b2e6e 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -111,6 +111,14 @@ overall_footer_breadcrumb_append * Since: 3.1.0-a1 * Purpose: Add links to the list of breadcrumbs in the footer +overall_footer_content_after +=== +* Locations: + + styles/prosilver/template/overall_footer.html + + styles/subsilver2/template/overall_footer.html +* Since: 3.1.0-a3 +* Purpose: Add content on all pages after the main content, before the footer + overall_footer_copyright_append === * Locations: @@ -135,6 +143,14 @@ overall_header_breadcrumb_append * Since: 3.1.0-a1 * Purpose: Add links to the list of breadcrumbs in the header +overall_header_content_before +=== +* Locations: + + styles/prosilver/template/overall_header.html + + styles/subsilver2/template/overall_header.html +* Since: 3.1.0-a3 +* Purpose: Add content on all pages before the main content, after the header + overall_header_head_append === * Locations: diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 6ad1f12813..c170c67d49 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -324,7 +324,7 @@ class acp_groups $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fd9c17f171..6b86cb4a5a 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1745,7 +1745,7 @@ class acp_users $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the user_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($user_row); + $avatar_data = \phpbb\avatar\manager::clean_row($user_row, 'user'); if ($submit) { diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index e1da41d106..855b6ff187 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.0-a2-dev'); +define('PHPBB_VERSION', '3.1.0-a3-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index c6ab5df90f..f03e4c01d0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1352,7 +1352,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank */ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false) { - $row = \phpbb\avatar\manager::clean_row($user_row); + $row = \phpbb\avatar\manager::clean_row($user_row, 'user'); return phpbb_get_avatar($row, $alt, $ignore_config); } @@ -1367,7 +1367,7 @@ function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = */ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false) { - $row = \phpbb\avatar\manager::clean_row($user_row); + $row = \phpbb\avatar\manager::clean_row($user_row, 'group'); return phpbb_get_avatar($row, $alt, $ignore_config); } diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 10e9878cc8..deb304b838 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -569,7 +569,7 @@ function phpbb_ignore_new_file_on_update($phpbb_root_path, $file) if (!$ignore_new_file && strpos($file, 'styles/') === 0) { $dirs = explode('/', $file); - if ($dirs >= 5) + if (sizeof($dirs) >= 5) { list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file); if ($template_component == 'theme' && $language_iso !== 'images') diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 1d08a8263b..716289eded 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -465,7 +465,7 @@ class ucp_groups $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($group_row); + $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); } // Did we submit? diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 5a896c31b0..63dbe79666 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -27,7 +27,8 @@ class ucp_notifications add_form_key('ucp_notification'); $start = $request->variable('start', 0); - $form_time = min($request->variable('form_time', 0), time()); + $form_time = $request->variable('form_time', 0); + $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time; $phpbb_notifications = $phpbb_container->get('notification_manager'); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 3f58ce20b4..f7c6aca9e8 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -567,7 +567,7 @@ class ucp_profile $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the user_ prefix - $avatar_data = \phpbb\avatar\manager::clean_row($user->data); + $avatar_data = \phpbb\avatar\manager::clean_row($user->data, 'user'); if ($submit) { diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index de4e04a8e5..dd4ef13e49 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -33,7 +33,7 @@ $dbms = phpbb_convert_30_dbms_to_31($dbms); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.1.0-a2-dev', + 'phpbb_version' => '3.1.0-a2', 'author' => '<a href="https://www.phpbb.com/">phpBB Group</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 794def40dc..8a16526f36 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -232,7 +232,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_expire_days', '30'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_last_gc', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_gc', '86400'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1'); @@ -270,7 +269,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0 INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-a2-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-a3-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -288,6 +287,7 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_us INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('plupload_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed_last_update', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('read_notification_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index a939689f9c..2b1935dfca 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -416,14 +416,17 @@ $lang = array_merge($lang, array( 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', 'NOTIFICATIONS' => 'Notifications', 'NOTIFICATION_BOOKMARK' => '%1$s replied to the topic "%2$s" you have bookmarked.', + 'NOTIFICATION_BOOKMARK_TRIMMED' => '%1$s and %3$d others replied to the topic “%2$s” you have bookmarked.', 'NOTIFICATION_GROUP_REQUEST' => '%1$s is requesting to join the group %2$s.', 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Your request to join the group %1$s has been approved.', 'NOTIFICATION_PM' => '%1$s sent you a Private Message "%2$s".', 'NOTIFICATION_POST' => '%1$s replied to the topic "%2$s".', + 'NOTIFICATION_POST_TRIMMED' => '%1$s and %3$d others replied to the topic “%2$s”', 'NOTIFICATION_POST_APPROVED' => 'Your post was approved "%2$s".', 'NOTIFICATION_POST_DISAPPROVED' => 'Your post "%1$s" was disapproved for reason: "%2$s".', 'NOTIFICATION_POST_IN_QUEUE' => 'A new post titled "%2$s" was posted by %1$s and needs approval.', 'NOTIFICATION_QUOTE' => '%1$s quoted you in the post "%2$s".', + 'NOTIFICATION_QUOTE_TRIMMED' => '%1$s and %3$d others replied to the topic “%2$s”', 'NOTIFICATION_REPORT_PM' => '%1$s reported a Private Message "%2$s" for reason: "%3$s".', 'NOTIFICATION_REPORT_POST' => '%1$s reported a post "%2$s" for reason: "%3$s".', 'NOTIFICATION_REPORT_CLOSED' => '%1$s closed the report you made for "%2$s".', diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt index 529478eae2..d5272d7416 100644 --- a/phpBB/language/en/email/topic_notify.txt +++ b/phpBB/language/en/email/topic_notify.txt @@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}" Hello {USERNAME}, -You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. No more notifications will be sent until you visit the topic. If you want to view the newest post made since your last visit, click the following link: {U_NEWEST_POST} @@ -14,7 +14,6 @@ If you want to view the forum, click the following link: {U_FORUM} If you no longer wish to watch this topic you can either click the "Unsubscribe topic" link found at the bottom of the topic above, or by clicking the following link: - {U_STOP_WATCHING_TOPIC} {EMAIL_SIG} diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 5fe5e2b0a1..6ce924d2eb 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -178,14 +178,16 @@ class manager } /** - * Strip out user_ and group_ prefixes from keys + * Strip out user_, group_, or other prefixes from array keys * - * @param array $row User data or group data + * @param array $row User data or group data + * @param string $prefix Prefix of data keys (e.g. user), should not include the trailing underscore * - * @return array User data or group data with keys that have been - * stripped from the preceding "user_" or "group_" + * @return array User or group data with keys that have been + * stripped from the preceding "user_" or "group_" + * Also the group id is prefixed with g, when the prefix group is removed. */ - static public function clean_row($row) + static public function clean_row($row, $prefix = '') { // Upon creation of a user/group $row might be empty if (empty($row)) @@ -193,23 +195,19 @@ class manager return self::$default_row; } - $keys = array_keys($row); - $values = array_values($row); - - $keys = array_map(array('\phpbb\avatar\manager', 'strip_prefix'), $keys); + $output = array(); + foreach ($row as $key => $value) + { + $key = preg_replace("#^(?:{$prefix}_)#", '', $key); + $output[$key] = $value; + } - return array_combine($keys, $values); - } + if ($prefix === 'group' && isset($output['id'])) + { + $output['id'] = 'g' . $output['id']; + } - /** - * Strip prepending user_ or group_ prefix from key - * - * @param string Array key - * @return string Key that has been stripped from its prefix - */ - static protected function strip_prefix($key) - { - return preg_replace('#^(?:user_|group_)#', '', $key); + return $output; } /** diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 58d0b61519..d721ed2eb7 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -816,7 +816,7 @@ class driver */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $phpbb_admin_path, $user; + global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user; global $request; if (is_object($request) && !$request->variable('explain', false)) @@ -846,7 +846,7 @@ class driver <head> <meta charset="utf-8"> <title>SQL Report</title> - <link href="' . htmlspecialchars($phpbb_admin_path) . 'style/admin.css" rel="stylesheet" type="text/css" media="screen" /> + <link href="' . htmlspecialchars($phpbb_path_helper->update_web_root_path($phpbb_root_path) . $phpbb_path_helper->get_adm_relative_path()) . 'style/admin.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body id="errorpage"> <div id="wrap"> diff --git a/phpBB/phpbb/db/migration/data/v310/alpha2.php b/phpBB/phpbb/db/migration/data/v310/alpha2.php new file mode 100644 index 0000000000..3c0853f924 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/alpha2.php @@ -0,0 +1,28 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class alpha2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha1', + '\phpbb\db\migration\data\v310\notifications_cron_p2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-a2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php new file mode 100644 index 0000000000..050e679cc0 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php @@ -0,0 +1,27 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class notifications_cron_p2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications_cron'); + } + + public function update_data() + { + return array( + // Make read_notification_last_gc dynamic. + array('config.remove', array('read_notification_last_gc')), + array('config.add', array('read_notification_last_gc', 0, 1)), + ); + } +} diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php index df8e093f4a..6408f93e2a 100644 --- a/phpBB/phpbb/event/extension_subscriber_loader.php +++ b/phpBB/phpbb/event/extension_subscriber_loader.php @@ -14,26 +14,22 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; class extension_subscriber_loader { private $dispatcher; - private $extension_manager; + private $listener_collection; - public function __construct(EventDispatcherInterface $dispatcher, \phpbb\extension\manager $extension_manager) + public function __construct(EventDispatcherInterface $dispatcher, \phpbb\di\service_collection $listener_collection) { $this->dispatcher = $dispatcher; - $this->extension_manager = $extension_manager; + $this->listener_collection = $listener_collection; } public function load() { - $finder = $this->extension_manager->get_finder(); - $subscriber_classes = $finder - ->extension_directory('/event') - ->core_path('event/') - ->get_classes(); - - foreach ($subscriber_classes as $class) + if (!empty($this->listener_collection)) { - $subscriber = new $class(); - $this->dispatcher->addSubscriber($subscriber); + foreach ($this->listener_collection as $listener) + { + $this->dispatcher->addSubscriber($listener); + } } } } diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index d77a936413..2e8652771b 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -27,6 +27,9 @@ class manager /** @var \phpbb\user_loader */ protected $user_loader; + /** @var \phpbb\config\config */ + protected $config; + /** @var \phpbb\db\driver\driver */ protected $db; @@ -58,6 +61,7 @@ class manager * @param array $notification_methods * @param ContainerBuilder $phpbb_container * @param \phpbb\user_loader $user_loader + * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver $db * @param \phpbb\user $user * @param string $phpbb_root_path @@ -67,13 +71,14 @@ class manager * @param string $user_notifications_table * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; $this->phpbb_container = $phpbb_container; $this->user_loader = $user_loader; + $this->config = $config; $this->db = $db; $this->cache = $cache; $this->user = $user; @@ -797,6 +802,8 @@ class manager WHERE notification_time < ' . (int) $timestamp . (($only_read) ? ' AND notification_read = 1' : ''); $this->db->sql_query($sql); + + $this->config->set('read_notification_last_gc', time(), false); } /** diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 9d5c7b0a4c..c2854c17af 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -183,6 +183,10 @@ class post extends \phpbb\notification\type\base 'username' => $this->get_data('post_username'), )), $responders); + $responders_cnt = sizeof($responders); + $responders = $this->trim_user_ary($responders); + $trimmed_responders_cnt = $responders_cnt - sizeof($responders); + foreach ($responders as $responder) { if ($responder['username']) @@ -194,11 +198,18 @@ class post extends \phpbb\notification\type\base $usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile'); } } + $lang_key = $this->language_key; + + if ($trimmed_responders_cnt) + { + $lang_key .= '_TRIMMED'; + } return $this->user->lang( - $this->language_key, - implode(', ', $usernames), - censor_text($this->get_data('topic_title')) + $lang_key, + implode($this->user->lang['COMMA_SEPARATOR'], $usernames), + censor_text($this->get_data('topic_title')), + $trimmed_responders_cnt ); } @@ -234,7 +245,7 @@ class post extends \phpbb\notification\type\base 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", - 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread", + 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread", 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", @@ -272,6 +283,22 @@ class post extends \phpbb\notification\type\base } } + return $this->trim_user_ary($users); + } + + /** + * Trim the user array passed down to 3 users if the array contains + * more than 4 users. + * + * @param array $users Array of users + * @return array Trimmed array of user_ids + */ + public function trim_user_ary($users) + { + if (sizeof($users) > 4) + { + array_splice($users, 3); + } return $users; } diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index aac9d993f5..aef7a3b12a 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -18,8 +18,8 @@ # General Information about this style name = prosilver copyright = © phpBB Group, 2007 -style_version = 3.1.0-a1 -phpbb_version = 3.1.0-a1 +style_version = 3.1.0-a2 +phpbb_version = 3.1.0-a2 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index a831ab6cb4..e32e91432c 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -1,3 +1,4 @@ + <!-- EVENT overall_footer_content_after --> </div> <div id="page-footer"> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 6186fe051e..eb2d2cbafd 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -180,3 +180,5 @@ </div> </div> <!-- ENDIF --> + + <!-- EVENT overall_header_content_before --> diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index 1d50352885..b588567153 100644 --- a/phpBB/styles/subsilver2/style.cfg +++ b/phpBB/styles/subsilver2/style.cfg @@ -18,8 +18,8 @@ # General Information about this style name = subsilver2 copyright = © 2005 phpBB Group -style_version = 3.1.0-a1 -phpbb_version = 3.1.0-a1 +style_version = 3.1.0-a2 +phpbb_version = 3.1.0-a2 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html index dbc9fcd7aa..d2b6f6a9d7 100644 --- a/phpBB/styles/subsilver2/template/overall_footer.html +++ b/phpBB/styles/subsilver2/template/overall_footer.html @@ -1,3 +1,5 @@ + <!-- EVENT overall_footer_content_after --> + <!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF --> </div> diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index a82a640447..16e0f6abaf 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -238,3 +238,4 @@ function marklist(id, name, state) <!-- DEFINE $S_MICRODATA = 0 --> <br /> + <!-- EVENT overall_header_content_before --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3a7e633c99..fb30be5f27 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -347,23 +347,10 @@ if ($topic_data['forum_password']) login_forum_box($topic_data); } -// Redirect to login or to the correct post upon emailed notification links -if (isset($_GET['e'])) +// Redirect to login upon emailed notification links if user is not logged in. +if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) { - $jump_to = request_var('e', 0); - - $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); - - if ($user->data['user_id'] == ANONYMOUS) - { - login_box($redirect_url . "&p=$post_id&e=$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']); - } - - if ($jump_to > 0) - { - // We direct the already logged in user to the correct post... - redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#p$jump_to"); - } + login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']); } // What is start equal to? diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 0db3f13617..527bb223d5 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -152,12 +152,24 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase return array( array( array( - 'user_avatar' => '', - 'user_avatar_type' => '', - 'user_avatar_width' => '', + 'user_avatar' => '', + 'user_avatar_type' => '', + 'user_avatar_width' => '', 'user_avatar_height' => '', + 'group_avatar' => '', ), array( + 'user_avatar' => '', + 'user_avatar_type' => '', + 'user_avatar_width' => '', + 'user_avatar_height' => '', + 'group_avatar' => '', + ), + 'foobar', + ), + array( + array(), + array( 'avatar' => '', 'avatar_type' => '', 'avatar_width' => '', @@ -166,40 +178,41 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase ), array( array( - 'group_avatar' => '', - 'group_avatar_type' => '', - 'group_avatar_width' => '', - 'group_avatar_height' => '', + 'user_avatar' => '', + 'user_id' => 5, + 'group_id' => 4, ), array( - 'avatar' => '', - 'avatar_type' => '', - 'avatar_width' => '', - 'avatar_height' => '', + 'user_avatar' => '', + 'user_id' => 5, + 'group_id' => 4, ), ), array( - array(), array( - 'avatar' => '', - 'avatar_type' => '', - 'avatar_width' => '', - 'avatar_height' => '', + 'user_avatar' => '', + 'user_id' => 5, + 'group_id' => 4, + ), + array( + 'avatar' => '', + 'id' => 5, + 'group_id' => 4, ), + 'user', ), array( array( - 'foobar_avatar' => '', - 'foobar_avatar_type' => '', - 'foobar_avatar_width' => '', - 'foobar_avatar_height' => '', + 'group_avatar' => '', + 'user_id' => 5, + 'group_id' => 4, ), array( - 'foobar_avatar' => '', - 'foobar_avatar_type' => '', - 'foobar_avatar_width' => '', - 'foobar_avatar_height' => '', + 'avatar' => '', + 'id' => 'g4', + 'user_id' => 5, ), + 'group', ), ); } @@ -207,14 +220,15 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase /** * @dataProvider database_row_data */ - public function test_clean_row(array $input, array $output) + public function test_clean_row(array $input, array $output, $prefix = '') { $cleaned_row = array(); - $cleaned_row = \phpbb\avatar\manager::clean_row($input); - foreach ($output as $key => $null) + $cleaned_row = \phpbb\avatar\manager::clean_row($input, $prefix); + foreach ($output as $key => $value) { $this->assertArrayHasKey($key, $cleaned_row); + $this->assertEquals($cleaned_row[$key], $value); } } diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 41bd48c204..37752b8fbb 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -19,6 +19,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c static protected $fixtures = array( 'foo/bar/config/', 'foo/bar/controller/', + 'foo/bar/event/', + 'foo/bar/language/en/', 'foo/bar/styles/prosilver/template/', ); diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php index fb8f87e6de..094eda8257 100644 --- a/tests/functional/extension_global_lang_test.php +++ b/tests/functional/extension_global_lang_test.php @@ -17,8 +17,9 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ static private $helper; static protected $fixtures = array( - 'foo/bar/language/en/', + 'foo/bar/config/', 'foo/bar/event/', + 'foo/bar/language/en/', ); static public function setUpBeforeClass() diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php index 19adb89819..e922abdaf1 100644 --- a/tests/functional/extension_permission_lang_test.php +++ b/tests/functional/extension_permission_lang_test.php @@ -17,8 +17,9 @@ class phpbb_functional_extension_permission_lang_test extends phpbb_functional_t static private $helper; static protected $fixtures = array( - 'foo/bar/language/en/', + 'foo/bar/config/', 'foo/bar/event/', + 'foo/bar/language/en/', ); static public function setUpBeforeClass() diff --git a/tests/functional/fixtures/ext/foo/bar/composer.json b/tests/functional/fixtures/ext/foo/bar/composer.json index cb9dbc9514..e3e5fc21cd 100644 --- a/tests/functional/fixtures/ext/foo/bar/composer.json +++ b/tests/functional/fixtures/ext/foo/bar/composer.json @@ -14,7 +14,7 @@ }], "require": { "php": ">=5.3", - "phpbb": "3.1.*@dev" + "phpbb/phpbb": "3.1.*@dev" }, "extra": { "display-name": "phpBB 3.1 Extension Testing" diff --git a/tests/functional/fixtures/ext/foo/bar/config/services.yml b/tests/functional/fixtures/ext/foo/bar/config/services.yml index 3bca4c6567..64e1163408 100644 --- a/tests/functional/fixtures/ext/foo/bar/config/services.yml +++ b/tests/functional/fixtures/ext/foo/bar/config/services.yml @@ -4,3 +4,12 @@ services: arguments: - @controller.helper - @template + foo_bar.listener.permission: + class: foo\bar\event\permission + tags: + - { name: event.listener } + foo_bar.listener.user_setup: + class: foo\bar\event\user_setup + tags: + - { name: event.listener } + diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission.php b/tests/functional/fixtures/ext/foo/bar/event/permission.php index 92e24074ad..9b319dd35f 100644 --- a/tests/functional/fixtures/ext/foo/bar/event/permission.php +++ b/tests/functional/fixtures/ext/foo/bar/event/permission.php @@ -11,15 +11,6 @@ namespace foo\bar\event; /** -* @ignore -*/ - -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Event listener */ use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php index 1409f97470..8fa7ac97da 100644 --- a/tests/functional/fixtures/ext/foo/bar/event/user_setup.php +++ b/tests/functional/fixtures/ext/foo/bar/event/user_setup.php @@ -11,15 +11,6 @@ namespace foo\bar\event; /** -* @ignore -*/ - -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** * Event listener */ use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index 7f33ad1859..dd1b8ec981 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -52,4 +52,37 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case $this->assert_checkbox_is_unchecked($cplist, $checkbox_name); } } + + public function test_mark_notifications_read() + { + // Create a new standard user + $this->create_user('notificationtestuser'); + $this->add_user_group('NEWLY_REGISTERED', array('notificationtestuser')); + $this->login('notificationtestuser'); + $crawler = self::request('GET', 'index.php'); + $this->assertContains('notificationtestuser', $crawler->filter('.icon-logout')->text()); + + // Post a new post that needs approval + $this->create_post(2, 1, 'Re: Welcome to phpBB3', 'This is a test [b]post[/b] posted by notificationtestuser.', array(), 'POST_STORED_MOD'); + $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}"); + $this->assertNotContains('This is a test post posted by notificationtestuser.', $crawler->filter('html')->text()); + + // logout + $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); + + // admin login + $this->login(); + $this->add_lang('ucp'); + $crawler = self::request('GET', 'ucp.php?i=ucp_notifications'); + + // At least one notification should exist + $this->assertGreaterThan(0, $crawler->filter('#notification_list_button strong')->text()); + + // Get form token + $link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri(); + $crawler = self::request('GET', substr($link, strpos($link, 'ucp.'))); + $form = $crawler->selectButton($this->lang('YES'))->form(); + $crawler = self::submit($form); + $this->assertEquals(0, $crawler->filter('#notification_list_button strong')->text()); + } } diff --git a/tests/functions_install/ignore_new_file_on_update_test.php b/tests/functions_install/ignore_new_file_on_update_test.php index ae1dde96f7..703da4e435 100644 --- a/tests/functions_install/ignore_new_file_on_update_test.php +++ b/tests/functions_install/ignore_new_file_on_update_test.php @@ -25,6 +25,8 @@ class phpbb_functions_install_ignore_new_file_on_update_test extends phpbb_test_ array('styles/prosilver/theme/en/icon_user_online.gif', false), array('styles/prosilver/theme/languagewillneverexist/icon_user_online.gif', true), + + array('styles/prosilver/theme/imageset.css', false), ); } diff --git a/tests/notification/base.php b/tests/notification/base.php index 549545f01b..f6333866c3 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -70,6 +70,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case array(), $this->container, $this->user_loader, + $this->config, $this->db, $this->cache, $this->user, diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index 8597c626a4..a9ed59686a 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -118,7 +118,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case // Notification Manager $phpbb_notifications = new \phpbb\notification\manager($notification_types_array, array(), - $phpbb_container, $user_loader, $db, $cache, $user, + $phpbb_container, $user_loader, $config, $db, $cache, $user, $phpbb_root_path, $phpEx, NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE); $phpbb_container->set('notification_manager', $phpbb_notifications); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index a0d186e0f2..eba5a2dfdf 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -868,9 +868,10 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $subject * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request - * @return array post_id, topic_id + * @param string $expected Lang var of expected message after posting + * @return array|null post_id, topic_id if message is 'POST_STORED' */ - public function create_topic($forum_id, $subject, $message, $additional_form_data = array()) + public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') { $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; @@ -880,7 +881,7 @@ class phpbb_functional_test_case extends phpbb_test_case 'post' => true, ), $additional_form_data); - return self::submit_post($posting_url, 'POST_TOPIC', $form_data); + return self::submit_post($posting_url, 'POST_TOPIC', $form_data, $expected); } /** @@ -893,9 +894,10 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $subject * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request - * @return array post_id, topic_id + * @param string $expected Lang var of expected message after posting + * @return array|null post_id, topic_id if message is 'POST_STORED' */ - public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array()) + public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') { $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; @@ -905,7 +907,7 @@ class phpbb_functional_test_case extends phpbb_test_case 'post' => true, ), $additional_form_data); - return self::submit_post($posting_url, 'POST_REPLY', $form_data); + return self::submit_post($posting_url, 'POST_REPLY', $form_data, $expected); } /** @@ -914,9 +916,10 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $posting_url * @param string $posting_contains * @param array $form_data - * @return array post_id, topic_id + * @param string $expected Lang var of expected message after posting + * @return array|null post_id, topic_id if message is 'POST_STORED' */ - protected function submit_post($posting_url, $posting_contains, $form_data) + protected function submit_post($posting_url, $posting_contains, $form_data, $expected = 'POST_STORED') { $this->add_lang('posting'); @@ -945,7 +948,12 @@ class phpbb_functional_test_case extends phpbb_test_case // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) // Instead, I send it as a request with the submit button "post" set to true. $crawler = self::request('POST', $posting_url, $form_data); - $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text()); + $this->assertContainsLang($expected, $crawler->filter('html')->text()); + + if ($expected !== 'POST_STORED') + { + return; + } $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); return array( |