diff options
58 files changed, 507 insertions, 108 deletions
diff --git a/build/build.xml b/build/build.xml index 2d1a6eb51a..b9002f5744 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.7-dev" /> - <property name="prevversion" value="3.1.6" /> - <property name="olderversions" value="3.0.12, 3.0.13, 3.0.13-PL1, 3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5" /> + <property name="newversion" value="3.1.8-dev" /> + <property name="prevversion" value="3.1.7-pl1" /> + <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7-RC1, 3.1.7" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index 14715f59e4..61904adc23 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -52,7 +52,7 @@ <dl> <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd> - <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd> + <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" /></div></dd> </dl> <!-- EVENT acp_users_prefs_personal_append --> </fieldset> diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html index a29fce6c5a..8e7599dc3f 100644 --- a/phpBB/adm/style/install_footer.html +++ b/phpBB/adm/style/install_footer.html @@ -12,7 +12,7 @@ </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> -<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js">\x3C/script>');</script><!-- ENDIF --> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- INCLUDEJS admin.js --> {$SCRIPTS} diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html index deb38c8691..8745286d64 100644 --- a/phpBB/adm/style/overall_footer.html +++ b/phpBB/adm/style/overall_footer.html @@ -34,7 +34,7 @@ </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> -<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF --> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- INCLUDEJS ajax.js --> <!-- INCLUDEJS admin.js --> diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index c08fd931a0..08ee0a739f 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -17,7 +17,7 @@ </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> -<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF --> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- EVENT acp_simple_footer_after --> diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index ca425ad0c4..239dd3932b 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -59,6 +59,8 @@ $phpbb_container->get('request')->enable_super_globals(); require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); $user = $phpbb_container->get('user'); +$user->data['user_id'] = ANONYMOUS; +$user->ip = '127.0.0.1'; $user->add_lang('acp/common'); $user->add_lang('cli'); diff --git a/phpBB/composer.json b/phpBB/composer.json index 8a177b3cf4..6b3a2c9918 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -51,5 +51,10 @@ "symfony/finder": "2.3.*", "symfony/http-foundation": "2.3.*", "symfony/process": "2.3.*" + }, + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } } } diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b1db7b6f36..97998e7d00 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -49,6 +49,8 @@ <ol> <li><a href="#changelog">Changelog</a> <ul> + <li><a href="#v317">Changes since 3.1.7</a></li> + <li><a href="#v316">Changes since 3.1.6</a></li> <li><a href="#v315">Changes since 3.1.5</a></li> <li><a href="#v314">Changes since 3.1.4</a></li> <li><a href="#v313">Changes since 3.1.3</a></li> @@ -113,6 +115,124 @@ <div class="content"> + <a name="v317"></a><h3>Changes since 3.1.7</h3> + + <h4>Security Issue</h4> + <ul> + <li>[SECURITY-188] - Check form key in acp_bbcodes</li> + </ul> + <h4>Bug</h4> + <ul> + <li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-14343">PHPBB3-14343</a>] - Undefined variable $phpbb_dispatcher when (un-)locking a topic or post</li> + </ul> + + <a name="v316"></a><h3>Changes since 3.1.6</h3> + + <h4>Bug</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8839">PHPBB3-8839</a>] - Wrong new status of subforumlink on index</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8920">PHPBB3-8920</a>] - PM-Report for every moderator</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9153">PHPBB3-9153</a>] - New member can delete pm just in one way</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9252">PHPBB3-9252</a>] - Conflict when (dis)approving a post by two moderators at the same time</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11468">PHPBB3-11468</a>] - Controllers can not set additional parameters of page_header()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11971">PHPBB3-11971</a>] - Validating not correctly in Spambot countermeasures</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12616">PHPBB3-12616</a>] - Report notification is not removed when post is disapproved or deleted</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13202">PHPBB3-13202</a>] - dead code in sessions.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13423">PHPBB3-13423</a>] - Driver sqlite3 failed periodically</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13636">PHPBB3-13636</a>] - Unexpect return to previous page behaviour</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13656">PHPBB3-13656</a>] - database_upgrade.php fails when database password contains a % character</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13748">PHPBB3-13748</a>] - Wrong tooltip after poll vote change</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13759">PHPBB3-13759</a>] - submit_post doesn't take $data['post_time'] - into account</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13799">PHPBB3-13799</a>] - Avatar gallery subfolders paths are handled incorrectly</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13831">PHPBB3-13831</a>] - Post deletion reason is not appearing on moderation logs</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13835">PHPBB3-13835</a>] - File upload of large files where filename contains umlauts fails</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13846">PHPBB3-13846</a>] - Permissions around soft deleting are inconsistently handled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13851">PHPBB3-13851</a>] - "Can ignore flood limit" permission not taking effect</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13892">PHPBB3-13892</a>] - "Someone reports a post" notification setting has no effect</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13945">PHPBB3-13945</a>] - Account re-activation does not create a notification</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13950">PHPBB3-13950</a>] - If disabled extension - no hidden permission set</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13960">PHPBB3-13960</a>] - Profile field validation may break</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13976">PHPBB3-13976</a>] - Fix comment typo in salted_md5 driver</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13988">PHPBB3-13988</a>] - Atom feeds use relative links for image attachments</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13992">PHPBB3-13992</a>] - Fix html5 error from output on w3.org its new validator</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14058">PHPBB3-14058</a>] - subsilver2 Contact us form doesn't have an email subject field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14070">PHPBB3-14070</a>] - Disabled avatar types is still displayed on the forum</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14106">PHPBB3-14106</a>] - Sorting is unworkable while moderating forum (merge topics)</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14114">PHPBB3-14114</a>] - Inconsistency in install.html in 3.1.x Automatic uopdate package</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14127">PHPBB3-14127</a>] - Error in the BBCode FAQ in 'Linking to another site'</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14142">PHPBB3-14142</a>] - Remove unused ignore_configs from avatar drivers</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14143">PHPBB3-14143</a>] - Flush the in-memory mail queue when writing it to the disk</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14153">PHPBB3-14153</a>] - Notifications dropdown header doesn't clear floats</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14159">PHPBB3-14159</a>] - Not accessible link on main ACP page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14161">PHPBB3-14161</a>] - The core.download_file_send_to_browser_before - $vars - 'extension' it does not exist</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14163">PHPBB3-14163</a>] - Select All in code bug in Edge</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14181">PHPBB3-14181</a>] - Custom report/denial reason not shown in user notifications</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14186">PHPBB3-14186</a>] - Incorrect string concatenation in phpbb_mcp_sorting()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14200">PHPBB3-14200</a>] - Allow hidden users to see theself on viewonline</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14215">PHPBB3-14215</a>] - [ticket/14212] - Adding event after users have been removed to a group</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14217">PHPBB3-14217</a>] - [ticket/13591] - Change SQL query into array to allow</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14224">PHPBB3-14224</a>] - Fix trailing whitespaces</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14228">PHPBB3-14228</a>] - Vertical align of numbers in polls</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14236">PHPBB3-14236</a>] - Race condition in the functional tests</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14242">PHPBB3-14242</a>] - Fix on memberlist the sort method.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14249">PHPBB3-14249</a>] - Online list isn't sorted anymore</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14258">PHPBB3-14258</a>] - Add event in auth::Login</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14271">PHPBB3-14271</a>] - Update nginx sample config</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14276">PHPBB3-14276</a>] - Function get_folder_status not setup for use of plurals</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14287">PHPBB3-14287</a>] - Loading indicator not removed after confirming action that does not produce a message</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14297">PHPBB3-14297</a>] - Uppercase and lowercase when sorting topics</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14334">PHPBB3-14334</a>] - Do not use deprecated function get_user_avatar() in user_loader</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14339">PHPBB3-14339</a>] - State support for PHP 7.0 in docs</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14346">PHPBB3-14346</a>] - Improve version check output when phpbb.com is unreachable</li> + </ul> + <h4>Improvement</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7362">PHPBB3-7362</a>] - Title/Post Icons Need Attribute Text</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8800">PHPBB3-8800</a>] - Add "mark topics read" link to "View unread posts"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10343">PHPBB3-10343</a>] - ACP: searching for users does not show inactive accounts</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13684">PHPBB3-13684</a>] - Only resize attached file comments vertically</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13934">PHPBB3-13934</a>] - Enctype clause for forms may be needed for profile fields</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14066">PHPBB3-14066</a>] - Add template events to search_body.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14073">PHPBB3-14073</a>] - Add core events to the several places in includes/functions_admin.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14075">PHPBB3-14075</a>] - Event in posting preview</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14080">PHPBB3-14080</a>] - Add template events to viewforum_body.html before/after/append/prepend the topic row</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14088">PHPBB3-14088</a>] - Add core events to the search.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14089">PHPBB3-14089</a>] - [Template] - posting_topic_title_after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14098">PHPBB3-14098</a>] - Add core events to the search backends (fulltext_*.php)</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14102">PHPBB3-14102</a>] - Add core event to the mcp_topic.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14113">PHPBB3-14113</a>] - Add core events to the memberlist.php for customizing members search</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14117">PHPBB3-14117</a>] - Add core events to index.php to allow modifying birthdays list</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14123">PHPBB3-14123</a>] - Add more descriptive help to the CLI commands</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14126">PHPBB3-14126</a>] - Add viewtopic_topic_title_after template event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14133">PHPBB3-14133</a>] - Comment fix for phpbb_get_user_rank()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14154">PHPBB3-14154</a>] - Include "Clean Name" for disabled Extensions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14155">PHPBB3-14155</a>] - Add row highlighting to extensions and style management</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14156">PHPBB3-14156</a>] - Add the Symfony ResponseListener</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14164">PHPBB3-14164</a>] - Helpful instructions for database updates</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14170">PHPBB3-14170</a>] - Fix mcp_change_poster_after event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14201">PHPBB3-14201</a>] - Add ACP template events</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14213">PHPBB3-14213</a>] - [PHP] - core.group_add_user_after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14219">PHPBB3-14219</a>] - Add email address into inactive user display in ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14261">PHPBB3-14261</a>] - Pages served from app.php can't disable the update of session_page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14283">PHPBB3-14283</a>] - Add a "Manage Group" link on a group page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14313">PHPBB3-14313</a>] - Don't display quote button on unapproved posts</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14343">PHPBB3-14343</a>] - Add event when locking/unlocking posts/topics</li> + </ul> + <h4>New Feature</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14144">PHPBB3-14144</a>] - [Template] - quickreply_editor_subject_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14146">PHPBB3-14146</a>] - [Template] - viewtopic_body_post_subject_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14187">PHPBB3-14187</a>] - [ACP Template] - acp_styles_before_table</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14188">PHPBB3-14188</a>] - [PHP] - core.acp_styles_action_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14191">PHPBB3-14191</a>] - [PHP] - core.get_gravatar_url_after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14192">PHPBB3-14192</a>] - [PHP] - core.memberlist_memberrow_before</li> + </ul> + <h4>Task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14140">PHPBB3-14140</a>] - Update Symfony to benefit from improvement to the console component</li> + </ul> + + <a name="v315"></a><h3>Changes since 3.1.5</h3> <h4>Bug</h4> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 4c5cdf1528..04c531c5a3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1100,6 +1100,20 @@ navbar_header_quick_links_before * Since: 3.1.0-RC2 * Purpose: Add links to the top of the quick-links drop-down menu in the header +navbar_header_user_profile_append +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.8-RC1 +* Purpose: Add links to the right of the user drop down area + +navbar_header_user_profile_prepend +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.8-RC1 +* Purpose: Add links to the left of the notification area + navbar_header_username_append === * Locations: diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index e245eea069..c98be241e9 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -33,6 +33,7 @@ class acp_bbcodes // Set up general vars $action = request_var('action', ''); $bbcode_id = request_var('bbcode', 0); + $submit = $request->is_set_post('submit'); $this->tpl_name = 'acp_bbcodes'; $this->page_title = 'ACP_BBCODES'; @@ -40,6 +41,11 @@ class acp_bbcodes add_form_key($form_key); + if ($submit && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Set up mode-specific vars switch ($action) { @@ -364,7 +370,7 @@ class acp_bbcodes * * @event core.acp_bbcodes_display_form * @var string action Type of the action: modify|create - * @var string sql_ary The SQL array to get custom bbcode data + * @var array sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data * @var string u_action The u_action link * @since 3.1.0-a3 diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index a3849d8ba1..f97711d69d 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -121,8 +121,6 @@ class acp_extensions 'U_ACTION' => $this->u_action, )); - add_form_key('version_check_settings'); - $this->tpl_name = 'acp_ext_list'; break; @@ -537,7 +535,7 @@ class acp_extensions $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user); $version_helper->set_current_version($meta['version']); - $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']); + $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false); $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index befbcdf24a..1e0264d8e9 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -672,9 +672,8 @@ class acp_groups $driver = $phpbb_avatar_manager->get_driver($current_driver); $avatars_enabled = true; - $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); $template->set_filenames(array( - 'avatar' => "acp_avatar_options_{$config_name}.html", + 'avatar' => $driver->get_acp_template_name(), )); if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error)) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4d0bbf5721..d7cdd8030a 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1587,7 +1587,7 @@ class acp_users if ($submit) { $error = validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('timezone'), @@ -1878,9 +1878,8 @@ class acp_users $driver = $phpbb_avatar_manager->get_driver($current_driver); $avatars_enabled = true; - $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); $template->set_filenames(array( - 'avatar' => "acp_avatar_options_{$config_name}.html", + 'avatar' => $driver->get_acp_template_name(), )); if ($driver->prepare_form($request, $template, $user, $avatar_data, $error)) @@ -1900,8 +1899,12 @@ class acp_users } } - // Replace "error" strings with their real, localised form - $error = $phpbb_avatar_manager->localize_errors($user, $error); + // Avatar manager is not initialized if avatars are disabled + if (isset($phpbb_avatar_manager)) + { + // Replace "error" strings with their real, localised form + $error = $phpbb_avatar_manager->localize_errors($user, $error); + } $avatar = phpbb_get_user_avatar($user_row, 'USER_AVATAR', true); diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index ab943c2f86..a1d85cf272 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -28,7 +28,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.7-dev'); +define('PHPBB_VERSION', '3.1.8-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bb1e47ecf7..094b1fd364 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4283,7 +4283,7 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' * @var string item Restrict online users to a certain * session item, e.g. forum for * session_forum_id - * @var string sql_ary SQL query to obtain users online data + * @var array sql_ary SQL query array to obtain users online data * @since 3.1.4-RC1 * @changed 3.1.7-RC1 Change sql query into array and adjust var accordingly. Allows extension authors the ability to adjust the sql_ary. */ diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 33cf55cc0b..b3641a2b45 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3101,9 +3101,9 @@ function get_database_size() { $version = $row['mysql_version']; - if (preg_match('#(3\.23|[45]\.)#', $version)) + if (preg_match('#(3\.23|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria)#', $version)) { - $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); + $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); $sql = 'SHOW TABLE STATUS FROM ' . $db_name; @@ -3112,7 +3112,7 @@ function get_database_size() $database_size = 0; while ($row = $db->sql_fetchrow($result)) { - if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB'))) + if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB' || $row['Engine'] == 'Aria'))) { if ($table_prefix != '') { diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 89bc31fa25..1aac0e803c 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -776,9 +776,18 @@ class fileupload $url = parse_url($upload_url); + $default_port = 80; + $hostname = $url['host']; + + if ($url['scheme'] == 'https') + { + $default_port = 443; + $hostname = 'tls://' . $url['host']; + } + $host = $url['host']; $path = $url['path']; - $port = (!empty($url['port'])) ? (int) $url['port'] : 80; + $port = (!empty($url['port'])) ? (int) $url['port'] : $default_port; $upload_ary['type'] = 'application/octet-stream'; @@ -818,7 +827,7 @@ class fileupload $errno = 0; $errstr = ''; - if (!($fsock = @fsockopen($host, $port, $errno, $errstr))) + if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr))) { $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); return $file; @@ -919,7 +928,7 @@ class fileupload return $file; } - $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache'; + $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? sys_get_temp_dir() : $phpbb_root_path . 'cache'; $filename = tempnam($tmp_path, unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index cdf1abd8ff..5d8aa18c16 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -54,8 +54,8 @@ function mcp_front_view($id, $mode, $action) * Allow altering the query to get the number of unapproved posts * * @event core.mcp_front_queue_unapproved_total_before - * @var int sql_ary Query to get the total number of unapproved posts - * @var array forum_list List of forums to look for unapproved posts + * @var array sql_ary Query array to get the total number of unapproved posts + * @var array forum_list List of forums to look for unapproved posts * @since 3.1.5-RC1 */ $vars = array('sql_ary', 'forum_list'); @@ -179,7 +179,7 @@ function mcp_front_view($id, $mode, $action) * Alter sql query to count the number of reported posts * * @event core.mcp_front_reports_count_query_before - * @var int sql The query string used to get the number of reports that exist + * @var string sql The query string used to get the number of reports that exist * @var array forum_list List of forums that contain the posts * @since 3.1.5-RC1 */ @@ -226,8 +226,8 @@ function mcp_front_view($id, $mode, $action) * Alter sql query to get latest reported posts * * @event core.mcp_front_reports_listing_query_before - * @var int sql_ary Associative array with the query to be executed - * @var array forum_list List of forums that contain the posts + * @var array sql_ary Associative array with the query to be executed + * @var array forum_list List of forums that contain the posts * @since 3.1.0-RC3 */ $vars = array('sql_ary', 'forum_list'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 9696605450..d0908a0d8b 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -262,7 +262,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_dispatcher; if ($action == 'lock' || $action == 'unlock') { diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index fa2fed842f..6bb606a990 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -95,7 +95,7 @@ class mcp_reports * * @event core.mcp_reports_report_details_query_before * @var array sql_ary The array in the format of the query builder with the query - * @var mixed forum_id The forum_id, the number in the f GET parameter + * @var int forum_id The forum_id, the number in the f GET parameter * @var int post_id The post_id of the report being viewed (if 0, it is meaningless) * @var int report_id The report_id of the report being viewed * @since 3.1.5-RC1 @@ -118,10 +118,10 @@ class mcp_reports * * @event core.mcp_reports_report_details_query_after * @var array sql_ary The array in the format of the query builder with the query that had been executted - * @var mixed forum_id The forum_id, the number in the f GET parameter + * @var int forum_id The forum_id, the number in the f GET parameter * @var int post_id The post_id of the report being viewed (if 0, it is meaningless) * @var int report_id The report_id of the report being viewed - * @var int report The query's resulting row. + * @var array report The query's resulting row. * @since 3.1.5-RC1 */ $vars = array( diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 3c274b53c7..e63e9b4c08 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -86,7 +86,7 @@ class ucp_prefs } $error = array_merge(validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('language_iso_name'), 'tz' => array('timezone'), )), $error); @@ -368,6 +368,49 @@ class ucp_prefs ${'s_sort_' . $sort_option . '_dir'} .= '</select>'; } + /** + * Run code before view form is displayed + * + * @event core.ucp_prefs_view_after + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp options data + * @var array sort_dir_text Array with sort dir language strings + * @var array limit_topic_days Topic ordering options + * @var array sort_by_topic_text Topic ordering language strings + * @var array sort_by_topic_sql Topic ordering sql + * @var array limit_post_days Post ordering options + * @var array sort_by_post_text Post ordering language strings + * @var array sort_by_post_sql Post ordering sql + * @var array _options Sort options + * @var string s_limit_topic_days Sort limit topic by days select box + * @var string s_sort_topic_key Sort topic key select box + * @var string s_sort_topic_dir Sort topic dir select box + * @var string s_limit_post_days Sort limit post by days select box + * @var string s_sort_post_key Sort post key select box + * @var string s_sort_post_dir Sort post dir select box + * @since 3.1.8-RC1 + */ + $vars = array( + 'submit', + 'data', + 'sort_dir_text', + 'limit_topic_days', + 'sort_by_topic_text', + 'sort_by_topic_sql', + 'limit_post_days', + 'sort_by_post_text', + 'sort_by_post_sql', + '_options', + 's_limit_topic_days', + 's_sort_topic_key', + 's_sort_topic_dir', + 's_limit_post_days', + 's_sort_post_key', + 's_sort_post_dir', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_after', compact($vars))); + $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 3a5e58cabd..56bc23c32d 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.1.6', + 'phpbb_version' => '3.1.7', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 1b6766e1b1..4f87954907 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -273,7 +273,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.7-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.8-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'); diff --git a/phpBB/language/en/app.php b/phpBB/language/en/app.php index 2da0f098c1..39c4065ebd 100644 --- a/phpBB/language/en/app.php +++ b/phpBB/language/en/app.php @@ -44,5 +44,5 @@ $lang = array_merge($lang, array( 'CONTROLLER_ARGUMENT_VALUE_MISSING' => 'Missing value for argument #%1$s: <strong>%3$s</strong> in class <strong>%2$s</strong>', 'CONTROLLER_NOT_SPECIFIED' => 'No controller has been specified.', 'CONTROLLER_METHOD_NOT_SPECIFIED' => 'No method was specified for the controller.', - 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller "<strong>%s</strong>" is not defined in ./config/services.yml.', + 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller “<strong>%s</strong>” is not defined in ./config/services.yml.', )); diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index c674d5cf3d..800ce3dfb7 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -73,11 +73,11 @@ $help = array( ), array( 0 => 'Creating an Unordered list', - 1 => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul>' + 1 => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul><br />Alternatively you can specify the list’s bullet style using <strong>[list=disc][/list]</strong>, <strong>[list=circle][/list]</strong>, or <strong>[list=square][/list]</strong>.' ), array( 0 => 'Creating an Ordered list', - 1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>' + 1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=A]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=i]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol><br /><strong>[list=I]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: upper-roman"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>' ), // This block will switch the FAQ-Questions to the second template column array( diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 6be44587f5..7cf39f4eb7 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1229,21 +1229,19 @@ switch ($mode) ); extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars))); - // Count the users ... - if ($sql_where) - { - $sql = 'SELECT COUNT(u.user_id) AS total_users - FROM ' . USERS_TABLE . " u$sql_from - WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") - $sql_where"; - $result = $db->sql_query($sql); - $total_users = (int) $db->sql_fetchfield('total_users'); - $db->sql_freeresult($result); - } - else + $user_types = array(USER_NORMAL, USER_FOUNDER); + if ($auth->acl_get('a_user')) { - $total_users = $config['num_users']; + $user_types[] = USER_INACTIVE; } + // Count the users ... + $sql = 'SELECT COUNT(u.user_id) AS total_users + FROM ' . USERS_TABLE . " u$sql_from + WHERE " . $db->sql_in_set('u.user_type', $user_types) . " + $sql_where"; + $result = $db->sql_query($sql); + $total_users = (int) $db->sql_fetchfield('total_users'); + $db->sql_freeresult($result); // Build a relevant pagination_url $params = $sort_params = array(); @@ -1409,13 +1407,7 @@ switch ($mode) ); } - $user_types = array(USER_NORMAL, USER_FOUNDER); - if ($auth->acl_get('a_user')) - { - $user_types[] = USER_INACTIVE; - } - - $start = $pagination->validate_start($start, $config['topics_per_page'], $config['num_users']); + $start = $pagination->validate_start($start, $config['topics_per_page'], $total_users); // Get us some users :D $sql = "SELECT u.user_id diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php index b3ced7edf7..ad186635f2 100644 --- a/phpBB/phpbb/avatar/driver/driver.php +++ b/phpBB/phpbb/avatar/driver/driver.php @@ -120,6 +120,22 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface } /** + * {@inheritdoc} + */ + public function get_config_name() + { + return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($this)); + } + + /** + * {@inheritdoc} + */ + public function get_acp_template_name() + { + return 'acp_avatar_options_' . $this->get_config_name() . '.html'; + } + + /** * Sets the name of the driver. * * @param string $name Driver name diff --git a/phpBB/phpbb/avatar/driver/driver_interface.php b/phpBB/phpbb/avatar/driver/driver_interface.php index 835609745a..7d6c2cff8a 100644 --- a/phpBB/phpbb/avatar/driver/driver_interface.php +++ b/phpBB/phpbb/avatar/driver/driver_interface.php @@ -26,6 +26,13 @@ interface driver_interface public function get_name(); /** + * Returns the config name of the driver. To be used in accessing the CONFIG variables. + * + * @return string Config name of driver. + */ + public function get_config_name(); + + /** * Get the avatar url and dimensions * * @param array $row User data or group data that has been cleaned with @@ -110,4 +117,11 @@ interface driver_interface * @return string Avatar driver's template name */ public function get_template_name(); + + /** + * Get the avatar driver's template name (ACP) + * + * @return string Avatar driver's template name + */ + public function get_acp_template_name(); } diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 8d83152ed6..26eb17c265 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -246,7 +246,7 @@ class manager */ public function is_enabled($driver) { - $config_name = $this->get_driver_config_name($driver); + $config_name = $driver->get_config_name(); return $this->config["allow_avatar_{$config_name}"]; } @@ -260,7 +260,7 @@ class manager */ public function get_avatar_settings($driver) { - $config_name = $this->get_driver_config_name($driver); + $config_name = $driver->get_config_name(); return array( 'allow_avatar_' . $config_name => array('lang' => 'ALLOW_' . strtoupper(str_replace('\\', '_', $config_name)), 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -268,18 +268,6 @@ class manager } /** - * Get the config name of an avatar driver - * - * @param object $driver Avatar driver object - * - * @return string Avatar driver config name - */ - public function get_driver_config_name($driver) - { - return preg_replace('#^phpbb\\\\avatar\\\\driver\\\\#', '', get_class($driver)); - } - - /** * Replace "error" strings with their real, localized form * * @param \phpbb\user phpBB User object diff --git a/phpBB/phpbb/composer.json b/phpBB/phpbb/composer.json index 513d7e4559..6b3888ef64 100644 --- a/phpBB/phpbb/composer.json +++ b/phpBB/phpbb/composer.json @@ -23,5 +23,10 @@ }, "require": { "php": ">=5.3.3" - } + }, + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + } } diff --git a/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php new file mode 100644 index 0000000000..bdf83f3d62 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/increase_size_of_dateformat.php @@ -0,0 +1,35 @@ +<?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\v31x; + +class increase_size_of_dateformat extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dateformat' => array('VCHAR_UNI:64', 'd M Y H:i'), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v31x/v317.php b/phpBB/phpbb/db/migration/data/v31x/v317.php new file mode 100644 index 0000000000..15ba2a1feb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v317.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\v31x; + +class v317 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.7')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v31x/v317pl1.php b/phpBB/phpbb/db/migration/data/v31x/v317pl1.php new file mode 100644 index 0000000000..2e1b0e9b9d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v317pl1.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\v31x; + +class v317pl1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.7-pl1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v31x/v317rc1.php b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php new file mode 100644 index 0000000000..fa24819094 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php @@ -0,0 +1,32 @@ +<?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\v31x; + +class v317rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\m_pm_report', + '\phpbb\db\migration\data\v31x\v316', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.7-RC1')), + ); + } +} diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 775deccc30..e76e7b0e18 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1533,6 +1533,11 @@ class tools } } + if (isset($column_data['after'])) + { + $return_array['after'] = $column_data['after']; + } + break; case 'oracle': diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index 462b87ca51..ab9505a14c 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -42,7 +42,7 @@ class file_downloader $this->error_number = 0; $this->error_string = ''; - if ($socket = @fsockopen($host, $port, $this->error_number, $this->error_string, $timeout)) + if ($socket = @fsockopen(($port == 443 ? 'tls://' : '') . $host, $port, $this->error_number, $this->error_string, $timeout)) { @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n"); @fputs($socket, "HOST: $host\r\n"); diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 3d995b4e4a..d46e3d1f3f 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -229,8 +229,8 @@ class log implements \phpbb\log\log_interface } $sql_ary = array( - 'user_id' => $user_id, - 'log_ip' => $log_ip, + 'user_id' => !empty($user_id) ? $user_id : ANONYMOUS, + 'log_ip' => !empty($log_ip) ? $log_ip : '', 'log_time' => $log_time, 'log_operation' => $log_operation, ); diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 999d9e58ad..6cff75c62c 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1557,7 +1557,7 @@ class session public function update_session_infos() { - global $db, $request; + global $config, $db, $request; // No need to update if it's a new session. Informations are already inserted by session_create() if (isset($this->data['session_created']) && $this->data['session_created']) diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index e4f68f5aab..a1e66ba8fe 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -34,6 +34,11 @@ class version_helper protected $file = 'versions.json'; /** + * @var bool Use SSL or not + */ + protected $use_ssl = false; + + /** * @var string Current version installed */ protected $current_version; @@ -85,13 +90,15 @@ class version_helper * @param string $host Host (e.g. version.phpbb.com) * @param string $path Path to file (e.g. /phpbb) * @param string $file File name (Default: versions.json) + * @param bool $use_ssl Use SSL or not (Default: false) * @return version_helper */ - public function set_file_location($host, $path, $file = 'versions.json') + public function set_file_location($host, $path, $file = 'versions.json', $use_ssl = false) { $this->host = $host; $this->path = $path; $this->file = $file; + $this->use_ssl = $use_ssl; return $this; } @@ -244,7 +251,7 @@ class version_helper */ public function get_versions($force_update = false, $force_cache = false) { - $cache_file = '_versioncheck_' . $this->host . $this->path . $this->file; + $cache_file = '_versioncheck_' . $this->host . $this->path . $this->file . $this->use_ssl; $info = $this->cache->get($cache_file); @@ -255,7 +262,7 @@ class version_helper else if ($info === false || $force_update) { try { - $info = $this->file_downloader->get($this->host, $this->path, $this->file); + $info = $this->file_downloader->get($this->host, $this->path, $this->file, $this->use_ssl ? 443 : 80); } catch (\phpbb\exception\runtime_exception $exception) { diff --git a/phpBB/posting.php b/phpBB/posting.php index 5fcd427b2b..a7df1a018e 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -481,7 +481,7 @@ if ($mode == 'delete' || $mode == 'soft_delete') } $delete_reason = $request->variable('delete_reason', '', true); - phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete'), $delete_reason); + phpbb_handle_post_delete($forum_id, $topic_id, $post_id, $post_data, ($mode == 'soft_delete' && !$request->is_set_post('delete_permanent')), $delete_reason); return; } diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index 13433c389f..f1a34bcf68 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = prosilver copyright = © phpBB Limited, 2007 -style_version = 3.1.6 -phpbb_version = 3.1.6 +style_version = 3.1.7 +phpbb_version = 3.1.7 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index bc71aa0969..874607d913 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -9,6 +9,10 @@ <p>{L_SEND_IM_EXPLAIN}</p> + <!-- IF S_SENT_JABBER --> + <p>{L_IM_SENT_JABBER}</p> + <!-- ENDIF --> + <fieldset> <dl class="fields2"> <dt><label>{L_IM_RECIPIENT}{L_COLON}</label></dt> @@ -24,10 +28,6 @@ <dt> </dt> <dd><input class="button1" name="submit" type="submit" value="{L_IM_SEND}" /></dd> </dl> - <dl class="fields2"> - <dt> </dt> - <dd>{L_IM_SENT_JABBER}</dd> - </dl> <!-- ELSE IF S_NO_SEND_JABBER --> <dl class="fields2"> <dt> </dt> diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index faf48e0b05..e948e2e0f6 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -46,6 +46,7 @@ <!-- IF U_MCP --><li class="small-icon icon-mcp" data-last-responsive="true"><a href="{U_MCP}" title="{L_MCP}" role="menuitem">{L_MCP_SHORT}</a></li><!-- ENDIF --> <!-- IF S_REGISTERED_USER --> + <!-- EVENT navbar_header_user_profile_prepend --> <li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true"> <!-- EVENT navbar_header_username_prepend --> <div class="header-profile dropdown-container"> @@ -80,6 +81,7 @@ <!-- INCLUDE notification_dropdown.html --> </li> <!-- ENDIF --> + <!-- EVENT navbar_header_user_profile_append --> <!-- ELSE --> <li class="small-icon icon-logout rightside" data-skip-responsive="true"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li> <!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index ecba72f6f4..ff54f3a0aa 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -37,7 +37,7 @@ </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> -<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF --> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- INCLUDEJS forum_fn.js --> <!-- INCLUDEJS ajax.js --> diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html index 123f8992f2..77980a9dea 100644 --- a/phpBB/styles/prosilver/template/simple_footer.html +++ b/phpBB/styles/prosilver/template/simple_footer.html @@ -21,7 +21,7 @@ </div> <script type="text/javascript" src="{T_JQUERY_LINK}"></script> -<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write('\x3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}">\x3C/script>');</script><!-- ENDIF --> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- INCLUDEJS forum_fn.js --> <!-- INCLUDEJS ajax.js --> diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index c8b028f83a..4cd9f6655b 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -70,7 +70,7 @@ {S_DATEFORMAT_OPTIONS} </select> </dd> - <dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="inputbox narrow" style="margin-top: 3px;" /></dd> + <dd id="custom_date" style="display:none;"><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" class="inputbox narrow" style="margin-top: 3px;" /></dd> </dl> <!-- EVENT ucp_prefs_personal_append --> </fieldset> diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index 8077c1d51e..77cea1a55f 100644 --- a/phpBB/styles/subsilver2/style.cfg +++ b/phpBB/styles/subsilver2/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = subsilver2 copyright = © 2005 phpBB Limited -style_version = 3.1.6 -phpbb_version = 3.1.6 +style_version = 3.1.7 +phpbb_version = 3.1.7 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html index a19229605a..ecd9aca86f 100644 --- a/phpBB/styles/subsilver2/template/memberlist_im.html +++ b/phpBB/styles/subsilver2/template/memberlist_im.html @@ -7,6 +7,11 @@ <tr> <th colspan="2">{L_SEND_IM}</th> </tr> + <!-- IF S_SENT_JABBER --> + <tr> + <td class="row1" colspan="2" align="center"><span class="gen">{L_IM_SENT_JABBER}</span></td> + </tr> + <!-- ENDIF --> <tr> <td class="row3" colspan="2"><span class="gensmall">{L_SEND_IM_EXPLAIN}</span></td> </tr> @@ -23,12 +28,6 @@ <tr> <td class="cat" colspan="2" align="center"><input class="btnmain" name="submit" type="submit" value="{L_IM_SEND}" /></td> </tr> - <tr> - <td class="row1" colspan="2" align="center"><span class="gen">{L_IM_SENT_JABBER}</span></td> - </tr> - <tr> - <td class="cat" colspan="2" align="center"></td> - </tr> <!-- ELSEIF S_NO_SEND_JABBER --> <tr> <td class="row1" colspan="2"><span class="genmed">{L_IM_NO_JABBER}</span></td> diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html index 1c76e3226d..0dd50b8fa2 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html @@ -59,7 +59,7 @@ <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }"> {S_DATEFORMAT_OPTIONS} </select> - <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div> + <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="64" class="post" style="margin-top: 3px;" /></div> </td> </tr> <!-- EVENT ucp_prefs_personal_append --> diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 9b97fa6a68..344eef38ff 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -64,10 +64,13 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case ->method('get_name') ->will($this->returnValue('avatar.driver.foobar')); // barfoo driver can't be mocked with constructor arguments - $this->avatar_barfoo = $this->getMock('\phpbb\avatar\driver\barfoo', array('get_name')); + $this->avatar_barfoo = $this->getMock('\phpbb\avatar\driver\barfoo', array('get_name', 'get_config_name')); $this->avatar_barfoo->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.barfoo')); + $this->avatar_barfoo->expects($this->any()) + ->method('get_config_name') + ->will($this->returnValue('barfoo')); $avatar_drivers = array($this->avatar_foobar, $this->avatar_barfoo); foreach ($this->avatar_drivers() as $driver) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 7be8957ec7..8a71a5ce04 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -41,6 +41,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { parent::setUp(); + $this->purge_cache(); + $this->get_db(); // Clear the phpbb_ext table diff --git a/tests/functional/extension_global_lang_test.php b/tests/functional/extension_global_lang_test.php index 53bb9af5ca..f615114c08 100644 --- a/tests/functional/extension_global_lang_test.php +++ b/tests/functional/extension_global_lang_test.php @@ -52,6 +52,13 @@ class phpbb_functional_extension_global_lang_test extends phpbb_functional_test_ $this->purge_cache(); } + public function tearDown() + { + parent::tearDown(); + + $this->purge_cache(); + } + public function test_load_extension_lang_globally() { $this->phpbb_extension_manager->enable('foo/bar'); diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index ad5c4a5cab..e48dfc043a 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -20,6 +20,12 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case static public $init_values = array(); + public function setUp() + { + parent::setUp(); + $this->purge_cache(); + } + public function __construct($name = null, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 080822d249..0d2fdf082e 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -24,6 +24,13 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case 'foo/bar/', ); + public function tearDown() + { + $this->purge_cache(); + + parent::tearDown(); + } + static public function setUpBeforeClass() { parent::setUpBeforeClass(); diff --git a/tests/functional/plupload_test.php b/tests/functional/plupload_test.php index ee71597ffc..d358681ad1 100644 --- a/tests/functional/plupload_test.php +++ b/tests/functional/plupload_test.php @@ -33,6 +33,7 @@ class phpbb_functional_plupload_test extends phpbb_functional_test_case public function setUp() { parent::setUp(); + $this->purge_cache(); $this->set_extension_group_permission(1); $this->path = __DIR__ . '/fixtures/files/'; $this->add_lang('posting'); diff --git a/tests/log/add_test.php b/tests/log/add_test.php index bacc0c76f7..29d3adaeb6 100644 --- a/tests/log/add_test.php +++ b/tests/log/add_test.php @@ -88,5 +88,14 @@ class phpbb_log_add_test extends phpbb_database_test_case // Invalid mode specified $this->assertFalse($log->add('mode_does_not_exist', $user_id, $log_ip, $log_operation, $log_time)); + + // null user and null ip given + $this->assertEquals(3, $log->add($mode, null, null, $log_operation, $log_time), 'Adding log with null user_id and null user_ip failed'); + $sql = 'SELECT user_id, log_ip FROM ' . LOG_TABLE . ' WHERE log_id = 3'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $this->assertEquals(ANONYMOUS, $row['user_id'], 'Adding log with null user_id failed'); + $this->assertEquals('', $row['log_ip'], 'Adding log with null user_ip failed'); } } diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 5d643e43e2..3b5bab749e 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -85,11 +85,18 @@ class phpbb_database_test_connection_manager break; default: - $dsn .= 'host=' . $this->config['dbhost']; - - if ($this->config['dbport']) + if (!empty($this->config['dbport']) && !is_numeric($this->config['dbport']) && $this->dbms['PDO'] != 'pgsql') + { + $dsn .= 'unix_socket=' . $this->config['dbport']; + } + else { - $dsn .= ';port=' . $this->config['dbport']; + $dsn .= 'host=' . $this->config['dbhost']; + + if ($this->config['dbport']) + { + $dsn .= ';port=' . $this->config['dbport']; + } } if ($use_db) diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d403831626..8107e45dc7 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -89,12 +89,13 @@ class phpbb_functional_test_case extends phpbb_test_case // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); - $this->purge_cache(); $db = $this->get_db(); foreach (static::setup_extensions() as $extension) { + $this->purge_cache(); + $sql = 'SELECT ext_active FROM ' . EXT_TABLE . " WHERE ext_name = '" . $db->sql_escape($extension). "'"; |