diff options
38 files changed, 619 insertions, 127 deletions
diff --git a/build/build.xml b/build/build.xml index 1022565ff0..1c6cbe5f25 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-a4-dev" /> - <property name="prevversion" value="3.1.0-a2" /> - <property name="olderversions" value="3.0.12, 3.1.0-a1" /> + <property name="newversion" value="3.1.0-b2-dev" /> + <property name="prevversion" value="3.1.0-b1" /> + <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/phpBB/adm/style/acp_ext_details.html b/phpBB/adm/style/acp_ext_details.html index 986aa24b1b..5141acd9fc 100644 --- a/phpBB/adm/style/acp_ext_details.html +++ b/phpBB/adm/style/acp_ext_details.html @@ -21,12 +21,12 @@ <!-- IF META_DESCRIPTION --> <dl> <dt><label>{L_DESCRIPTION}{L_COLON}</label></dt> - <dd><p id="meta_description">{META_DESCRIPTION}</p></dd> + <dd><span id="meta_description">{META_DESCRIPTION}</span></dd> </dl> <!-- ENDIF --> <dl> <dt><label>{L_VERSION}{L_COLON}</label></dt> - <dd><p id="meta_version">{META_VERSION}</p></dd> + <dd><span id="meta_version">{META_VERSION}</span></dd> </dl> <!-- IF META_HOMEPAGE --> <dl> @@ -37,12 +37,12 @@ <!-- IF META_TIME --> <dl> <dt><label>{L_TIME}{L_COLON}</label></dt> - <dd><p id="meta_time">{META_TIME}</p></dd> + <dd><span id="meta_time">{META_TIME}</span></dd> </dl> <!-- ENDIF --> <dl> <dt><label>{L_LICENCE}{L_COLON}</label></dt> - <dd><p id="meta_license">{META_LICENCE}</p></dd> + <dd><span id="meta_license">{META_LICENCE}</span></dd> </dl> </fieldset> @@ -52,13 +52,13 @@ <!-- IF META_REQUIRE_PHPBB --> <dl<!-- IF META_REQUIRE_PHPBB_FAIL --> class="requirements_not_met"<!-- ENDIF -->> <dt><label>{L_PHPBB_VERSION}{L_COLON}</label></dt> - <dd><p id="require_phpbb">{META_REQUIRE_PHPBB}</p></dd> + <dd><span id="require_phpbb">{META_REQUIRE_PHPBB}</span></dd> </dl> <!-- ENDIF --> <!-- IF META_REQUIRE_PHP --> <dl<!-- IF META_REQUIRE_PHP_FAIL --> class="requirements_not_met"<!-- ENDIF -->> <dt><label>{L_PHP_VERSION}{L_COLON}</label></dt> - <dd><p id="require_php">{META_REQUIRE_PHP}</p></dd> + <dd><span id="require_php">{META_REQUIRE_PHP}</span></dd> </dl> <!-- ENDIF --> </fieldset> diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html index c5356e7b9d..822ab76313 100644 --- a/phpBB/adm/style/install_footer.html +++ b/phpBB/adm/style/install_footer.html @@ -11,6 +11,7 @@ <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.js" type="text/javascript"%3E%3C/script%3E'));</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/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php index b276b4c5fa..3021b64e05 100644 --- a/phpBB/develop/export_events_for_wiki.php +++ b/phpBB/develop/export_events_for_wiki.php @@ -54,7 +54,7 @@ function export_from_eventsmd($phpbb_root_path, $filter) { $file_details = substr($file_details, strlen("* Locations:\n + ")); $files = explode("\n + ", $file_details); - $prosilver = $subsilver2 = array(); + $prosilver = $subsilver2 = $adm = array(); foreach ($files as $file) { if (strpos($file, 'styles/prosilver/template/') === 0) @@ -65,8 +65,19 @@ function export_from_eventsmd($phpbb_root_path, $filter) { $subsilver2[] = substr($file, strlen('styles/subsilver2/template/')); } + if (strpos($file, 'adm/style/') === 0) + { + $adm[] = substr($file, strlen('adm/style/')); + } + } + if ($filter == 'acp') + { + echo implode(', ', $adm); + } + else + { + echo implode(', ', $prosilver) . ' || ' . implode(', ', $subsilver2); } - echo implode(', ', $prosilver) . ' || ' . implode(', ', $subsilver2); } else if ($filter == 'acp') { @@ -110,26 +121,39 @@ function check_for_events($phpbb_root_path, $file) for ($i = 0, $num_lines = sizeof($lines); $i < $num_lines; $i++) { $event_line = 0; - if ($found_trigger_event = strpos($lines[$i], "phpbb_dispatcher->trigger_event('")) + $found_trigger_event = strpos($lines[$i], "phpbb_dispatcher->trigger_event('"); + if ($found_trigger_event !== false) { $event_line = $i; $event_name = $lines[$event_line]; $event_name = substr($event_name, $found_trigger_event + strlen("phpbb_dispatcher->trigger_event('")); $event_name = substr($event_name, 0, strpos($event_name, "'")); - // Find $vars array lines - $find_varsarray_line = 1; - while (strpos($lines[$event_line - $find_varsarray_line], "vars = array('") === false) + $current_line = trim($lines[$event_line]); + $arguments = array(); + $found_inline_array = strpos($current_line, "', compact(array('"); + if ($found_inline_array !== false) { - $find_varsarray_line++; + $varsarray = substr($current_line, $found_inline_array + strlen("', compact(array('"), -6); + $arguments = explode("', '", $varsarray); + } - if ($find_varsarray_line > min(50, $event_line)) + if (empty($arguments)) + { + // Find $vars array lines + $find_varsarray_line = 1; + while (strpos($lines[$event_line - $find_varsarray_line], "vars = array('") === false) { - throw new LogicException('Can not find "$vars = array()"-line for event "' . $event_name . '" in file "' . $file . '"'); + $find_varsarray_line++; + + if ($find_varsarray_line > min(50, $event_line)) + { + throw new LogicException('Can not find "$vars = array()"-line for event "' . $event_name . '" in file "' . $file . '"'); + } } + $varsarray = substr(trim($lines[$event_line - $find_varsarray_line]), strlen("\$vars = array('"), -3); + $arguments = explode("', '", $varsarray); } - $varsarray = substr(trim($lines[$event_line - $find_varsarray_line]), strlen("\$vars = array('"), -3); - $arguments = explode("', '", $varsarray); // Validate $vars array with @var $find_vars_line = 3; @@ -153,11 +177,12 @@ function check_for_events($phpbb_root_path, $file) throw new LogicException('$vars array does not match the list of @var tags for event "' . $event_name . '" in file "' . $file . '"'); } } - else if ($found_trigger_event = strpos($lines[$i], "phpbb_dispatcher->dispatch('")) + $found_dispatch = strpos($lines[$i], "phpbb_dispatcher->dispatch('"); + if ($found_dispatch !== false) { $event_line = $i; $event_name = $lines[$event_line]; - $event_name = substr($event_name, $found_trigger_event + strlen("phpbb_dispatcher->dispatch('")); + $event_name = substr($event_name, $found_dispatch + strlen("phpbb_dispatcher->dispatch('")); $event_name = substr($event_name, 0, strpos($event_name, "'")); $arguments = array(); } @@ -267,7 +292,7 @@ function get_file_list($dir, $path = '') $files[] = $file_info->getFilename() . '/' . $file; } } - else if ($file_info->getExtension() == 'php') + else if (substr($file_info->getFilename(), -4) == '.php') { $files[] = $file_info->getFilename(); } diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 1ce5f29a72..17f1327a96 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="#v310a3">Changes since 3.1.0-a3</a></li> <li><a href="#v310a2">Changes since 3.1.0-a2</a></li> <li><a href="#v310a1">Changes since 3.1.0-a1</a></li> <li><a href="#v30x">Changes since 3.0.x</a></li> @@ -89,7 +90,154 @@ <div class="content"> - <a name="v310a2"></a><h3>1.i. Changes since 3.1.0-a2</h3> + <a name="v310a3"></a><h3>1.i. Changes since 3.1.0-a3</h3> + + <h4>Bug</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8041">PHPBB3-8041</a>] - Do not concatenate the destination to L_RETURN_TO to allow better translations</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8122">PHPBB3-8122</a>] - Reviewing topics/posts - not correctly displayed</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8785">PHPBB3-8785</a>] - PM recipients/bcc list looks bad</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8919">PHPBB3-8919</a>] - Localisation imageset being refreshed too frequently causing broken images</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9106">PHPBB3-9106</a>] - Upload fails to complete for large files.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9420">PHPBB3-9420</a>] - BBCode - Unable to use a proper URI token</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9459">PHPBB3-9459</a>] - Visiting ACP with screen resolution 800x600px</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10175">PHPBB3-10175</a>] - Class loader cannot find a/b_foo.php when a/b/bar.php exists</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10338">PHPBB3-10338</a>] - Attachments list is displayed incorrectly</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10722">PHPBB3-10722</a>] - Code Coverage generation fails</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11038">PHPBB3-11038</a>] - Does not correctly find module info classes using new naming conventions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11146">PHPBB3-11146</a>] - MCP topic/post approval error</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11151">PHPBB3-11151</a>] - Can use negative start for memberlist.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11218">PHPBB3-11218</a>] - File upload functional test fails</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11255">PHPBB3-11255</a>] - Some tests do not run standalone due to dbal dependency on global $cache</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11271">PHPBB3-11271</a>] - Images in ATOM feed display, but attached inline images do not.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11288">PHPBB3-11288</a>] - "Fulltext native" search fooled by hyphens</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11364">PHPBB3-11364</a>] - Add an easy-to-switch system for app.php?controller= vs mod-rewrite usage in append_sid</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11429">PHPBB3-11429</a>] - Extensions should increment assets number on enable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11581">PHPBB3-11581</a>] - General Error in UCP if PMs are disabled in ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11625">PHPBB3-11625</a>] - General Error accessing MCP from Global Announcement</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11648">PHPBB3-11648</a>] - Test suite creates files in phpBB directory</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11787">PHPBB3-11787</a>] - Permission language strings use samp for highlight instead of strong</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11880">PHPBB3-11880</a>] - Schema changes can take too long and cause a timeout</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11938">PHPBB3-11938</a>] - Use of deprecated sql_attr_str2ordinal in sphinx.conf</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12003">PHPBB3-12003</a>] - ACP broken when error thrown</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12072">PHPBB3-12072</a>] - Missing word "send" in comment in schema_data.sql</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12078">PHPBB3-12078</a>] - "Can permanently delete own posts" permission has no effect</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12080">PHPBB3-12080</a>] - Responsive design in ACP / User Administration / Signature needs fixing</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12093">PHPBB3-12093</a>] - IE 11 javascript selection is no longer supported</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12126">PHPBB3-12126</a>] - Alert box is aligned to the left instead of center in IE</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12132">PHPBB3-12132</a>] - viewtopic_print_head_append template event is missing in subsilver2</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12134">PHPBB3-12134</a>] - ucp_pm_viewmessage_print_head_append template event is missing in subsilver2</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12136">PHPBB3-12136</a>] - Call to undefined function generate_pagination() in functions_posting.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12138">PHPBB3-12138</a>] - Information and pagination of filtered attachments</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12139">PHPBB3-12139</a>] - Spaces missing after $show_guests in viewonline.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12141">PHPBB3-12141</a>] - Travis tests fail on 5.5</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12149">PHPBB3-12149</a>] - Division by zero in [ROOT] -/phpbb/pagination.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12153">PHPBB3-12153</a>] - PAGE_NUMBER should be assigned by pagination.generate_template_pagination()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12158">PHPBB3-12158</a>] - pagination.validate_start() returns negative value when $num_items = 0</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12168">PHPBB3-12168</a>] - Nav Header Links Alignment Issues without small-icon</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12170">PHPBB3-12170</a>] - Migration helper replaces table name with 0 when creating tables</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12171">PHPBB3-12171</a>] - Attachments from soft-deleted posts are still downloadable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12172">PHPBB3-12172</a>] - "Download all attachments" feature leaks post/pm attachments when being able to download one of them</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12175">PHPBB3-12175</a>] - Fix and run functional upload tests</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12176">PHPBB3-12176</a>] - No error shown when attempting to delete a founder</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12183">PHPBB3-12183</a>] - Update user_newpasswd column in users table for passwords manager</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12184">PHPBB3-12184</a>] - Undefined variable tpl_fields in profile field manager on memberlist</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12188">PHPBB3-12188</a>] - Add php 5.6 to travis tests</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12192">PHPBB3-12192</a>] - Avatars in PM report closed notifications are broken</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12194">PHPBB3-12194</a>] - Unknown column 'field_show_novalue' in 'field list' [1054] -</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12200">PHPBB3-12200</a>] - Profile field template files missing in adm/style</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12202">PHPBB3-12202</a>] - Variables read from style.cfg etc. should be htmlspecialchared</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12203">PHPBB3-12203</a>] - user_occ does not have a default value when registering</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12205">PHPBB3-12205</a>] - Custom Profile Field display bug</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12206">PHPBB3-12206</a>] - Errors in plupload doesn't pull lang vars right</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12207">PHPBB3-12207</a>] - prosilver layout breaks when error outputted before <html></li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12208">PHPBB3-12208</a>] - Plupload uploads files even if they were deleted from queue</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12210">PHPBB3-12210</a>] - dbtools::sql_create_table incorrectly throws error related to auto-increment length on non auto-increment fields</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12212">PHPBB3-12212</a>] - HTML in attachment file name rendered before upload</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12216">PHPBB3-12216</a>] - Undefined index: lang_options when creating date profile field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12220">PHPBB3-12220</a>] - Debug message if no unread messages are present</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12222">PHPBB3-12222</a>] - Replace hardoded comma with translatable separator in forumlist_body.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12223">PHPBB3-12223</a>] - Pagination displayes additional &bull; when PAGE_NUMBER is empty</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12226">PHPBB3-12226</a>] - Incorrectly used plurals in ucp.php MOVE_PM_ERROR and FOLDER_MESSAGE_STATUS</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12227">PHPBB3-12227</a>] - "X from Y messages" should be "X out of Y messages"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12243">PHPBB3-12243</a>] - subsilver2 is missing profile field files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12245">PHPBB3-12245</a>] - "Invalid id refernce" for label "joined" and "group_id" in acp_prune_users.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12249">PHPBB3-12249</a>] - Undefined variable: row when editing profile</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12250">PHPBB3-12250</a>] - Remove deprecated phpbb_clean_path function</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12251">PHPBB3-12251</a>] - Clean up and Enhancement of Custom Profile Fields</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12256">PHPBB3-12256</a>] - phpbb\notification\type\admin_activate_user uses $sql as fetchrow parameter</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12261">PHPBB3-12261</a>] - Login redirect from extension front controllers broken</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12263">PHPBB3-12263</a>] - \phpbb\db\migration\tool\module.php contains several errors</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12267">PHPBB3-12267</a>] - Functional testcase method get_extension_manager() uses undefined variable php_ext</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12271">PHPBB3-12271</a>] - Decouple dropdown header/footer from #notification_list</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12272">PHPBB3-12272</a>] - Hardcoded colon in subforums list</li> + </ul> + <h4>Improvement</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9255">PHPBB3-9255</a>] - Friends Sidebar has scability issues..</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9479">PHPBB3-9479</a>] - Empty paragraphs for vertical spacing are rather old-fashioned</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9709">PHPBB3-9709</a>] - Missing language files for MCP could be substituted by default / english ones</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9871">PHPBB3-9871</a>] - Update version check file to use json format</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10288">PHPBB3-10288</a>] - Templates including other templates in loop can't access variables</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10549">PHPBB3-10549</a>] - Languages variables should be used, not hardcoded</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10555">PHPBB3-10555</a>] - Copyright notice in overall_header.html is not translatable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10945">PHPBB3-10945</a>] - Show entered search query in the search box when no results are found.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11019">PHPBB3-11019</a>] - Ability to store array of data in a log</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11022">PHPBB3-11022</a>] - Add "Tahoma" to used font families in css files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11040">PHPBB3-11040</a>] - PostgreSQL fulltext search improvement</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11111">PHPBB3-11111</a>] - Allow only vertical resize on the textarea.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11179">PHPBB3-11179</a>] - change the start parameter in search when out of bounds to display last(or first) page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11201">PHPBB3-11201</a>] - MSNM / WLM closing - redundant profile field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11254">PHPBB3-11254</a>] - Check CRLF line endings in the test suite</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11297">PHPBB3-11297</a>] - Running tests doc should mention dbunit dependency</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11610">PHPBB3-11610</a>] - Use a more secure hashing method like bcrypt</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11645">PHPBB3-11645</a>] - Rename ".MODs" tab in the ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11693">PHPBB3-11693</a>] - Change phpbb_db_driver::sql_build_array() to support DELETE</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11716">PHPBB3-11716</a>] - Migration to convert soft delete/trash bin mods to 3.1 soft delete</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12029">PHPBB3-12029</a>] - Module names in the ACP should not be truncated when they are too long</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12073">PHPBB3-12073</a>] - Small text size in ACP between <samp></samp> and <code></code> tags</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12106">PHPBB3-12106</a>] - Document exceptions to "Disable Board" in ACP.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12114">PHPBB3-12114</a>] - Convert current profile fields to custom-profile-field system</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12117">PHPBB3-12117</a>] - Nested Set Tree Classes Should be able to get all roots</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12166">PHPBB3-12166</a>] - Add template event "quickreply_editor_message_box_before"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12167">PHPBB3-12167</a>] - Allow users to change style via style parameter by default</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12190">PHPBB3-12190</a>] - Add core event "core.modify_submit_post_data"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12217">PHPBB3-12217</a>] - Add template events to viewtopic_body.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12224">PHPBB3-12224</a>] - Add template method to assign block arrays</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12231">PHPBB3-12231</a>] - Add template events to forumlist_body.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12238">PHPBB3-12238</a>] - There is no cancel input type.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12239">PHPBB3-12239</a>] - Move deprecated password functions to compatibility file</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12240">PHPBB3-12240</a>] - Adding specific class names to buttons in posting_buttons.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12241">PHPBB3-12241</a>] - Event to add and/or modify acp_board configurations</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12244">PHPBB3-12244</a>] - Remove ambiguity between Extension Tab and Extensions Management links</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12248">PHPBB3-12248</a>] - Extension Details Homepage should be a clickable link</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12259">PHPBB3-12259</a>] - Too many redundant tests are run on Travis</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12260">PHPBB3-12260</a>] - Add core event to delete_posts() function</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12262">PHPBB3-12262</a>] - Adjust a script to export the events in wiki format</li> + </ul> + <h4>Sub-task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12115">PHPBB3-12115</a>] - Convert occupation/interests profile field to custom field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12169">PHPBB3-12169</a>] - Convert location user field to profile field </li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12187">PHPBB3-12187</a>] - Convert website user field to profile field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12233">PHPBB3-12233</a>] - Allowing CPF to be have an icon on viewtopic and be listed in the contact section of the profile</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12234">PHPBB3-12234</a>] - Convert ICQ user field to profile field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12235">PHPBB3-12235</a>] - Convert MSN/WLM user field to profile field </li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12236">PHPBB3-12236</a>] - Convert AOL user field to profile field</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12237">PHPBB3-12237</a>] - Convert Yahoo user field to profile field</li> + </ul> + <h4>Task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10763">PHPBB3-10763</a>] - Audit code for non-static functions called statically</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10793">PHPBB3-10793</a>] - Use db_tools in create_schema_files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11509">PHPBB3-11509</a>] - Travis should check commit message format</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11764">PHPBB3-11764</a>] - Remove Subsilver2 from installation packages</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12177">PHPBB3-12177</a>] - Add event ucp_zebra_friend_list_before/after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12180">PHPBB3-12180</a>] - CodeSniffer: Ensure each file ends with a single newline</li> + </ul> + + + <a name="v310a2"></a><h3>1.ii. Changes since 3.1.0-a2</h3> <h4>Bug</h4> <ul> @@ -197,7 +345,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li> </ul> - <a name="v310a1"></a><h3>1.ii. Changes since 3.1.0-a1</h3> + <a name="v310a1"></a><h3>1.iii. Changes since 3.1.0-a1</h3> <h4>Bug</h4> <ul> @@ -273,7 +421,7 @@ <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.iii. Changes since 3.0.x</h3> + <a name="v30x"></a><h3>1.iv. Changes since 3.0.x</h3> <h4>Bug</h4> <ul> @@ -954,7 +1102,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.iv. Changes since 3.0.11</h3> + <a name="v3011"></a><h3>1.v. Changes since 3.0.11</h3> <h4>Bug</h4> <ul> @@ -1109,7 +1257,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.v. Changes since 3.0.10</h3> + <a name="v3010"></a><h3>1.vi. Changes since 3.0.10</h3> <h4>Bug</h4> <ul> @@ -1234,7 +1382,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.vi. Changes since 3.0.9</h3> + <a name="v309"></a><h3>1.vii. Changes since 3.0.9</h3> <h4>Bug</h4> <ul> @@ -1370,7 +1518,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.vii. Changes since 3.0.8</h3> + <a name="v308"></a><h3>1.viii. Changes since 3.0.8</h3> <h4> Bug </h4> @@ -1738,7 +1886,7 @@ </ul> - <a name="v307-PL1"></a><h3>1.viii. Changes since 3.0.7-PL1</h3> + <a name="v307-PL1"></a><h3>1.ix. Changes since 3.0.7-PL1</h3> <h4> Security </h4> <ul> @@ -2196,13 +2344,13 @@ </ul> - <a name="v307"></a><h3>1.ix. Changes since 3.0.7</h3> + <a name="v307"></a><h3>1.x. 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.x. Changes since 3.0.6</h3> + <a name="v306"></a><h3>1.xi. 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> @@ -2306,7 +2454,7 @@ </ul> - <a name="v305"></a><h3>1.xi. Changes since 3.0.5</h3> + <a name="v305"></a><h3>1.xii. Changes since 3.0.5</h3> <ul> <li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li> @@ -2528,7 +2676,7 @@ <li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li> </ul> - <a name="v304"></a><h3>1.xii. Changes since 3.0.4</h3> + <a name="v304"></a><h3>1.xiii. 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> @@ -2617,7 +2765,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.xiii. Changes since 3.0.3</h3> + <a name="v303"></a><h3>1.xiv. Changes since 3.0.3</h3> <ul> <li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li> @@ -2649,7 +2797,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.xiv. Changes since 3.0.2</h3> + <a name="v302"></a><h3>1.xv. 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> @@ -2748,7 +2896,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.xv. Changes since 3.0.1</h3> + <a name="v301"></a><h3>1.xvi. Changes since 3.0.1</h3> <ul> <li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li> @@ -2796,7 +2944,7 @@ <li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li> </ul> - <a name="v300"></a><h3>1.xvi. Changes since 3.0.0</h3> + <a name="v300"></a><h3>1.xvii. Changes since 3.0.0</h3> <ul> <li>[Change] Validate birthdays (Bug #15004)</li> @@ -2867,7 +3015,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.xvii. Changes since 3.0.RC8</h3> + <a name="v30rc8"></a><h3>1.xviii. 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> @@ -2876,7 +3024,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.xviii. Changes since 3.0.RC7</h3> + <a name="v30rc7"></a><h3>1.xix. Changes since 3.0.RC7</h3> <ul> <li>[Fix] Fixed MSSQL related bug in the update system</li> @@ -2911,7 +3059,7 @@ <li>[Fix] No duplication of active topics (Bug #15474)</li> </ul> - <a name="v30rc6"></a><h3>1.xix. Changes since 3.0.RC6</h3> + <a name="v30rc6"></a><h3>1.xx. Changes since 3.0.RC6</h3> <ul> <li>[Fix] Submitting language changes using acp_language (Bug #14736)</li> @@ -2921,7 +3069,7 @@ <li>[Fix] Able to request new password (Bug #14743)</li> </ul> - <a name="v30rc5"></a><h3>1.xx. Changes since 3.0.RC5</h3> + <a name="v30rc5"></a><h3>1.xxi. 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> @@ -2984,7 +3132,7 @@ <li>[Sec] New password hashing mechanism for storing passwords (#i42)</li> </ul> - <a name="v30rc4"></a><h3>1.xxi. Changes since 3.0.RC4</h3> + <a name="v30rc4"></a><h3>1.xxii. Changes since 3.0.RC4</h3> <ul> <li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li> @@ -3035,7 +3183,7 @@ <li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li> </ul> - <a name="v30rc3"></a><h3>1.xxii. Changes since 3.0.RC3</h3> + <a name="v30rc3"></a><h3>1.xxiii. Changes since 3.0.RC3</h3> <ul> <li>[Fix] Fixing some subsilver2 and prosilver style issues</li> @@ -3144,7 +3292,7 @@ </ul> - <a name="v30rc2"></a><h3>1.xxiii. Changes since 3.0.RC2</h3> + <a name="v30rc2"></a><h3>1.xxiv. Changes since 3.0.RC2</h3> <ul> <li>[Fix] Re-allow searching within the memberlist</li> @@ -3190,7 +3338,7 @@ </ul> - <a name="v30rc1"></a><h3>1.xxiv. Changes since 3.0.RC1</h3> + <a name="v30rc1"></a><h3>1.xxv. 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 57a47cbf84..97be92933e 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -160,6 +160,14 @@ memberlist_body_username_prepend * Purpose: Add information before every username in the memberlist. Works in all display modes (leader, group and normal memberlist). +memberlist_view_content_append +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.0-b2 +* Purpose: Add custom content to the user profile view after the main content + memberlist_view_user_statistics_after === * Locations: diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index b1913eb6b3..18cc3a7c17 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -37,7 +37,6 @@ class acp_users $user->add_lang(array('posting', 'ucp', 'acp/users')); $this->tpl_name = 'acp_users'; - $this->page_title = 'ACP_USER_' . strtoupper($mode); $error = array(); $username = utf8_normalize_nfc(request_var('username', '', true)); @@ -159,6 +158,8 @@ class acp_users trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING); } + $this->page_title = $user_row['username'] . ' :: ' . $user->lang('ACP_USER_' . strtoupper($mode)); + switch ($mode) { case 'overview': diff --git a/phpBB/includes/acp/info/acp_prune.php b/phpBB/includes/acp/info/acp_prune.php index 7498e46cad..0f70d9d638 100644 --- a/phpBB/includes/acp/info/acp_prune.php +++ b/phpBB/includes/acp/info/acp_prune.php @@ -20,7 +20,7 @@ class acp_prune_info 'version' => '1.0.0', 'modes' => array( 'forums' => array('title' => 'ACP_PRUNE_FORUMS', 'auth' => 'acl_a_prune', 'cat' => array('ACP_MANAGE_FORUMS')), - 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_USER_SECURITY')), + 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_CAT_USERS')), ), ); } diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index c2c7ca0abd..fe23ed5a9a 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-a4-dev'); +define('PHPBB_VERSION', '3.1.0-b2-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 05313e849d..cd2c9e5ae6 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -441,7 +441,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } } - $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': '; + $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS']; $folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; } else diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index deb304b838..476535ae5b 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -581,3 +581,22 @@ function phpbb_ignore_new_file_on_update($phpbb_root_path, $file) return $ignore_new_file; } + +/** +* Check whether phpBB is installed. +* +* @param string $phpbb_root_path Path to the phpBB board root. +* @param string $php_ext PHP file extension. +* +* @return bool Returns true if phpBB is installed. +*/ +function phpbb_check_installation_exists($phpbb_root_path, $php_ext) +{ + // Try opening config file + if (file_exists($phpbb_root_path . 'config.' . $php_ext)) + { + include($phpbb_root_path . 'config.' . $php_ext); + } + + return defined('PHPBB_INSTALLED'); +} diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 034b590331..e8c8a7431d 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-a3', + 'phpbb_version' => '3.1.0-b1', 'author' => '<a href="https://www.phpbb.com/">phpBB Group</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 2e09e95ea7..b18a9dce1b 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -252,8 +252,10 @@ $paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_p $paths = array_filter($paths, 'is_dir'); $template->set_custom_style('adm', $paths); -$template->assign_var('T_ASSETS_PATH', '../assets'); -$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); +$path = array_shift($paths); + +$template->assign_var('T_ASSETS_PATH', $path . '/../../assets'); +$template->assign_var('T_TEMPLATE_PATH', $path); $install = new module(); @@ -397,7 +399,7 @@ class module } define('HEADER_INC', true); - global $template, $lang, $stage, $phpbb_root_path, $phpbb_admin_path; + global $template, $lang, $stage, $phpbb_admin_path, $path; $template->assign_vars(array( 'L_CHANGE' => $lang['CHANGE'], @@ -407,7 +409,7 @@ class module 'L_SKIP' => $lang['SKIP'], 'PAGE_TITLE' => $this->get_page_title(), 'T_IMAGE_PATH' => htmlspecialchars($phpbb_admin_path) . 'images/', - 'T_JQUERY_LINK' => $phpbb_root_path . 'assets/javascript/jquery.js', + 'T_JQUERY_LINK' => $path . '/../../assets/javascript/jquery.js', 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_FLOW_BEGIN' => ($lang['DIRECTION'] == 'ltr') ? 'left' : 'right', diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 1c7e2dca76..a837e9d52a 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -79,6 +79,21 @@ class convert */ class install_convert extends module { + /** @var array */ + protected $lang; + + /** @var string */ + protected $language; + + /** @var \phpbb\template\template */ + protected $template; + + /** @var string */ + protected $phpbb_root_path; + + /** @var string */ + protected $php_ext; + /** * Variables used while converting, they are accessible from the global variable $convert */ @@ -94,6 +109,16 @@ class install_convert extends module $this->tpl_name = 'install_convert'; $this->mode = $mode; + $this->lang = $lang; + $this->language = $language; + $this->template = $template; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + + if (!$this->check_phpbb_installed()) + { + return; + } $convert = new convert($this->p_master); @@ -108,25 +133,6 @@ class install_convert extends module switch ($sub) { case 'intro': - // Try opening config file - // @todo If phpBB is not installed, we need to do a cut-down installation here - // For now, we redirect to the installation script instead - if (@file_exists($phpbb_root_path . 'config.' . $phpEx)) - { - include($phpbb_root_path . 'config.' . $phpEx); - } - - if (!defined('PHPBB_INSTALLED')) - { - $template->assign_vars(array( - 'S_NOT_INSTALLED' => true, - 'TITLE' => $lang['BOARD_NOT_INSTALLED'], - 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=install&language=' . $language)), - )); - - return; - } - require($phpbb_root_path . 'config.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); @@ -259,6 +265,30 @@ class install_convert extends module } /** + * Check whether phpBB is installed. + * Assigns error template vars if not installed. + * + * @return bool Returns true if phpBB is installed. + */ + public function check_phpbb_installed() + { + if (phpbb_check_installation_exists($this->phpbb_root_path, $this->php_ext)) + { + return true; + } + + $this->page_title = 'BOARD_NOT_INSTALLED'; + $install_url = append_sid($this->phpbb_root_path . 'install/index.' . $this->php_ext, 'mode=install&language=' . $this->language); + + $this->template->assign_vars(array( + 'S_NOT_INSTALLED' => true, + 'BODY' => sprintf($this->lang['BOARD_NOT_INSTALLED_EXPLAIN'], $install_url), + )); + + return false; + } + + /** * Generate a list of all available conversion modules */ function list_convertors($sub) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index a2d44f2b6c..72e6f6affa 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -18,14 +18,9 @@ if (!defined('IN_INSTALL')) if (!empty($setmodules)) { // If phpBB is already installed we do not include this module - if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) + if (phpbb_check_installation_exists($phpbb_root_path, $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) { - include_once($phpbb_root_path . 'config.' . $phpEx); - - if (defined('PHPBB_INSTALLED')) - { - return; - } + return; } $module[] = array( diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 5891efb375..cdfb7ecb06 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -19,16 +19,7 @@ if (!defined('IN_INSTALL')) if (!empty($setmodules)) { // If phpBB is not installed we do not include this module - if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !@file_exists($phpbb_root_path . 'cache/install_lock')) - { - include_once($phpbb_root_path . 'config.' . $phpEx); - - if (!defined('PHPBB_INSTALLED')) - { - return; - } - } - else + if (!phpbb_check_installation_exists($phpbb_root_path, $phpEx) || file_exists($phpbb_root_path . 'cache/install_lock')) { return; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 306098bc2b..885093f1ed 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -269,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-a4-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-b2-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/common.php b/phpBB/language/en/common.php index 360d6be1e0..fba78d34aa 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -210,8 +210,6 @@ $lang = array_merge($lang, array( 'ERR_CONNECTING_SERVER' => 'Error connecting to the server.', 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', - 'ERR_TEMPLATE_EVENT_LOCATION' => 'The specified template event location <em>[%s]</em> is improperly formatted.', - 'ERR_TEMPLATE_COMPILATION' => 'The file could not be compiled: %s', 'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.', 'ERR_UNWATCHING' => 'An error occurred while trying to unsubscribe.', 'ERR_WATCHING' => 'An error occurred while trying to subscribe.', diff --git a/phpBB/language/en/mods/index.htm b/phpBB/language/en/mods/index.htm deleted file mode 100644 index e69de29bb2..0000000000 --- a/phpBB/language/en/mods/index.htm +++ /dev/null diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 24a7bebeba..3fc89ba01b 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -252,6 +252,23 @@ if (!$user_id && $username == '') $module->set_display('warn', 'warn_user', false); } +/** +* This event allows you to set display option for custom MCP modules +* +* @event core.modify_mcp_modules_display_option +* @var p_master module Module system class +* @var string mode MCP mode +* @var int user_id User id +* @var int forum_id Forum id +* @var int topic_id Topic id +* @var int post_id Post id +* @var string username User name +* @var int id Parent module id +* @since 3.1.0-b2 +*/ +$vars = array('module', 'mode', 'user_id', 'forum_id', 'topic_id', 'post_id', 'username', 'id'); +extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars))); + // Load and execute the relevant module $module->load_active(); diff --git a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php new file mode 100644 index 0000000000..ab5b1a535b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php @@ -0,0 +1,77 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class acp_prune_users_module extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT parent_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_parent = (int) $this->db->sql_fetchfield('parent_id'); + $this->db->sql_freeresult($result); + + // Skip migration if "Users" category has been deleted + // or the module has already been moved to that category + return !$acp_cat_users_id || $acp_cat_users_id === $acp_prune_users_parent; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\beta1'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'move_prune_users_module'))), + ); + } + + public function move_prune_users_module() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!class_exists('\acp_modules')) + { + include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); + } + $module_manager = new \acp_modules(); + $module_manager->module_class = 'acp'; + $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/beta1.php b/phpBB/phpbb/db/migration/data/v310/beta1.php new file mode 100644 index 0000000000..36d0c62b6f --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/beta1.php @@ -0,0 +1,33 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class beta1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\alpha3', + '\phpbb\db\migration\data\v310\passwords_p2', + '\phpbb\db\migration\data\v310\postgres_fulltext_drop', + '\phpbb\db\migration\data\v310\profilefield_change_load_settings', + '\phpbb\db\migration\data\v310\profilefield_location', + '\phpbb\db\migration\data\v310\soft_delete_mod_convert2', + '\phpbb\db\migration\data\v310\ucp_popuppm_module', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-b1')), + ); + } +} diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php index 0738cbdafd..78e219a61f 100644 --- a/phpBB/phpbb/profilefields/type/type_string_common.php +++ b/phpBB/phpbb/profilefields/type/type_string_common.php @@ -65,7 +65,7 @@ abstract class type_string_common extends type_base { return $this->user->lang('FIELD_TOO_SHORT', (int) $field_data['field_minlen'], $this->get_field_name($field_data['lang_name'])); } - else if ($field_data['field_maxlen'] && utf8_strlen($field_value) > $field_data['field_maxlen']) + else if ($field_data['field_maxlen'] && utf8_strlen(html_entity_decode($field_value)) > $field_data['field_maxlen']) { return $this->user->lang('FIELD_TOO_LONG', (int) $field_data['field_maxlen'], $this->get_field_name($field_data['lang_name'])); } diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 2a7cc602da..b9b3896606 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -204,6 +204,19 @@ class user extends \phpbb\session $this->style = $db->sql_fetchrow($result); $db->sql_freeresult($result); + // Fallback to user's standard style + if (!$this->style && $style_id != $this->data['user_style']) + { + $style_id = $this->data['user_style']; + + $sql = 'SELECT * + FROM ' . STYLES_TABLE . " s + WHERE s.style_id = $style_id"; + $result = $db->sql_query($sql, 3600); + $this->style = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + // User has wrong style if (!$this->style && $style_id == $this->data['user_style']) { @@ -618,18 +631,20 @@ class user extends \phpbb\session else if ($this->lang_name == basename($config['default_lang'])) { // Fall back to the English Language + $reset_lang_name = $this->lang_name; $this->lang_name = 'en'; $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name); + $this->lang_name = $reset_lang_name; } else if ($this->lang_name == $this->data['user_lang']) { // Fall back to the board default language + $reset_lang_name = $this->lang_name; $this->lang_name = basename($config['default_lang']); $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name); + $this->lang_name = $reset_lang_name; } - // Reset the lang name - $this->lang_name = (file_exists($lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']); return; } diff --git a/phpBB/posting.php b/phpBB/posting.php index 442e1d9782..aee9ba50af 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1213,17 +1213,11 @@ if ($submit || $preview || $refresh) meta_refresh(10, $redirect_url); $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); + trigger_error($message); } - else - { - meta_refresh(3, $redirect_url); - $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'; - $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>'); - } - - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); - trigger_error($message); + redirect($redirect_url); } } } diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index f4f67635dd..6b73b25a79 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-a3 -phpbb_version = 3.1.0-a3 +style_version = 3.1.0-b1 +phpbb_version = 3.1.0-b1 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 46695b4841..3b02431183 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -40,7 +40,7 @@ <!-- ENDIF --> <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS --> <!-- EVENT forumlist_body_subforums_before --> - <br /><strong>{forumrow.L_SUBFORUM_STR}</strong> + <br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong> <!-- BEGIN subforum --> <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --> <!-- END subforum --> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 874db3c9a7..caff3b287c 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -119,6 +119,8 @@ </form> +<!-- EVENT memberlist_view_content_append --> + <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index 9ca6077dfa..438ced13f4 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-a3 -phpbb_version = 3.1.0-a3 +style_version = 3.1.0-b1 +phpbb_version = 3.1.0-b1 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index 75646cd894..63d8aba9bb 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -52,7 +52,7 @@ <!-- ENDIF --> <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS --> <!-- EVENT forumlist_body_subforums_before --> - <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> + <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong> <!-- BEGIN subforum --> <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF --> <!-- END subforum --> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index 022d185430..b88bfc7092 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -178,6 +178,8 @@ </form> + <!-- EVENT memberlist_view_content_append --> + </div> <br clear="all" /> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 596272636a..61a28940b1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1564,13 +1564,19 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || ( $user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && + $topic_data['topic_status'] != ITEM_LOCKED && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']) ))); + $quote_allowed = $auth->acl_get('m_edit', $forum_id) || ($topic_data['topic_status'] != ITEM_LOCKED && + ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('f_reply', $forum_id)) + ); + $delete_allowed = ($user->data['is_registered'] && (($auth->acl_get('m_delete', $forum_id) || ($auth->acl_get('m_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) || ( $user->data['user_id'] == $poster_id && ($auth->acl_get('f_delete', $forum_id) || ($auth->acl_get('f_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) && + $topic_data['topic_status'] != ITEM_LOCKED && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) && // we do not want to allow removal of the last post if a moderator locked it! @@ -1611,7 +1617,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', - 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', + 'U_QUOTE' => ($quote_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', diff --git a/tests/functional/metadata_manager_test.php b/tests/functional/metadata_manager_test.php index 651c99a99d..ac08a44e30 100644 --- a/tests/functional/metadata_manager_test.php +++ b/tests/functional/metadata_manager_test.php @@ -70,7 +70,7 @@ class phpbb_functional_metadata_manager_test extends phpbb_functional_test_case // Details should be html escaped // However, text() only returns the displayed text, so HTML Special Chars are decoded. // So we test this directly on the content of the response. - $this->assertContains('<p id="require_php">>=5.3</p>', $this->get_content()); + $this->assertContains('<span id="require_php">>=5.3</span>', $this->get_content()); } public function test_extensions_details_notexists() diff --git a/tests/profile/custom_string_test.php b/tests/profile/custom_string_test.php new file mode 100644 index 0000000000..bd0b20573c --- /dev/null +++ b/tests/profile/custom_string_test.php @@ -0,0 +1,116 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; + +class phpbb_profile_custom_string_test extends phpbb_database_test_case +{ + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/profile_fields.xml'); + } + + static public function string_fields() + { + return array( + // note, there is an offset of 1 between option_id (0-indexed) + // in the database and values (1-indexed) to avoid problems with + // transmitting 0 in an HTML form + // required, value, validation, expected, description + array( + 1, + 'H3110', + '[0-9]+', + 'FIELD_INVALID_CHARS_NUMBERS_ONLY-field', + 'Required field should reject characters in a numbers-only field', + ), + array( + 1, + 'This string is too long', + '.*', + 'FIELD_TOO_LONG-10-field', + 'Required field should reject a field too long', + ), + array( + 0, + '<>"&%&><>', + '.*', + false, + 'Optional field should accept html entities', + ), + array( + 1, + 'ö ä ü ß', + '.*', + false, + 'Required field should accept UTF-8 string', + ), + array( + 1, + 'This ö ä string has to b', + '.*', + 'FIELD_TOO_LONG-10-field', + 'Required field should reject an UTF-8 string which is too long', + ), + array( + 1, + 'ö äö äö ä', + '[\w]+', + 'FIELD_INVALID_CHARS_ALPHA_ONLY-field', + 'Required field should reject UTF-8 in alpha only field', + ), + array( + 1, + 'Hello', + '[\w]+', + false, + 'Required field should accept a characters only field', + ), + ); + } + + /** + * @dataProvider string_fields + */ + public function test_string_validate($field_required, $field_value, $field_validation, $expected, $description) + { + $db = $this->new_dbal(); + + $field_data = array( + 'field_id' => 1, + 'lang_id' => 1, + 'lang_name' => 'field', + 'field_novalue' => 1, + 'field_required' => $field_required, + 'field_maxlen' => 10, + 'field_validation' => $field_validation, + ); + $user = $this->getMock('\phpbb\user'); + $user->expects($this->any()) + ->method('lang') + ->will($this->returnCallback(array($this, 'return_callback_implode'))); + + $request = $this->getMock('\phpbb\request\request'); + $template = $this->getMock('\phpbb\template\template'); + + $cp = new \phpbb\profilefields\type\type_string( + $request, + $template, + $user + ); + $result = $cp->validate_profile_field($field_value, $field_data); + + $this->assertEquals($expected, $result, $description); + } + + public function return_callback_implode() + { + return implode('-', func_get_args()); + } +} diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 2b7be9746e..74baa3d5b6 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -91,6 +91,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case '03!false', ), array( + 'if.html', + array('VALUE_TEST' => 'value'), + array(), + array(), + '03!falsevalue', + ), + array( 'loop.html', array(), array(), diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html index f6ab6e575a..71312f994c 100644 --- a/tests/template/templates/if.html +++ b/tests/template/templates/if.html @@ -19,3 +19,7 @@ false <!-- IF S_TEST !== false --> !false <!-- ENDIF --> + +<!-- IF VALUE_TEST is defined --> +{VALUE_TEST} +<!-- ENDIF --> diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d6eb4a632f..c0e58d1104 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -893,9 +893,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; @@ -919,9 +919,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; @@ -941,9 +941,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $posting_contains * @param array $form_data * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - protected function submit_post($posting_url, $posting_contains, $form_data, $expected = 'POST_STORED') + protected function submit_post($posting_url, $posting_contains, $form_data, $expected = '') { $this->add_lang('posting'); @@ -989,13 +989,13 @@ 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->assertContainsLang($expected, $crawler->filter('html')->text()); - if ($expected !== 'POST_STORED') + if ($expected !== '') { - return; + $this->assertContainsLang($expected, $crawler->filter('html')->text()); + return null; } - $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); + $url = $crawler->selectLink($form_data['subject'])->link()->getUri(); return array( 'topic_id' => $this->get_parameter_from_link($url, 't'), diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index 86e3aaae47..826ee7409a 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -52,5 +52,6 @@ then fi # redis -git clone git://github.com/nicolasff/phpredis.git redis -install_php_extension 'redis' "$php_ini_file" +# Disabled redis for now as it causes travis to fail +# git clone git://github.com/nicolasff/phpredis.git redis +# install_php_extension 'redis' "$php_ini_file" |