diff options
159 files changed, 2982 insertions, 819 deletions
diff --git a/.travis.yml b/.travis.yml index b7b17f2f19..2542898324 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,12 @@ matrix: env: DB=mysqli - php: 5.6 env: DB=mysqli + - php: 7.0 + env: DB=mysqli - php: hhvm env: DB=mysqli allow_failures: + - php: 7.0 - php: hhvm fast_finish: true @@ -43,6 +46,7 @@ script: - travis/check-sami-parse-errors.sh $DB $TRAVIS_PHP_VERSION - travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION - travis/check-executable-files.sh $DB $TRAVIS_PHP_VERSION ./ + - sh -c "if [ '$SLOWTESTS' != '1' -a '$DB' = 'mysqli' ]; then phpBB/vendor/bin/phpunit tests/lint_test.php; fi" - sh -c "if [ '$SLOWTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi" - sh -c "if [ '$SLOWTESTS' = '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml --group slow; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..6996ca22d3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,6 @@ +## CONTRIBUTE + +1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register) +2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa) +3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git) +4. Send us a pull request @@ -27,9 +27,9 @@ To be able to run an installation from the repo (and not from a pre-built packag We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below: -* develop [](http://travis-ci.org/phpbb/phpbb) -* develop-ascraeus [](http://travis-ci.org/phpbb/phpbb) -* develop-olympus [](http://travis-ci.org/phpbb/phpbb) +* [](http://travis-ci.org/phpbb/phpbb) **master** - Latest development version +* [](http://travis-ci.org/phpbb/phpbb) **3.1.x** - Development of version 3.1.x +* [](http://travis-ci.org/phpbb/phpbb) **3.0.x** - Development of version 3.0.x ## LICENSE diff --git a/build/build.xml b/build/build.xml index b0a9190898..6c91827146 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.4-dev" /> - <property name="prevversion" value="3.1.3" /> - <property name="olderversions" value="3.0.12, 3.0.13, 3.0.13-PL1, 3.1.0, 3.1.1, 3.1.2" /> + <property name="newversion" value="3.1.5-dev" /> + <property name="prevversion" value="3.1.4" /> + <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" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php new file mode 100644 index 0000000000..885c38c5b4 --- /dev/null +++ b/build/code_sniffer/phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php @@ -0,0 +1,143 @@ +<?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. +* +*/ + +/** + * Checks that the opening brace of a control structures is on the line after. + * From Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff + */ +class phpbb_Sniffs_ControlStructures_OpeningBraceBsdAllmanSniff implements PHP_CodeSniffer_Sniff +{ + /** + * Registers the tokens that this sniff wants to listen for. + */ + public function register() + { + return array( + T_IF, + T_ELSE, + T_FOREACH, + T_WHILE, + T_DO, + T_FOR, + T_SWITCH, + ); + } + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token in the + * stack passed in $tokens. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_opener']) === false) + { + return; + } + + /* + * ... + * } + * else if () + * { + * ... + */ + if ($tokens[$stackPtr]['code'] === T_ELSE && $tokens[$stackPtr + 2]['code'] === T_IF) + { + return; + } + + $openingBrace = $tokens[$stackPtr]['scope_opener']; + + /* + * ... + * do + * { + * <code> + * } while(); + * ... + * } + * else + * { + * ... + */ + if ($tokens[$stackPtr]['code'] === T_DO ||$tokens[$stackPtr]['code'] === T_ELSE) + { + $cs_line = $tokens[$stackPtr]['line']; + } + else + { + // The end of the function occurs at the end of the argument list. Its + // like this because some people like to break long function declarations + // over multiple lines. + $cs_line = $tokens[$tokens[$stackPtr]['parenthesis_closer']]['line']; + } + + $braceLine = $tokens[$openingBrace]['line']; + + $lineDifference = ($braceLine - $cs_line); + + if ($lineDifference === 0) + { + $error = 'Opening brace should be on a new line'; + $phpcsFile->addError($error, $openingBrace, 'BraceOnSameLine'); + return; + } + + if ($lineDifference > 1) + { + $error = 'Opening brace should be on the line after the declaration; found %s blank line(s)'; + $data = array(($lineDifference - 1)); + $phpcsFile->addError($error, $openingBrace, 'BraceSpacing', $data); + return; + } + + // We need to actually find the first piece of content on this line, + // as if this is a method with tokens before it (public, static etc) + // or an if with an else before it, then we need to start the scope + // checking from there, rather than the current token. + $lineStart = $stackPtr; + while (($lineStart = $phpcsFile->findPrevious(array(T_WHITESPACE), ($lineStart - 1), null, false)) !== false) + { + if (strpos($tokens[$lineStart]['content'], $phpcsFile->eolChar) !== false) + { + break; + } + } + + // We found a new line, now go forward and find the first non-whitespace + // token. + $lineStart = $phpcsFile->findNext(array(T_WHITESPACE), $lineStart, null, true); + + // The opening brace is on the correct line, now it needs to be + // checked to be correctly indented. + $startColumn = $tokens[$lineStart]['column']; + $braceIndent = $tokens[$openingBrace]['column']; + + if ($braceIndent !== $startColumn) + { + $error = 'Opening brace indented incorrectly; expected %s spaces, found %s'; + $data = array( + ($startColumn - 1), + ($braceIndent - 1), + ); + $phpcsFile->addError($error, $openingBrace, 'BraceIndent', $data); + } + } +} diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php index 18cb8ba82e..3618871b7a 100644 --- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php +++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php @@ -195,6 +195,20 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff } } + // Checks in catch blocks + $old_catch = $stackPtr; + while (($catch = $phpcsFile->findNext(T_CATCH, ($old_catch + 1))) !== false) + { + $old_catch = $catch; + + $caught_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), $catch + 1); + $caught_class_name_end = $phpcsFile->findNext($find, $caught_class_name_start + 1, null, true); + + $caught_class_name = trim($phpcsFile->getTokensAsString($caught_class_name_start, ($caught_class_name_end - $caught_class_name_start))); + + $ok = $this->check($phpcsFile, $caught_class_name, $class_name_full, $class_name_short, $catch) ? true : $ok; + } + if (!$ok) { $error = 'There must not be unused USE statements.'; diff --git a/build/code_sniffer/ruleset-minimum.xml b/build/code_sniffer/ruleset-minimum.xml index 33d0177390..13f122cae7 100644 --- a/build/code_sniffer/ruleset-minimum.xml +++ b/build/code_sniffer/ruleset-minimum.xml @@ -12,4 +12,7 @@ <!-- Tabs MUST be used for indentation --> <rule ref="Generic.WhiteSpace.DisallowSpaceIndent" /> + <!-- ALL braces MUST be on their own lines. --> + <rule ref="./phpbb/Sniffs/ControlStructures/OpeningBraceBsdAllmanSniff.php" /> + </ruleset> diff --git a/build/sami-all.conf.php b/build/sami-all.conf.php index 68350fee8f..fb1a269206 100644 --- a/build/sami-all.conf.php +++ b/build/sami-all.conf.php @@ -18,13 +18,13 @@ $config['versions'] = Sami\Version\GitVersionCollection::create(__DIR__ . '/../' This would be nice, but currently causes various problems that need debugging. ->addFromTags('release-3.0.*') - ->add('develop-olympus', '3.0-next (olympus)') + ->add('3.0.x', '3.0-next (olympus)') ->addFromTags('release-3.1.*') - ->add('develop-ascraeus', '3.1-next (ascraeus)') - ->add('develop') + ->add('3.1.x', '3.1-next (ascraeus)') + ->add('master') */ - ->add('develop-olympus') - ->add('develop-ascraeus') + ->add('3.0.x') + ->add('3.1.x') ; return new Sami\Sami($iterator, $config); diff --git a/composer.phar b/composer.phar Binary files differindex b00eef5a3e..3481b599b7 100755 --- a/composer.phar +++ b/composer.phar diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index d32348ff1c..573534fc95 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -2,6 +2,7 @@ <fieldset> <legend>{L_USER_PROFILE}</legend> + <!-- EVENT acp_users_profile_before --> <dl> <dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt> <dd><input type="email" id="jabber" name="jabber" value="{JABBER}" /></dd> @@ -10,6 +11,7 @@ <dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> <dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd> </dl> + <!-- EVENT acp_users_profile_after --> </fieldset> <!-- IF .profile_fields --> @@ -26,7 +28,7 @@ <!-- END profile_fields --> </fieldset> <!-- ENDIF --> - + <!-- EVENT acp_users_profile_custom_after --> <fieldset class="quick"> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> {S_FORM_TOKEN} diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index c818a4fc6d..6f7f129d39 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -2,7 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8"> -<meta name="viewport" content="width=device-width" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index 150ef37e0e..5f80084705 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -2,7 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8"> -<meta name="viewport" content="width=device-width" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index f1f7eee282..ada88edff2 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -2,7 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8"> -<meta name="viewport" content="width=device-width" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index d0b9bf62ed..f62a7a900e 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -2,6 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 6481a2e113..806db7d35f 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -408,7 +408,9 @@ phpbb.ajaxify = function(options) { $elements.find('input:submit').click(function () { var $this = $(this); - $this.siblings('[data-clicked]').removeAttr('data-clicked'); + // Remove data-clicked attribute from any submit button of form + $this.parents('form:first').find('input:submit[data-clicked]').removeAttr('data-clicked'); + $this.attr('data-clicked', 'true'); }); } diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php index 2096e9c858..be16e5e7cd 100644 --- a/phpBB/develop/export_events_for_wiki.php +++ b/phpBB/develop/export_events_for_wiki.php @@ -18,15 +18,19 @@ if (php_sapi_name() != 'cli') $phpEx = substr(strrchr(__FILE__, '.'), 1); $phpbb_root_path = __DIR__ . '/../'; +define('IN_PHPBB', true); function usage() { - echo "Usage: export_events_for_wiki.php COMMAND [EXTENSION]\n"; + echo "Usage: export_events_for_wiki.php COMMAND [VERSION] [EXTENSION]\n"; echo "\n"; echo "COMMAND:\n"; echo " all:\n"; echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n"; echo "\n"; + echo " diff:\n"; + echo " Generate the Event Diff for the release highlights\n"; + echo "\n"; echo " php:\n"; echo " Generate the PHP event section of Event_List\n"; echo "\n"; @@ -36,6 +40,9 @@ function usage() echo " styles:\n"; echo " Generate the Styles Template event section of Event_List\n"; echo "\n"; + echo "VERSION (diff only):\n"; + echo " Filter events (minimum version)\n"; + echo "\n"; echo "EXTENSION (Optional):\n"; echo " If not given, only core events will be exported.\n"; echo " Otherwise only events from the extension will be exported.\n"; @@ -55,20 +62,32 @@ validate_argument_count($argc, 1); $action = $argv[1]; $extension = isset($argv[2]) ? $argv[2] : null; +$min_version = null; require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx; require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx; +require __DIR__ . '/../includes/functions.' . $phpEx; require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx; require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx; switch ($action) { + + case 'diff': + echo '== Event changes ==' . "\n"; + $min_version = $extension; + $extension = isset($argv[3]) ? $argv[3] : null; + case 'all': - echo '__FORCETOC__' . "\n"; + if ($action === 'all') + { + echo '__FORCETOC__' . "\n"; + } + case 'php': - $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension); + $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension, $min_version); $exporter->crawl_phpbb_directory_php(); - echo $exporter->export_events_for_wiki(); + echo $exporter->export_events_for_wiki($action); if ($action === 'php') { @@ -78,9 +97,16 @@ switch ($action) // no break; case 'styles': - $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension); - $exporter->crawl_phpbb_directory_styles('docs/events.md'); - echo $exporter->export_events_for_wiki(); + $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version); + if ($min_version && $action === 'diff') + { + $exporter->crawl_eventsmd('docs/events.md', 'styles'); + } + else + { + $exporter->crawl_phpbb_directory_styles('docs/events.md'); + } + echo $exporter->export_events_for_wiki($action); if ($action === 'styles') { @@ -90,9 +116,16 @@ switch ($action) // no break; case 'adm': - $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension); - $exporter->crawl_phpbb_directory_adm('docs/events.md'); - echo $exporter->export_events_for_wiki(); + $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version); + if ($min_version && $action === 'diff') + { + $exporter->crawl_eventsmd('docs/events.md', 'adm'); + } + else + { + $exporter->crawl_phpbb_directory_adm('docs/events.md'); + } + echo $exporter->export_events_for_wiki($action); if ($action === 'all') { diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index acf5a318be..88df39a6d5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -6,7 +6,7 @@ <meta name="description" content="phpBB 3.1.x Changelog" /> <title>phpBB • Changelog</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,15 +16,15 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>phpBB 3.1.x Changelog</h1> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -34,19 +34,23 @@ <!-- BEGIN DOCUMENT --> -<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p> +<p class="paragraph main-description"> + This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions. + Our thanks to all those people who've contributed bug reports and code fixes. +</p> <h1>Changelog</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> <ol> <li><a href="#changelog">Changelog</a> <ul> - <li><a href="#v312">Changes since 3.1.3-RC1</a></li> + <li><a href="#v313">Changes since 3.1.3</a></li> + <li><a href="#v313rc1">Changes since 3.1.3-RC1</a></li> <li><a href="#v312">Changes since 3.1.2</a></li> <li><a href="#v311">Changes since 3.1.1</a></li> <li><a href="#v310">Changes since 3.1.0</a></li> @@ -64,6 +68,7 @@ <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> + <li><a href="#v3013-PL1">Changes since 3.0.13-PL1</a></li> <li><a href="#v3013">Changes since 3.0.13</a></li> <li><a href="#v3012">Changes since 3.0.12</a></li> <li><a href="#v3011">Changes since 3.0.11</a></li> @@ -94,7 +99,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -102,10 +107,128 @@ <a name="changelog"></a><h2>1. Changelog</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> + <a name="v313"></a><h3>Changes since 3.1.3</h3> + + <h4>Security</h4> + <ul> + <li>[SECURITY-180] - An insufficient check allowed users of the Google Chrome browser to be redirected to external domains (e.g. on login)</li> + </ul> + <h4>Bug</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8050">PHPBB3-8050</a>] - Avatar & Long PM recipients list break out of template</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8250">PHPBB3-8250</a>] - Forum selections in MCP queue not working</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8494">PHPBB3-8494</a>] - Cannot install two boards on the same postgresql database</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11424">PHPBB3-11424</a>] - Quick-Mod Tools race condition results in NO_MODE</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12368">PHPBB3-12368</a>] - Updating database fails in upgrade from 3.0 when trying twice without purging the cache</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13348">PHPBB3-13348</a>] - sql_freeresult() should be called in feed base class</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13414">PHPBB3-13414</a>] - download/file.php 304 Not Modified bug</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13433">PHPBB3-13433</a>] - A dot in email address leads to unwanted extraneous dot</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13463">PHPBB3-13463</a>] - Mark read icon displays on wrong side in RTL</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13469">PHPBB3-13469</a>] - Soft delete fails with error message</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13472">PHPBB3-13472</a>] - Notification for admin activation of user doesn't get pruned after the user is deleted</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13477">PHPBB3-13477</a>] - File caching of extensions' version check file doesn't work</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13493">PHPBB3-13493</a>] - $helper->route gives wrong path for guests with trailing slashes and mod_rewrite disabled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13522">PHPBB3-13522</a>] - Q&A Captcha ACP, admins can add blank answers</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13538">PHPBB3-13538</a>] - Add tests for pagination in nested loops</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13542">PHPBB3-13542</a>] - Add $error to core UCP event for better validating of new UCP options</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13550">PHPBB3-13550</a>] - Invalid JSON response returned when plupload dir is not writable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13551">PHPBB3-13551</a>] - Authentication method- LDAP- entered value 'ldap base dn' does not display</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13555">PHPBB3-13555</a>] - Poll options preview rendered incorrectly by <br /> collision</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13563">PHPBB3-13563</a>] - No Private Message button shown in memberlist for subsilver2</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13568">PHPBB3-13568</a>] - Imagick path validated as relative path although ACP asks for absolute path</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13569">PHPBB3-13569</a>] - Use sql_freeresult for $result assignments and remove unneeded $result assignments</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13570">PHPBB3-13570</a>] - Mysqli extension supports persistent connection since PHP 5.3.0</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13577">PHPBB3-13577</a>] - Skip tests requiring fileinfo if fileinfo is not enabled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13586">PHPBB3-13586</a>] - Allow '0' as username with Jabber notifications</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13587">PHPBB3-13587</a>] - SQL syntax errors in get_prune_users()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13588">PHPBB3-13588</a>] - Information message for disabled fsockopen() is not displayed correctly</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13590">PHPBB3-13590</a>] - Remember me login keys should be centered</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13597">PHPBB3-13597</a>] - Modify variable-variable syntax to be compatible with PHP7</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13612">PHPBB3-13612</a>] - Functional test of extension fails if ext requires page refresh</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13615">PHPBB3-13615</a>] - Avatar Gallery shows categories but no images in subsilver2</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13617">PHPBB3-13617</a>] - Bot session continuation with invalid f= query paramter causes SQL error</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13618">PHPBB3-13618</a>] - Small grammatical typo in the English FAQ regarding COPPA</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13631">PHPBB3-13631</a>] - Fix variable name in core.phpbb_content_visibility_get_global_visibility_before event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13639">PHPBB3-13639</a>] - Unused class icon-search-advanced references nonexistent image</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13644">PHPBB3-13644</a>] - Type hint dispatcher_interface instead of dispatcher</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13649">PHPBB3-13649</a>] - Subforum tooltip always displays "no unread posts" on viewforum.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13655">PHPBB3-13655</a>] - $phpbb_dispatcher undefined in phpbb_mcp_sorting()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13657">PHPBB3-13657</a>] - Start testing against PHP7</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13666">PHPBB3-13666</a>] - data-clicked attribute is not always removed on ajax form submissions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13667">PHPBB3-13667</a>] - Big buttons are incorrectly aligned in Chrome on Windows</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13670">PHPBB3-13670</a>] - Fix fatal function name must be a string in functional tests</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13698">PHPBB3-13698</a>] - Incorrect password message shows unparsed "Board Administrator"-link</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13702">PHPBB3-13702</a>] - Page is zoomed in by default on iOS devices in landscape mode</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13703">PHPBB3-13703</a>] - Uploaded avatars are not loading correctly when passing through the events</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13719">PHPBB3-13719</a>] - Remove superfluous $search_options in acp_search.php </li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13721">PHPBB3-13721</a>] - URL Rewriting doesn't work on IIS7</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13723">PHPBB3-13723</a>] - Update docs/AUTHORS for 3.1.4-RC1</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13726">PHPBB3-13726</a>] - Responsive breadcrumbs JavaScript incorrectly calculates width of hidden items</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13727">PHPBB3-13727</a>] - Responsive breadcrumbs JavaScript doesn't reset wrap- classes when resizing</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13732">PHPBB3-13732</a>] - Update composer for PHP7 compatibility</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13736">PHPBB3-13736</a>] - Replace colons with colon lang keys in Contact us page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13738">PHPBB3-13738</a>] - Sami still refers to develop-* branches</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13741">PHPBB3-13741</a>] - Remove outdated comments in CSS files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13742">PHPBB3-13742</a>] - Local avatar driver is not generating correct urls on index</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13743">PHPBB3-13743</a>] - Missing global vars $phpbb_root_path and $phpEx in message_parser.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13747">PHPBB3-13747</a>] - Fix test_validate_path_linux method</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13749">PHPBB3-13749</a>] - Add missing slash to base uri in helper route tests</li> + </ul> + <h4>Improvement</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13313">PHPBB3-13313</a>] - Add a core php event to the mass email form</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13467">PHPBB3-13467</a>] - Add a CONTRIBUTING file to the project on Github</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13510">PHPBB3-13510</a>] - Add template event before/after the pagination on viewtopic</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13512">PHPBB3-13512</a>] - Add template events to viewtopic_body.html before/after the post details</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13518">PHPBB3-13518</a>] - Add core event to markread() in functions.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13532">PHPBB3-13532</a>] - Add core event to get_unread_topics() in functions.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13533">PHPBB3-13533</a>] - Add template events to the header of search_results.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13535">PHPBB3-13535</a>] - Add ucp_profile.php core event to allow modifying account settings on editing</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13536">PHPBB3-13536</a>] - Add UCP/ACP core events to allow modifying user profile data on editing</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13537">PHPBB3-13537</a>] - Add core events on mcp_queue for approval and disapproval</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13540">PHPBB3-13540</a>] - Add events to the topic review while posting and moderating posts</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13578">PHPBB3-13578</a>] - Add ucp_register.php core event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13591">PHPBB3-13591</a>] - Add functions.php core event to the function obtain_users_online_string()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13595">PHPBB3-13595</a>] - Remove unused instances of the bbcode class</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13596">PHPBB3-13596</a>] - Add display_forums() core event to allow modifying forums list data</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13600">PHPBB3-13600</a>] - Add core event to allow extensions to create a custom help page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13602">PHPBB3-13602</a>] - Add template event overall_header_navbar_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13628">PHPBB3-13628</a>] - Add template events into ucp profile html files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13635">PHPBB3-13635</a>] - Add sql_ary to UCP profile event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13637">PHPBB3-13637</a>] - Add php event for modifying the data when composing a PM</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13643">PHPBB3-13643</a>] - kernel_terminate_subscriber should have a very low priority</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13650">PHPBB3-13650</a>] - New core event for UCP profile mode</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13658">PHPBB3-13658</a>] - [Event] - Before and after deletion of topics</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13675">PHPBB3-13675</a>] - Add validate to acp_profile event and add template events</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13679">PHPBB3-13679</a>] - Add template event overall_header_searchbox_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13701">PHPBB3-13701</a>] - New posting_pm_layout.html template events to wrap "include posting_pm_header.html"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13710">PHPBB3-13710</a>] - Add template events around smilies display</li> + </ul> + <h4>New Feature</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13336">PHPBB3-13336</a>] - New core events for user activation</li> + </ul> + <h4>Sub-task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13142">PHPBB3-13142</a>] - [Event] - Before query to list unapproved and deleted posts</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13592">PHPBB3-13592</a>] - Add core event to allow changing get_visibility_sql's result</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13621">PHPBB3-13621</a>] - Fix event phpbb_content_visibility_get_forums_visibility_before to get where_sql working as specified</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13625">PHPBB3-13625</a>] - Add more variables to core.viewforum_get_topic_data</li> + </ul> + <h4>Task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9457">PHPBB3-9457</a>] - [Accessibility] - Add WAI-ARIA landmarks to the Prosilver template files</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12599">PHPBB3-12599</a>] - Update documentation styling</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13572">PHPBB3-13572</a>] - Upgrade composer to 1.0.0-alpha9</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13626">PHPBB3-13626</a>] - Add branch aliases</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13634">PHPBB3-13634</a>] - Update README to show new branch names</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13640">PHPBB3-13640</a>] - Rearrange order of color css rules</li> + </ul> + <a name="v313rc1"></a><h3>Changes since 3.1.3-RC1</h3> <h4>Bug</h4> @@ -2210,6 +2333,35 @@ <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="v3013-PL1"></a><h3>Changes since 3.0.13-PL1</h3> + +<h4>Security</h4> +<ul> +<li>[SECURITY-180] - An insufficient check allowed users of the Google Chrome browser to be redirected to external domains (e.g. on login)</li> +</ul> +<h4>Bug</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13348">PHPBB3-13348</a>] - sql_freeresult() should be called in feed base class</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13414">PHPBB3-13414</a>] - download/file.php sends Content-Length header even when issuing 304 Not Modified</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13555">PHPBB3-13555</a>] - Poll options preview rendered incorrectly by <br /> collision</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13568">PHPBB3-13568</a>] - Imagick path validated as relative path although ACP asks for absolute path</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13617">PHPBB3-13617</a>] - Bot session continuation with invalid f= query parameter causes SQL error</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13738">PHPBB3-13738</a>] - Sami still refers to develop-* branches</li> +</ul> +<h4>Improvement</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12089">PHPBB3-12089</a>] - Make HTTP status code assertion failure messages more informative</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13765">PHPBB3-13765</a>] - Verify that SERVER_PROTOCOL has the expected format</li> +</ul> +<h4>Task</h4> +<ul> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11539">PHPBB3-11539</a>] - Add unit tests for several functions in functions.php</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13572">PHPBB3-13572</a>] - Upgrade composer to 1.0.0-alpha9</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13599">PHPBB3-13599</a>] - Remove PHP 5.2 Travis environment</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13634">PHPBB3-13634</a>] - Update README to show new branch names</li> +<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13723">PHPBB3-13723</a>] - Update docs/AUTHORS for 3.0.14-RC1 / 3.1.4-RC1</li> +</ul> + <a name="v3013"></a><h3>Changes since 3.0.13</h3> <h4>Bug</h4> @@ -4713,7 +4865,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -4721,7 +4873,7 @@ <a name="disclaimer"></a><h2>2. Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -4731,7 +4883,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt index 5c17787495..e3f2b325e8 100644 --- a/phpBB/docs/CREDITS.txt +++ b/phpBB/docs/CREDITS.txt @@ -24,9 +24,10 @@ phpBB Lead Developer: naderman (Nils Adermann) phpBB Developers: bantu (Andreas Fischer) dhruv.goel92 (Dhruv Goel) + Elsensee (Oliver Schramm) marc1706 (Marc Alexander) nickvergessen (Joas Schilling) - nicofuma (Tristan Darricau) + Nicofuma (Tristan Darricau) prototech (Cesar Gallegos) For a list of phpBB Team members, please see: diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index cd1ec4ae14..0b3b421e72 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -6,7 +6,7 @@ <meta name="description" content="phpBB 3.1.x frequently asked questions" /> <title>phpBB • FAQ</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,16 +16,16 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>phpBB 3.1.x FAQ</h1> <p>phpBB 3.1.x frequently asked questions</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -35,12 +35,17 @@ <!-- BEGIN DOCUMENT --> - <p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB, the community forums and our IRC channel (see <a href="README.html">README</a> for details).</p> + <p class="paragraph main-description"> + This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the + more commonly asked questions. It is by no means exhaustive and should be used in combination with + the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel + (see <a href="README.html">README</a> for details). + </p> <h1>FAQ</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -66,7 +71,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -74,7 +79,7 @@ <a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -88,7 +93,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -99,7 +104,7 @@ A board is dealing in warez/porn/etc., you need to prevent them doing this!<br / I want to sue you because i think you host an illegal board!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -111,7 +116,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -119,7 +124,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="viewonline"></a><h2>According to viewonline a user is doing/reading something they should not be able to!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -131,7 +136,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -139,7 +144,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="mail"></a><h2>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -151,7 +156,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -159,7 +164,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="mail_language"></a><h2>My users are complaining that emails are not in their selected language!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -171,7 +176,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -179,7 +184,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="aol_browser"></a><h2>My AOL based users keep getting logged out!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -193,7 +198,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -201,7 +206,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -213,7 +218,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -221,7 +226,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="gallery_avatars"></a><h2>I just cannot get gallery avatars to appear!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -231,7 +236,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -239,7 +244,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="permissions"></a><h2>How do I use/set permissions?</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -249,7 +254,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -257,7 +262,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="login_issues"></a><h2>I (or my users) cannot stay logged in to the forum!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -269,7 +274,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -277,7 +282,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="logout_issues"></a><h2>My users are complaining about being logged out too quickly!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -287,7 +292,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -295,7 +300,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="not_answered"></a><h2>My question isn't answered here!</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -309,7 +314,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -317,7 +322,7 @@ I want to sue you because i think you host an illegal board!</h2> <a name="disclaimer"></a><h2>Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -327,7 +332,7 @@ I want to sue you because i think you host an illegal board!</h2> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index df863917e2..d1c0fe1438 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -6,7 +6,7 @@ <meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" /> <title>phpBB • Install</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,16 +16,16 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>phpBB 3.1.x Install</h1> <p>phpBB 3.1.x Installation, updating and conversion informations</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -35,16 +35,22 @@ <!-- BEGIN DOCUMENT --> -<p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p> - -<p>This document will walk you through the basics on installing, updating and converting the forum software.</p> +<div class="paragraph"> + <p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p> -<p>A basic overview of running phpBB can be found in the accompanying <a href="README.html">README</a> file. Please ensure you read that document in addition to this! For more detailed information on using, installing, updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">the documentation</a> available online.</p> + <p>This document will walk you through the basics on installing, updating and converting the forum software.</p> + <p> + A basic overview of running phpBB can be found in the accompanying <a href="README.html">README</a> file. + Please ensure you read that document in addition to this! For more detailed information on using, installing, + updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">the documentation</a> + available online. + </p> +</div> <h1>Install</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -82,7 +88,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -90,7 +96,7 @@ <a name="quickinstall"></a><h2>1. Quick install</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -114,7 +120,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -122,7 +128,7 @@ <a name="require"></a><h2>2. Requirements</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -165,7 +171,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -173,7 +179,7 @@ <a name="install"></a><h2>3. New installation</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -245,7 +251,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -253,7 +259,7 @@ <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.1.x</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -297,7 +303,7 @@ <p>This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.</p> - <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.12</strong>, you need the <code>phpBB-3.0.12_to_3.0.13.zip/tar.bz2</code> file.</p> + <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.13</strong>, you need the <code>phpBB-3.0.13_to_3.0.14.zip/tar.bz2</code> file.</p> <p>To perform the update, either follow the instructions from the <strong>Administration Control Panel->System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p> @@ -321,7 +327,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -363,7 +369,7 @@ <a name="convert"></a><h2>6. Conversion from phpBB 2.0.x to phpBB 3.1.x</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -418,7 +424,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -426,7 +432,7 @@ <a name="postinstall"></a><h2>7. Important (security related) post-Install tasks for all installation methods</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -456,7 +462,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -464,7 +470,7 @@ <a name="anti_spam"></a><h2>8. Anti-Spam Measures</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> <p>Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as <a href="http://en.wikipedia.org/wiki/Forum_spam">forum spam</a>. The vast majority of these attacks will be from automated computer programs known as <a href="http://en.wikipedia.org/wiki/Spambot">spambots</a>. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for <a href="https://www.phpbb.com/support/spam/">Preventing Spam in phpBB</a> as soon as possible after completing the installation of your board.</p> @@ -472,7 +478,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -480,7 +486,7 @@ <a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -490,7 +496,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index b66f47178e..f5ac3ecacd 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -6,7 +6,7 @@ <meta name="description" content="phpBB 3.1.x Readme" /> <title>phpBB • Readme</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,15 +16,15 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>phpBB 3.1.x Readme</h1> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -34,12 +34,16 @@ <!-- BEGIN DOCUMENT --> - <p>Thank you for downloading phpBB. This README will guide you through the basics of installation and operation of phpBB. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p> + <p class="paragraph main-description"> + Thank you for downloading phpBB. This README will guide you through the basics of installation + and operation of phpBB. Please ensure you read this and the accompanying documentation fully + <strong>before</strong> proceeding with the installation. + </p> <h1>Readme</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -73,7 +77,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -81,7 +85,7 @@ <a name="install"></a><h2>1. Installing phpBB</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!</p> @@ -110,7 +114,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -118,7 +122,7 @@ <a name="run"></a><h2>2. Running phpBB</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -162,7 +166,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -170,7 +174,7 @@ <a name="help"></a><h2>3. Getting help with phpBB</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -208,7 +212,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -216,7 +220,7 @@ <a name="status"></a><h2>4. Status of this version</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -232,7 +236,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -240,7 +244,7 @@ <a name="bugs"></a><h2>5. Reporting Bugs</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -283,7 +287,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -291,7 +295,7 @@ <a name="curbugs"></a><h2>6. Overview of current bug list</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -307,7 +311,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -315,7 +319,7 @@ <a name="php"></a><h2>7. PHP compatibility issues</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -333,7 +337,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -341,7 +345,7 @@ <a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -351,7 +355,7 @@ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/stylesheet.css b/phpBB/docs/assets/css/stylesheet.css index 6b8f5994c0..192a6f9f79 100644 --- a/phpBB/docs/stylesheet.css +++ b/phpBB/docs/assets/css/stylesheet.css @@ -11,13 +11,21 @@ body { font-family: Verdana, Helvetica, Arial, sans-serif; color: #828282; background-color: #FFFFFF; - font-size: 12px; + font-size: 10px; margin: 0; padding: 12px 0; } img { border-width: 0; } +ul, ol { + font-size: 1.1em; +} + +ul ul, ol ol { + font-size: inherit; +} + p { line-height: 1.3em; font-size: 1.1em; @@ -70,7 +78,7 @@ h3 { border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; padding-bottom: 2px; - font-size: 1.05em; + font-size: 1.1em; color: #115098; margin-top: 20px; } @@ -80,7 +88,7 @@ h4 { font-weight: bold; margin-bottom: 3px; padding-bottom: 2px; - font-size: 1.05em; + font-size: 1.1em; color: #115098; margin-top: 20px; } @@ -104,6 +112,7 @@ code { border-width: 1px; border-style: solid; background-color: #FAFAFA; + padding: 0 4px; } #wrap { @@ -145,44 +154,16 @@ a#logo:hover { .headerbar { background: #ebebeb none repeat-x 0 0; + border-radius: 7px; color: #FFFFFF; margin-bottom: 4px; - padding: 0 5px; -} - -span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span { - font-size: 1px; - line-height: 1px; - display: block; - height: 5px; - background-repeat: no-repeat; -} - -span.corners-top { - background-image: none; - background-position: 0 0; - margin: 0 -5px; -} - -span.corners-top span { - background-image: none; - background-position: 100% 0; -} - -span.corners-bottom { - background-image: none; - background-position: 0 100%; - margin: 0 -5px; - clear: both; -} - -span.corners-bottom span { - background-image: none; - background-position: 100% 100%; + padding: 5px; } .paragraph { - padding: 0 10px; + border-radius: 7px; + font-size: 1.1em; + padding: 5px 10px; margin-bottom: 4px; background-repeat: no-repeat; background-position: 100% 0; @@ -197,6 +178,10 @@ span.corners-bottom span { color: #000000; } +.main-description { + font-size: 1.15em; +} + .content { color: #333333; } @@ -222,7 +207,7 @@ hr { .headerbar { background-color: #12A3EB; - background-image: url("bg_header.gif"); + background-image: url("../images/bg_header.gif"); color: #FFFFFF; } @@ -231,23 +216,6 @@ hr { color: #28313F; } - -span.corners-top { - background-image: url("corners_left.png"); -} - -span.corners-top span { - background-image: url("corners_right.png"); -} - -span.corners-bottom { - background-image: url("corners_left.png"); -} - -span.corners-bottom span { - background-image: url("corners_right.png"); -} - .error { color: #BC2A4D; } @@ -257,10 +225,6 @@ a:visited { color: #105289; } a:hover { color: #D31141; } a:active { color: #368AD2; } -.paragraph span.corners-top, .paragraph span.corners-bottom { - margin: 0 -10px; -} - .content { padding: 0; line-height: 1.48em; @@ -288,13 +252,17 @@ a:active { color: #368AD2; } } * html hr { margin: 0; } -* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); } -* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); } -.back2top { - clear: both; +.top { + background: url("../images/icon_back_top.gif") no-repeat top left; + text-decoration: none; + width: 11px; height: 11px; - text-align: right; + display: block; + float: right; + overflow: hidden; + letter-spacing: 1000px; + text-indent: 11px; } .content ol, .content ul { @@ -350,3 +318,9 @@ a:active { color: #368AD2; } clear: both; margin-right: 1em; } + +.inner:after { + clear: both; + content: ''; + display: block; +} diff --git a/phpBB/docs/bg_header.gif b/phpBB/docs/assets/images/bg_header.gif Binary files differindex 351de9f46a..351de9f46a 100644 --- a/phpBB/docs/bg_header.gif +++ b/phpBB/docs/assets/images/bg_header.gif diff --git a/phpBB/docs/assets/images/icon_back_top.gif b/phpBB/docs/assets/images/icon_back_top.gif Binary files differnew file mode 100644 index 0000000000..4d2b8f3822 --- /dev/null +++ b/phpBB/docs/assets/images/icon_back_top.gif diff --git a/phpBB/docs/assets/images/site_logo.gif b/phpBB/docs/assets/images/site_logo.gif Binary files differnew file mode 100644 index 0000000000..2517fbedd6 --- /dev/null +++ b/phpBB/docs/assets/images/site_logo.gif diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index 703e7a18c1..d571e72dd4 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -6,7 +6,7 @@ <meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" /> <title>phpBB3 • Auth API</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,16 +16,16 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>Auth API</h1> <p>This is an explanation of how to use the phpBB auth/acl API</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -35,12 +35,12 @@ <!-- BEGIN DOCUMENT --> - <p>This is an explanation of how to use the phpBB auth/acl API.</p> + <p class="paragraph main-description">This is an explanation of how to use the phpBB auth/acl API.</p> <h1>Auth API</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -65,7 +65,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -73,7 +73,7 @@ <a name="intro"></a><h2>1. Introduction</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -86,8 +86,8 @@ <p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p> <div class="codebox"><pre> -$auth = new phpbb\auth\auth(); - </pre></div> +$auth = new phpbb\auth\auth();</pre> + </div> <p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p> @@ -95,7 +95,7 @@ $auth = new phpbb\auth\auth(); <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -103,7 +103,7 @@ $auth = new phpbb\auth\auth(); <a name="methods"></a><h2>2. Methods</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -114,8 +114,8 @@ $auth = new phpbb\auth\auth(); <p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p> <div class="codebox"><pre> -$auth->acl(<code>userdata</code>); - </pre></div> +$auth->acl(<code>userdata</code>);</pre> + </div> <p>Where userdata is the array containing the aforementioned data.</p> @@ -124,8 +124,8 @@ $auth->acl(<code>userdata</code>); <p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p> <div class="codebox"><pre> -$result = $auth->acl_get(<code>option</code>[, <code>forum</code>]); - </pre></div> +$result = $auth->acl_get(<code>option</code>[, <code>forum</code>]);</pre> + </div> <p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p> @@ -142,8 +142,8 @@ $result = $auth->acl_get(<code>option</code>[, <code>forum</code>]); <p>The method should be called thus:</p> <div class="codebox"><pre> -$result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]); - </pre></div> +$result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);</pre> + </div> <p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p> @@ -154,16 +154,16 @@ $result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., < <p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p> <div class="codebox"><pre> -$result = $auth->acl_getf(<code>option</code>[, <code>clean</code>]); - </pre></div> +$result = $auth->acl_getf(<code>option</code>[, <code>clean</code>]);</pre> + </div> <p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p> <p>The method returns an associative array of the form:</p> <div class="codebox"><pre> -array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <em>forum_id2</em> => ...) - </pre></div> +array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <em>forum_id2</em> => ...)</pre> + </div> <p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p> @@ -172,8 +172,8 @@ array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <e <p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p> <div class="codebox"><pre> -$result = $auth->acl_getf_global(<code>option</code>) - </pre></div> +$result = $auth->acl_getf_global(<code>option</code>)</pre> + </div> <p>As with the previous methods option is a string specifying the permission which has to be checked.</p> @@ -230,7 +230,7 @@ $result = $auth->acl_get_list($user_id, $permissions, $forum_id); <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -238,7 +238,7 @@ $result = $auth->acl_get_list($user_id, $permissions, $forum_id); <a name="admin_related"></a><h2>3. Admin related functions</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -247,8 +247,8 @@ $result = $auth->acl_get_list($user_id, $permissions, $forum_id); <p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p> <div class="codebox"><pre> -$auth_admin = new auth_admin(); - </pre></div> +$auth_admin = new auth_admin();</pre> + </div> <p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p> @@ -256,7 +256,7 @@ $auth_admin = new auth_admin(); <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -264,7 +264,7 @@ $auth_admin = new auth_admin(); <a name="disclaimer"></a><h2>4. Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -274,7 +274,7 @@ $auth_admin = new auth_admin(); <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 98cfe0e717..4c5fe73543 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -6,7 +6,7 @@ <meta name="description" content="Ascraeus coding guidelines document" /> <title>phpBB3 • Coding Guidelines</title> -<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> +<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> @@ -16,16 +16,16 @@ <a id="top" name="top" accesskey="t"></a> <div id="page-header"> <div class="headerbar"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div id="doc-description"> - <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a> <h1>Coding Guidelines</h1> <p>Ascraeus coding guidelines document</p> <p style="display: none;"><a href="#start_here">Skip</a></p> </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> </div> @@ -35,12 +35,14 @@ <!-- BEGIN DOCUMENT --> -<p>These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.</p> +<p class="paragraph main-description"> + These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible. +</p> <h1>Coding Guidelines</h1> <div class="paragraph menu"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -89,7 +91,7 @@ </div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -97,7 +99,7 @@ <a name="defaults"></a><h2>1. Defaults</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -109,8 +111,8 @@ <div class="codebox"><pre> {TAB}$mode{TAB}{TAB}= $request->variable('mode', ''); -{TAB}$search_id{TAB}= $request->variable('search_id', ''); - </pre></div> +{TAB}$search_id{TAB}= $request->variable('search_id', '');</pre> + </div> <p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p> @@ -133,8 +135,8 @@ * For full copyright and license information, please see * the docs/CREDITS.txt file. * -*/ - </pre></div> +*/</pre> + </div> <p>Please see the <a href="#locations">File Locations section</a> for the correct package name.</p> @@ -157,8 +159,8 @@ /** */ -{CODE} - </pre></div> +{CODE}</pre> + </div> <h4>Files containing only functions:</h4> @@ -185,8 +187,8 @@ Small code snipped, mostly one or two defines or an if statement /** * {DOCUMENTATION} */ -class ... - </pre></div> +class ...</pre> + </div> <a name="locations"></a><h3>1.iii. File Locations</h3> @@ -274,7 +276,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -282,7 +284,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c <a name="code"></a><h2>2. Code Layout/Guidelines</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -317,8 +319,8 @@ for ($i = 0; $i < $outer_size; $i++) { foo($i, $j); } -} - </pre></div> +}</pre> + </div> <h4>Function Names:</h4> <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are <code>phpbb_print_login_status()</code>, <code>phpbb_get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p> @@ -344,14 +346,14 @@ phpbb/ dir/ class_name.php subdir/ - class_name.php - </pre></div> + class_name.php</pre> + </div> <div class="codebox"><pre> \phpbb\class_name - phpbb/class_name.php \phpbb\dir\class_name - phpbb/dir/class_name.php -\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php - </pre></div> +\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php</pre> + </div> <h4>Summary:</h4> @@ -377,8 +379,8 @@ while (condition) do_stuff(); for ($i = 0; $i < size; $i++) - do_stuff($i); - </pre></div> + do_stuff($i);</pre> + </div> <p class="good">// These are all right. </p> <div class="codebox"><pre> @@ -395,8 +397,8 @@ while (condition) for ($i = 0; $i < size; $i++) { do_stuff(); -} - </pre></div> +}</pre> + </div> <h4>Where to put the braces:</h4> <p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p> @@ -427,8 +429,8 @@ while (condition) function do_stuff() { ... -} - </pre></div> +}</pre> + </div> <p>In JavaScript code, braces always go on the same line:</p> @@ -451,8 +453,8 @@ while (condition) { function do_stuff() { ... -} - </pre></div> +}</pre> + </div> <h4>Use spaces between tokens:</h4> <p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p> @@ -476,26 +478,26 @@ for($i=0; $i<$size; $i++) ... for ($i = 0; $i < $size; $i++) ... $i=($j < $size)?0:1; -$i = ($j < $size) ? 0 : 1; - </pre></div> +$i = ($j < $size) ? 0 : 1;</pre> + </div> <h4>Operator precedence:</h4> <p>Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:</p> <p class="bad">// what's the result? who knows. </p> - <div class="codebox"><pre> -$bool = ($i < 7 && $j > 8 || $k == 4); - </pre></div> + <div class="codebox"> + <pre>$bool = ($i < 7 && $j > 8 || $k == 4);</pre> + </div> <p class="bad">// now you can be certain what I'm doing here.</p> - <div class="codebox"><pre> -$bool = (($i < 7) && (($j < 8) || ($k == 4))); - </pre></div> + <div class="codebox"> + <pre>$bool = (($i < 7) && (($j < 8) || ($k == 4)));</pre> + </div> <p class="good">// But this one is even better, because it is easier on the eye but the intention is preserved</p> - <div class="codebox"><pre> -$bool = ($i < 7 && ($j < 8 || $k == 4)); - </pre></div> + <div class="codebox"> + <pre>$bool = ($i < 7 && ($j < 8 || $k == 4));</pre> + </div> <h4>Quoting strings:</h4> <p>There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should <em>always</em> use single quotes <em>unless</em> you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.</p> @@ -505,25 +507,25 @@ $bool = ($i < 7 && ($j < 8 || $k == 4)); <div class="codebox"><pre> $str = "This is a really long string with no variables for the parser to find."; -do_stuff("$str"); - </pre></div> +do_stuff("$str");</pre> + </div> <p class="good">// right</p> <div class="codebox"><pre> $str = 'This is a really long string with no variables for the parser to find.'; -do_stuff($str); - </pre></div> +do_stuff($str);</pre> + </div> <p class="bad">// Sometimes single quotes are just not right</p> <div class="codebox"><pre> -$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start; - </pre></div> +$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start;</pre> + </div> <p class="good">// Double quotes are sometimes needed to not overcrowd the line with concatenations.</p> <div class="codebox"><pre> -$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start"; - </pre></div> +$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start";</pre> + </div> <p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p> @@ -535,40 +537,40 @@ $post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start"; $foo = array( 'bar' => 42, 'boo' => 23 -); - </pre></div> +);</pre> + </div> <p class="good">// right </p> <div class="codebox"><pre> $foo = array( 'bar' => 42, 'boo' => 23, -); - </pre></div> +);</pre> + </div> <h4>Associative array keys:</h4> <p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p> <p class="bad">// wrong</p> - <div class="codebox"><pre> -$foo = $assoc_array[blah]; - </pre></div> + <div class="codebox"> + <pre>$foo = $assoc_array[blah];</pre> + </div> <p class="good">// right </p> - <div class="codebox"><pre> -$foo = $assoc_array['blah']; - </pre></div> + <div class="codebox"> + <pre>$foo = $assoc_array['blah'];</pre> + </div> <p class="bad">// wrong</p> - <div class="codebox"><pre> -$foo = $assoc_array["$var"]; - </pre></div> + <div class="codebox"> + <pre>$foo = $assoc_array["$var"];</pre> + </div> <p class="good">// right </p> - <div class="codebox"><pre> -$foo = $assoc_array[$var]; - </pre></div> + <div class="codebox"> + <pre>$foo = $assoc_array[$var];</pre> + </div> <h4>Comments:</h4> <p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p> @@ -582,8 +584,8 @@ $foo = $assoc_array[$var]; <p class="bad">// wrong </p> <div class="codebox"><pre> $array[++$i] = $j; -$array[$i++] = $k; - </pre></div> +$array[$i++] = $k;</pre> + </div> <p class="good">// right </p> <div class="codebox"><pre> @@ -591,39 +593,38 @@ $i++; $array[$i] = $j; $array[$i] = $k; -$i++; - </pre></div> +$i++;</pre> + </div> <h4>Inline conditionals:</h4> <p>Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:</p> <p class="bad">// Bad place to use them</p> <div class="codebox"><pre> -($i < $size && $j > $size) ? do_stuff($foo) : do_stuff($bar); - </pre></div> +($i < $size && $j > $size) ? do_stuff($foo) : do_stuff($bar);</pre> + </div> <p class="good">// OK place to use them </p> <div class="codebox"><pre> -$min = ($i < $j) ? $i : $j; - </pre></div> +$min = ($i < $j) ? $i : $j;</pre> + </div> <h4>Don't use uninitialized variables.</h4> <p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p> <p class="bad">// Wrong </p> - <div class="codebox"><pre> -if ($forum) ... - </pre></div> + <div class="codebox"> + <pre>if ($forum) ...</pre> + </div> <p class="good">// Right </p> - <div class="codebox"><pre> -if (isset($forum)) ... - </pre></div> + <div class="codebox"> + <pre>if (isset($forum)) ...</pre></div> <p class="good">// Also possible</p> - <div class="codebox"><pre> -if (isset($forum) && $forum == 5) - </pre></div> + <div class="codebox"> + <pre>if (isset($forum) && $forum == 5)</pre> + </div> <p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) && sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p> @@ -640,8 +641,8 @@ switch ($mode) case 'mode2': // I am doing something completely different here break; -} - </pre></div> +}</pre> + </div> <p class="good">// Good </p> <div class="codebox"><pre> @@ -658,8 +659,8 @@ switch ($mode) default: // Always assume that a case was not caught break; -} - </pre></div> +}</pre> + </div> <p class="good">// Also good, if you have more code between the case and the break </p> <div class="codebox"><pre> @@ -682,8 +683,8 @@ switch ($mode) // Always assume that a case was not caught break; -} - </pre></div> +}</pre> + </div> <p>Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.</p> @@ -710,8 +711,8 @@ switch ($mode) // Always assume that a case was not caught break; -} - </pre></div> +}</pre> + </div> <h4>Class Members</h4> <p>Use the explicit visibility qualifiers <code>public</code>, <code>private</code> and <code>protected</code> for all properties instead of <code>var</code>. @@ -721,14 +722,14 @@ switch ($mode) <p class="bad">//Wrong </p> <div class="codebox"><pre> var $x; -private static function f() - </pre></div> +private static function f()</pre> + </div> <p class="good">// Right </p> <div class="codebox"><pre> public $x; -static private function f() - </pre></div> +static private function f()</pre> + </div> <h4>Constants</h4> <p>Prefer class constants over global constants created with <code>define()</code>.</p> @@ -748,8 +749,8 @@ $sql = 'SELECT * <-one tab->WHERE a = 1 <-two tabs->AND (b = 2 <-three tabs->OR b = 3) -<-one tab->ORDER BY b'; - </pre></div> +<-one tab->ORDER BY b';</pre> + </div> <p>Here the example with the tabs applied:</p> @@ -759,8 +760,8 @@ $sql = 'SELECT * WHERE a = 1 AND (b = 2 OR b = 3) - ORDER BY b'; - </pre></div> + ORDER BY b';</pre> + </div> <h4>SQL Quotes: </h4> <p>Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples: </p> @@ -769,16 +770,16 @@ $sql = 'SELECT * <div class="codebox"><pre> "UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b"; -'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something; - </pre></div> +'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;</pre> + </div> <p class="good">// These are right. </p> <div class="codebox"><pre> 'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b"; -'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something"; - </pre></div> +'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";</pre> + </div> <p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p> @@ -789,15 +790,15 @@ $sql = 'SELECT * <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . ' - WHERE a != 2'; - </pre></div> + WHERE a != 2';</pre> + </div> <p class="good">// This is right. </p> <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . ' - WHERE a <> 2'; - </pre></div> + WHERE a <> 2';</pre> + </div> <h4>Common DBAL methods: </h4> @@ -808,8 +809,8 @@ $sql = 'SELECT * <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . " - WHERE username = '" . $db->sql_escape($username) . "'"; - </pre></div> + WHERE username = '" . $db->sql_escape($username) . "'";</pre> + </div> <h4>sql_query_limit():</h4> @@ -830,8 +831,8 @@ $sql_ary = array( 'moredata' => $another_int, ); -$db->sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - </pre></div> +$db->sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));</pre> + </div> <p>To complete the example, this is how an update statement would look like:</p> @@ -845,8 +846,8 @@ $sql_ary = array( $sql = 'UPDATE ' . SOME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . (int) $user_id; -$db->sql_query($sql); - </pre></div> +$db->sql_query($sql);</pre> + </div> <p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p> @@ -869,8 +870,8 @@ $sql_ary[] = array( 'moredata' => $another_int_2, ); -$db->sql_multi_insert(SOME_TABLE, $sql_ary); - </pre></div> +$db->sql_multi_insert(SOME_TABLE, $sql_ary);</pre> + </div> <h4>sql_in_set():</h4> @@ -880,22 +881,22 @@ $db->sql_multi_insert(SOME_TABLE, $sql_ary); $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids); -$db->sql_query($sql); - </pre></div> +$db->sql_query($sql);</pre> + </div> <p>Based on the number of values in $forum_ids, the query can look differently.</p> <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> <div class="codebox"><pre> -SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3) - </pre></div> +SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)</pre> + </div> <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> <div class="codebox"><pre> -SELECT FROM phpbb_forums WHERE forum_id = 1 - </pre></div> +SELECT FROM phpbb_forums WHERE forum_id = 1</pre> + </div> <p>Of course the same is possible for doing a negative match against a number of values:</p> @@ -903,22 +904,22 @@ SELECT FROM phpbb_forums WHERE forum_id = 1 $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids, <strong>true</strong>); -$db->sql_query($sql); - </pre></div> +$db->sql_query($sql);</pre> + </div> <p>Based on the number of values in $forum_ids, the query can look differently here too.</p> <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> <div class="codebox"><pre> -SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3) - </pre></div> +SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)</pre> + </div> <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> <div class="codebox"><pre> -SELECT FROM phpbb_forums WHERE forum_id <strong><></strong> 1 - </pre></div> +SELECT FROM phpbb_forums WHERE forum_id <strong><></strong> 1</pre> + </div> <p>If the given array is empty, an error will be produced.</p> @@ -948,8 +949,8 @@ $sql_array = array( 'ORDER_BY' => 'left_id', ); -$sql = $db->sql_build_query('SELECT', $sql_array); - </pre></div> +$sql = $db->sql_build_query('SELECT', $sql_array);</pre> + </div> <p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p> @@ -984,8 +985,8 @@ else // Here we read the cookie data } -$sql = $db->sql_build_query('SELECT', $sql_array); - </pre></div> +$sql = $db->sql_build_query('SELECT', $sql_array);</pre> + </div> <a name="optimizing"></a><h3>2.iv. Optimizations</h3> @@ -997,16 +998,16 @@ $sql = $db->sql_build_query('SELECT', $sql_array); for ($i = 0; $i < sizeof($post_data); $i++) { do_something(); -} - </pre></div> +}</pre> + </div> <p class="good">// You are able to assign the (not changing) result within the loop itself</p> <div class="codebox"><pre> for ($i = 0, $size = sizeof($post_data); $i < $size; $i++) { do_something(); -} - </pre></div> +}</pre> + </div> <h4>Use of in_array(): </h4> <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p> @@ -1028,29 +1029,29 @@ for ($i = 0, $size = sizeof($post_data); $i < $size; $i++) <p class="bad">// Old method, do not use it</p> <div class="codebox"><pre> $start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : intval($HTTP_POST_VARS['start']); -$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false; - </pre></div> +$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;</pre> + </div> <p class="good">// Use request var and define a default variable (use the correct type)</p> <div class="codebox"><pre> $start = $request->variable('start', 0); -$submit = $request->is_set_post('submit'); - </pre></div> +$submit = $request->is_set_post('submit');</pre> + </div> <p class="bad">// $start is an int, the following use of $request->variable() therefore is not allowed</p> <div class="codebox"><pre> -$start = $request->variable('start', '0'); - </pre></div> +$start = $request->variable('start', '0');</pre> + </div> <p class="good">// Getting an array, keys are integers, value defaults to 0</p> <div class="codebox"><pre> -$mark_array = $request->variable('mark', array(0)); - </pre></div> +$mark_array = $request->variable('mark', array(0));</pre> + </div> <p class="good">// Getting an array, keys are strings, value defaults to 0</p> <div class="codebox"><pre> -$action_ary = $request->variable('action', array('' => 0)); - </pre></div> +$action_ary = $request->variable('action', array('' => 0));</pre> + </div> <h4>Login checks/redirection: </h4> <p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p> @@ -1073,8 +1074,8 @@ $action_ary = $request->variable('action', array('' => 0)); { trigger_error('FORM_INVALID'); } - } - </pre></div> + }</pre> + </div> <p>The string passed to <code>add_form_key()</code> needs to match the string passed to <code>check_form_key()</code>. Another requirement for this to work correctly is that all forms include the <code>{S_FORM_TOKEN}</code> template variable.</p> @@ -1085,8 +1086,8 @@ $action_ary = $request->variable('action', array('' => 0)); <div class="codebox"><pre> $user->session_begin(); $auth->acl($user->data); -$user->setup(); - </pre></div> +$user->setup();</pre> + </div> <p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p> @@ -1094,16 +1095,16 @@ $user->setup(); <p>All messages/errors should be outputted by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p> <div class="codebox"><pre> -trigger_error('NO_FORUM'); - </pre></div> +trigger_error('NO_FORUM');</pre> + </div> <div class="codebox"><pre> -trigger_error($user->lang['NO_FORUM']); - </pre></div> +trigger_error($user->lang['NO_FORUM']);</pre> + </div> <div class="codebox"><pre> -trigger_error('NO_MODE', E_USER_ERROR); - </pre></div> +trigger_error('NO_MODE', E_USER_ERROR);</pre> + </div> <h4>Url formatting</h4> @@ -1112,8 +1113,8 @@ trigger_error('NO_MODE', E_USER_ERROR); <p>The <code>append_sid()</code> function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p> <div class="codebox"><pre> -append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) - </pre></div> +append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id'])</pre> + </div> <h4>General function usage: </h4> @@ -1169,14 +1170,14 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> <a name="styling"></a><h2>3. Styling</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> <a name="cfgfiles"></a><h3>3.i. Style Config Files</h3> @@ -1193,8 +1194,8 @@ phpbb_version = 3.1.0 # Parent style # Set value to empty or to this style's name if this style does not have a parent style -parent = prosilver - </pre></div> +parent = prosilver</pre> + </div> <a name="genstyling"></a><h3>3.2. General Styling Rules</h3> <p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.</p> @@ -1252,14 +1253,14 @@ parent = prosilver <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> <a name="templating"></a><h2>4. Templating</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> <a name="templates"></a><h3>4.i. General Templating</h3> @@ -1748,7 +1749,7 @@ This may span multiple lines. <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -1758,7 +1759,7 @@ This may span multiple lines. <a name="charsets"></a><h2>5. Character Sets and Encodings</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -1821,7 +1822,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -1829,7 +1830,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <a name="translation"></a><h2>6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -2356,8 +2357,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) 'PAGE_OF' => 'Page %s of %s', /* Just grabbing the replacements as they come and hope they are in the right order */ - ... - </pre></div> + ...</pre> + </div> <p>… a clearer way to show explicit replacement ordering is to do:</p> @@ -2366,8 +2367,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) 'PAGE_OF' => 'Page %1$s of %2$s', /* Explicit ordering of the replacements, even if they are the same order as English */ - ... - </pre></div> + ...</pre> + </div> <p>Why bother at all? Because some languages, the string transliterated back to English might read something like:</p> @@ -2376,8 +2377,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) 'PAGE_OF' => 'Total of %2$s pages, currently on page %1$s', /* Explicit ordering of the replacements, reversed compared to English as the total comes first */ - ... - </pre></div> + ...</pre> + </div> <a name="usingplurals"></a><h3>6.iv. Using plurals</h3> @@ -2395,8 +2396,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... $user->lang('NUMBER_OF_ELEPHANTS', $number_of_elephants); - ... - </pre></div> + ...</pre> + </div> <p>And the English translation would be:</p> @@ -2407,8 +2408,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) 1 => 'You have 1 elephant', // Singular 2 => 'You have %d elephants', // Plural ), - ... - </pre></div> + ...</pre> + </div> <p>While the Bosnian translation can have more cases:</p> @@ -2420,16 +2421,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) 2 => 'You have %d slona', // Used for 5, 6, 3 => ... ), - ... - </pre></div> + ...</pre> + </div> <p><strong>NOTE:</strong> It is okay to use plurals for an unknown number compared to a single item, when the number is not known and displayed:</p> <div class="codebox"><pre> ... 'MODERATOR' => 'Moderator', // Your board has 1 moderator 'MODERATORS' => 'Moderators', // Your board has multiple moderators - ... - </pre></div> + ...</pre> + </div> <a name="writingstyle"></a><h3>6.v. Writing Style</h3> @@ -2443,8 +2444,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) ... 'CONV_ERROR_NO_AVATAR_PATH' => 'Note to developer: you must specify $convertor['avatar_path'] to use %s.', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Good - Literal straight quotes should be escaped with a backslash, ie: \</p> @@ -2452,8 +2453,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) ... 'CONV_ERROR_NO_AVATAR_PATH' => 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.', - ... - </pre></div> + ...</pre> + </div> <p>However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:</p> @@ -2462,24 +2463,24 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user's permissions', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Okay - However, non-programmers wouldn't type "user\'s" automatically</p> <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user\'s permissions', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Best - Use the Unicode Right-Single-Quotation-Mark character</p> <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user’s permissions', - ... - </pre></div> + ...</pre> + </div> <p>The <code>"</code> (straight double quote), <code><</code> (less-than sign) and <code>></code> (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:</p> @@ -2489,8 +2490,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) ... 'FOO_BAR' => 'PHP version < 5.3.3.<br /> Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Okay - No more invalid HTML, but "&quot;" is rather clumsy</p> @@ -2498,8 +2499,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) ... 'FOO_BAR' => 'PHP version &lt; 5.3.3.<br /> Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Best - No more invalid HTML, and usage of correct typographical quotation marks</p> @@ -2507,8 +2508,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) ... 'FOO_BAR' => 'PHP version &lt; 5.3.3.<br /> Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.', - ... - </pre></div> + ...</pre> + </div> <p>Lastly, the <code>&</code> (ampersand) must always be entitised regardless of where it is used:</p> @@ -2517,16 +2518,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="codebox"><pre> ... 'FOO_BAR' => '<a href="http://somedomain.tld/?foo=1&bar=2">Foo & Bar</a>.', - ... - </pre></div> + ...</pre> + </div> <p class="good">// Good - Valid HTML, amperands are correctly entitised in all cases</p> <div class="codebox"><pre> ... 'FOO_BAR' => '<a href="http://somedomain.tld/?foo=1&amp;bar=2">Foo &amp; Bar</a>.', - ... - </pre></div> + ...</pre> + </div> <p>As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see <a href="http://en.wikipedia.org/wiki/Unicode#Input_methods">http://en.wikipedia.org/wiki/Unicode#Input_methods</a> for more information.</p> @@ -2538,7 +2539,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <hr /> @@ -2546,7 +2547,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2> <div class="paragraph"> - <div class="inner"><span class="corners-top"><span></span></span> + <div class="inner"> <div class="content"> @@ -2556,7 +2557,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> - <span class="corners-bottom"><span></span></span></div> + </div> </div> <!-- END DOCUMENT --> diff --git a/phpBB/docs/corners_left.gif b/phpBB/docs/corners_left.gif Binary files differdeleted file mode 100644 index 206e50368d..0000000000 --- a/phpBB/docs/corners_left.gif +++ /dev/null diff --git a/phpBB/docs/corners_left.png b/phpBB/docs/corners_left.png Binary files differdeleted file mode 100644 index 256bde3daa..0000000000 --- a/phpBB/docs/corners_left.png +++ /dev/null diff --git a/phpBB/docs/corners_right.gif b/phpBB/docs/corners_right.gif Binary files differdeleted file mode 100644 index 0ba66d50b2..0000000000 --- a/phpBB/docs/corners_right.gif +++ /dev/null diff --git a/phpBB/docs/corners_right.png b/phpBB/docs/corners_right.png Binary files differdeleted file mode 100644 index df41823b4c..0000000000 --- a/phpBB/docs/corners_right.png +++ /dev/null diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 8086bc9f43..8a006fce81 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -177,6 +177,27 @@ acp_ranks_list_header_before * Purpose: Add content after the last header-column (but before the action column) in the ranks list in the ACP +acp_users_profile_before +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the profile details when editing a user in the ACP + +acp_users_profile_after +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the profile details but before the custom profile fields when editing a user in the ACP + +acp_users_profile_custom_after +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the the custom profile fields when editing a user in the ACP + acp_simple_footer_after === * Location: adm/style/simple_footer.html @@ -272,6 +293,20 @@ forumlist_body_category_header_before * Since: 3.1.0-a4 * Purpose: Add content before the header of the category on the forum list. +forumlist_body_category_header_row_append +=== +* Locations: + + styles/prosilver/template/forumlist_body.html +* Since: 3.1.5-RC1 +* Purpose: Add content after the header row of the category on the forum list. + +forumlist_body_category_header_row_prepend +=== +* Locations: + + styles/prosilver/template/forumlist_body.html +* Since: 3.1.5-RC1 +* Purpose: Add content before the header row of the category on the forum list. + forumlist_body_forum_row_after === * Locations: @@ -819,6 +854,14 @@ overall_header_head_append * Since: 3.1.0-a1 * Purpose: Add asset calls directly before the `</head>` tag +overall_header_navbar_before +=== +* Locations: + + styles/prosilver/template/overall_header.html + + styles/subsilver2/template/overall_header.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the navigation bar + overall_header_navigation_append === * Locations: @@ -859,6 +902,13 @@ overall_header_page_body_before * Since: 3.1.0-b3 * Purpose: Add content after the page-header, but before the page-body +overall_header_searchbox_before +=== +* Locations: + + styles/prosilver/template/overall_header.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the search box in the header + overall_header_stylesheets_after === * Locations: @@ -868,6 +918,14 @@ overall_header_stylesheets_after * Purpose: Add asset calls after stylesheets within the `</head>` tag. Note that INCLUDECSS will not work with this event. +posting_editor_bbcode_status_after +=== +* Locations: + + styles/prosilver/template/posting_editor.html + + styles/subsilver2/template/posting_body.html +* Since: 3.1.4-RC1 +* Purpose: Add content after bbcode status + posting_editor_buttons_after === * Locations: @@ -916,6 +974,22 @@ posting_editor_options_prepend * Since: 3.1.0-a1 * Purpose: Add posting options on the posting screen +posting_editor_smilies_after +=== +* Locations: + + styles/prosilver/template/posting_editor.html + + styles/subsilver2/template/posting_body.html +* Since: 3.1.4-RC1 +* Purpose: Add content after smilies + +posting_editor_smilies_before +=== +* Locations: + + styles/prosilver/template/posting_editor.html + + styles/subsilver2/template/posting_body.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the smilies + posting_editor_subject_after === * Locations: @@ -948,6 +1022,28 @@ posting_pm_header_find_username_before * Since: 3.1.0-RC4 * Purpose: Add content before the find username link on composing pm +posting_pm_layout_include_pm_header_after +=== +* Locations: + + styles/prosilver/template/posting_pm_layout.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the include of posting_pm_header.html + +posting_pm_layout_include_pm_header_before +=== +* Locations: + + styles/prosilver/template/posting_pm_layout.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the include of posting_pm_header.html + +posting_poll_body_options_after +=== +* Locations: + + styles/prosilver/template/posting_poll_body.html + + styles/subsilver2/template/posting_poll_body.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the poll options on creating a poll + quickreply_editor_panel_after === * Locations: @@ -980,6 +1076,22 @@ quickreply_editor_message_before * Since: 3.1.0-a4 * Purpose: Add content before the quick reply textbox +search_results_header_after +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/subsilver2/template/search_results.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the header of the search results + +search_results_header_before +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/subsilver2/template/search_results.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the header of the search results. + search_results_post_after === * Locations: @@ -1010,6 +1122,14 @@ search_results_postprofile_before * Since: 3.1.0-b3 * Purpose: Add content directly before the post author in search results (posts view mode) +search_results_searchbox_after +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/subsilver2/template/search_results.html +* Since: 3.1.4-RC1 +* Purpose: Add content right after the searchbox of the search results. + search_results_topic_after === * Locations: @@ -1235,6 +1355,38 @@ ucp_prefs_view_select_menu_append * Purpose: Add options to the bottom of the drop-down lists block of the Edit Display Options screen +ucp_profile_profile_info_before +=== +* Locations: + + styles/prosilver/template/ucp_profile_profile_info.html + + styles/subsilver2/template/ucp_profile_profile_info.html +* Since: 3.1.4-RC1 +* Purpose: Add options in profile page fieldset - before jabber field. + +ucp_profile_profile_info_after +=== +* Locations: + + styles/prosilver/template/ucp_profile_profile_info.html + + styles/subsilver2/template/ucp_profile_profile_info.html +* Since: 3.1.4-RC1 +* Purpose: Add options in profile page fieldset - after custom profile fields. + +ucp_profile_register_details_before +=== +* Locations: + + styles/prosilver/template/ucp_profile_reg_details.html + + styles/subsilver2/template/ucp_profile_reg_details.html +* Since: 3.1.4-RC1 +* Purpose: Add options in profile page fieldset - before first field. + +ucp_profile_register_details_after +=== +* Locations: + + styles/prosilver/template/ucp_profile_reg_details.html + + styles/subsilver2/template/ucp_profile_reg_details.html +* Since: 3.1.4-RC1 +* Purpose: Add options in profile page fieldset - after confirm password field. + ucp_register_credentials_before === * Locations: @@ -1371,6 +1523,22 @@ viewforum_forum_name_prepend * Since: 3.1.0-b3 * Purpose: Add content directly before the forum name link on the View forum screen +viewforum_forum_title_after +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.5-RC1 +* Purpose: Add content directly after the forum title on the View forum screen + +viewforum_forum_title_before +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.5-RC1 +* Purpose: Add content directly before the forum title on the View forum screen + viewtopic_print_head_append === * Locations: @@ -1379,6 +1547,14 @@ viewtopic_print_head_append * Since: 3.1.0-a1 * Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen +viewtopic_body_pagination_top_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the pagination at top + viewtopic_body_avatar_after === * Locations: @@ -1489,6 +1665,22 @@ viewtopic_body_post_buttons_before * Purpose: Add post button to posts (next to edit, quote etc), at the start of the list. +viewtopic_body_post_buttons_list_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html +* Since: 3.1.5-RC1 +* Purpose: Add post button custom list to posts (next to edit, quote etc), +after the original list. + +viewtopic_body_post_buttons_list_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html +* Since: 3.1.5-RC1 +* Purpose: Add post button custom list to posts (next to edit, quote etc), +before the original list. + viewtopic_body_postrow_custom_fields_after === * Locations: diff --git a/phpBB/docs/site_logo.gif b/phpBB/docs/site_logo.gif Binary files differdeleted file mode 100644 index 909114c377..0000000000 --- a/phpBB/docs/site_logo.gif +++ /dev/null diff --git a/phpBB/faq.php b/phpBB/faq.php index 0b4aa33073..5fe155eab0 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -35,8 +35,30 @@ switch ($mode) break; default: - $l_title = $user->lang['FAQ_EXPLAIN']; - $user->add_lang('faq', false, true); + $page_title = $user->lang['FAQ_EXPLAIN']; + $ext_name = $lang_file = ''; + + /** + * You can use this event display a custom help page + * + * @event core.faq_mode_validation + * @var string page_title Title of the page + * @var string mode FAQ that is going to be displayed + * @var string lang_file Language file containing the help data + * @var string ext_name Vendor and extension name where the help + * language file can be loaded from + * @since 3.1.4-RC1 + */ + $vars = array( + 'page_title', + 'mode', + 'lang_file', + 'ext_name', + ); + extract($phpbb_dispatcher->trigger_event('core.faq_mode_validation', compact($vars))); + + $l_title = $page_title; + $user->add_lang(($lang_file) ? $lang_file : 'faq', false, true, $ext_name); break; } diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 2873b48fa4..67fba1094d 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -153,7 +153,7 @@ class acp_attachments 'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), - 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'path', 'type' => 'text:20:200', 'explain' => true, 'append' => ' <span>[ <a href="' . $this->u_action . '&action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'), + 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'absolute_path', 'type' => 'text:20:200', 'explain' => true, 'append' => ' <span>[ <a href="' . $this->u_action . '&action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'), 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), ) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 63e2647f02..a41a53226f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -514,7 +514,8 @@ class acp_board if ($config_name == 'guest_style') { - if (isset($cfg_array[$config_name])) { + if (isset($cfg_array[$config_name])) + { $this->guest_style_set($cfg_array[$config_name]); } continue; diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 0c52f82459..c5aebf011d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1173,6 +1173,7 @@ class postgres_extractor extends base_extractor $this->flush($sql_data . ";\n"); } } + $db->sql_freeresult($result); $sql_data = '-- Table: ' . $table_name . "\n"; $sql_data .= "DROP TABLE $table_name;\n"; diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 89fdc8b863..0c9bc0deab 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -174,11 +174,6 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($phpbb_extension_manager->is_enabled($ext_name)) - { - redirect($this->u_action); - } - try { while ($phpbb_extension_manager->enable_step($ext_name)) diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 59f15c4890..6eb213fd7a 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -507,7 +507,7 @@ class acp_prune AND ug.user_id <> ' . ANONYMOUS . ' AND u.user_type <> ' . USER_FOUNDER . ' AND ug.user_pending = 0 ' . - ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' + ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' AND u.user_id = ug.user_id'; $result = $db->sql_query($sql); @@ -533,7 +533,7 @@ class acp_prune FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE u.user_id <> ' . ANONYMOUS . ' AND u.user_type <> ' . USER_FOUNDER . - ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' + ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' AND u.user_id = p.poster_id GROUP BY p.poster_id diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index eddc6871f8..9ff999567a 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -449,7 +449,6 @@ class acp_search $search = null; $error = false; - $search_options = ''; foreach ($search_types as $type) { if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created')) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3c957a7093..8c17fb6311 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1414,6 +1414,18 @@ class acp_users $error[] = 'FORM_INVALID'; } + /** + * Validate profile data in ACP before submitting to the database + * + * @event core.acp_users_profile_validate + * @var bool submit Flag indicating if submit button has been pressed + * @var array data Array with user profile data + * @var array error Array with the form errors + * @since 3.1.4-RC1 + */ + $vars = array('submit', 'data', 'error'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars))); + if (!sizeof($error)) { $sql_ary = array( @@ -1429,9 +1441,10 @@ class acp_users * @var array data Array with user profile data * @var int user_id The user id * @var array user_row Array with the full user data + * @var array sql_ary Array with sql data * @since 3.1.4-RC1 */ - $vars = array('cp_data', 'data', 'user_id', 'user_row'); + $vars = array('cp_data', 'data', 'user_id', 'user_row', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_modify_sql_ary', compact($vars))); $sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 321a87b4b0..c53d976615 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.4-dev'); +define('PHPBB_VERSION', '3.1.5-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 940484a0ea..d460497669 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2309,7 +2309,7 @@ function redirect($url, $return = false, $disable_cd_check = false) // Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work) if (!$disable_cd_check && $url_parts['host'] !== $user->host) { - $url = generate_board_url(); + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } } else if ($url[0] == '/') @@ -2347,7 +2347,7 @@ function redirect($url, $return = false, $disable_cd_check = false) // Clean URL and check if we go outside the forum directory $url = $phpbb_path_helper->clean_url($url); - if (!$disable_cd_check && strpos($url, generate_board_url(true)) === false) + if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0) { trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } @@ -2389,7 +2389,7 @@ function redirect($url, $return = false, $disable_cd_check = false) } // Redirect via an HTML form for PITA webservers - if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE'))) + if (@preg_match('#WebSTAR|Xitami#', getenv('SERVER_SOFTWARE'))) { header('Refresh: 0; URL=' . $url); @@ -2544,13 +2544,19 @@ function phpbb_request_http_version() { global $request; + $version = ''; if ($request && $request->server('SERVER_PROTOCOL')) { - return $request->server('SERVER_PROTOCOL'); + $version = $request->server('SERVER_PROTOCOL'); } else if (isset($_SERVER['SERVER_PROTOCOL'])) { - return $_SERVER['SERVER_PROTOCOL']; + $version = $_SERVER['SERVER_PROTOCOL']; + } + + if (!empty($version) && is_string($version) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $version)) + { + return $version; } return 'HTTP/1.0'; @@ -2920,19 +2926,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // Special cases... determine switch ($result['status']) { - case LOGIN_ERROR_ATTEMPTS: - - $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); - $captcha->init(CONFIRM_LOGIN); - // $captcha->reset(); - - $template->assign_vars(array( - 'CAPTCHA_TEMPLATE' => $captcha->get_template(), - )); - - $err = $user->lang[$result['error_msg']]; - break; - case LOGIN_ERROR_PASSWORD_CONVERT: $err = sprintf( $user->lang[$result['error_msg']], @@ -2943,6 +2936,17 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa ); break; + case LOGIN_ERROR_ATTEMPTS: + + $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); + $captcha->init(CONFIRM_LOGIN); + // $captcha->reset(); + + $template->assign_vars(array( + 'CAPTCHA_TEMPLATE' => $captcha->get_template(), + )); + // no break; + // Username, password, etc... default: $err = $user->lang[$result['error_msg']]; @@ -3347,7 +3351,7 @@ function get_preg_expression($mode) case 'email': // Regex written by James Watts and Francisco Jose Martin Moreno // http://fightingforalostcause.net/misc/2006/compare-email-regex.php - return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)'; + return '((?:[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+)@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)'; break; case 'bbcode_htm': @@ -4247,9 +4251,10 @@ function obtain_users_online($item_id = 0, $item = 'forum') */ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum') { - global $config, $db, $user, $auth; + global $config, $db, $user, $auth, $phpbb_dispatcher; - $user_online_link = $online_userlist = ''; + $guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = ''; + $user_online_link = $rowset = array(); // Need caps version of $item for language-strings $item_caps = strtoupper($item); @@ -4259,9 +4264,28 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . ' ORDER BY username_clean ASC'; + + /** + * Modify SQL query to obtain online users data + * + * @event core.obtain_users_online_string_sql + * @var array online_users Array with online users data + * from obtain_users_online() + * @var int item_id Restrict online users to item id + * @var string item Restrict online users to a certain + * session item, e.g. forum for + * session_forum_id + * @var string sql SQL query to obtain users online data + * @since 3.1.4-RC1 + */ + $vars = array('online_users', 'item_id', 'item', 'sql'); + extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_sql', compact($vars))); + $result = $db->sql_query($sql); + $rowset = $db->sql_fetchrowset($result); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + foreach ($rowset as $row) { // User is logged in and therefore not a guest if ($row['user_id'] != ANONYMOUS) @@ -4273,13 +4297,12 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) { - $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']); - $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; + $user_online_link[$row['user_id']] = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']); } } } - $db->sql_freeresult($result); } + $online_userlist = implode(', ', $user_online_link); if (!$online_userlist) { @@ -4312,6 +4335,33 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' $l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online); } + /** + * Modify online userlist data + * + * @event core.obtain_users_online_string_modify + * @var array online_users Array with online users data + * from obtain_users_online() + * @var int item_id Restrict online users to item id + * @var string item Restrict online users to a certain + * session item, e.g. forum for + * session_forum_id + * @var array rowset Array with online users data + * @var array user_online_link Array with online users items (usernames) + * @var string online_userlist String containing users online list + * @var string l_online_users String with total online users count info + * @since 3.1.4-RC1 + */ + $vars = array( + 'online_users', + 'item_id', + 'item', + 'rowset', + 'user_online_link', + 'online_userlist', + 'l_online_users', + ); + extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_modify', compact($vars))); + return array( 'online_userlist' => $online_userlist, 'l_online_users' => $l_online_users, diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index e30c6da505..a53a54368e 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -550,6 +550,9 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) $cfg_array[$config_name] = trim($destination); + // Absolute file path + case 'absolute_path': + case 'absolute_path_writable': // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir... case 'path': case 'wpath': @@ -568,20 +571,22 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) break; } - if (!file_exists($phpbb_root_path . $cfg_array[$config_name])) + $path = in_array($config_definition['validate'], array('wpath', 'path', 'rpath', 'rwpath')) ? $phpbb_root_path . $cfg_array[$config_name] : $cfg_array[$config_name]; + + if (!file_exists($path)) { $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]); } - if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name])) + if (file_exists($path) && !is_dir($path)) { $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]); } // Check if the path is writable - if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath') + if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable') { - if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !phpbb_is_writable($phpbb_root_path . $cfg_array[$config_name])) + if (file_exists($path) && !phpbb_is_writable($path)) { $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]); } diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index b016659541..79f9db2f3f 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -618,7 +618,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) */ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true) { - global $db, $config, $phpbb_container; + global $db, $config, $phpbb_container, $phpbb_dispatcher; $approved_topics = 0; $forum_ids = $topic_ids = array(); @@ -672,6 +672,20 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s $table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE); + /** + * Perform additional actions before topic(s) deletion + * + * @event core.delete_topics_before_query + * @var array table_ary Array of tables from which all rows will be deleted that hold a topic_id occuring in topic_ids + * @var array topic_ids Array of topic ids to delete + * @since 3.1.4-RC1 + */ + $vars = array( + 'table_ary', + 'topic_ids', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_topics_before_query', compact($vars))); + foreach ($table_ary as $table) { $sql = "DELETE FROM $table @@ -680,6 +694,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s } unset($table_ary); + /** + * Perform additional actions after topic(s) deletion + * + * @event core.delete_topics_after_query + * @var array topic_ids Array of topic ids that were deleted + * @since 3.1.4-RC1 + */ + $vars = array( + 'topic_ids', + ); + extract($phpbb_dispatcher->trigger_event('core.delete_topics_after_query', compact($vars))); + $moved_topic_ids = array(); // update the other forums diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 31cf43e599..5888a6160d 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -375,6 +375,28 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod get_moderators($forum_moderators, $forum_ids_moderator); } + /** + * Event to perform additional actions before the forum list is being generated + * + * @event core.display_forums_before + * @var array active_forum_ary Array with forum data to display active topics + * @var bool display_moderators Flag indicating if we display forum moderators + * @var array forum_moderators Array with forum moderators list + * @var array forum_rows Data array of all forums we display + * @var bool return_moderators Flag indicating if moderators list should be returned + * @var array root_data Array with the root forum data + * @since 3.1.4-RC1 + */ + $vars = array( + 'active_forum_ary', + 'display_moderators', + 'forum_moderators', + 'forum_rows', + 'return_moderators', + 'root_data', + ); + extract($phpbb_dispatcher->trigger_event('core.display_forums_before', compact($vars))); + // Used to tell whatever we have to create a dummy category or not. $last_catless = true; foreach ($forum_rows as $row) @@ -710,13 +732,15 @@ function generate_forum_rules(&$forum_data) function generate_forum_nav(&$forum_data) { global $db, $user, $template, $auth, $config; - global $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path, $phpbb_dispatcher; if (!$auth->acl_get('f_list', $forum_data['forum_id'])) { return; } + $navlinks = $navlinks_parents = $forum_template_data = array(); + // Get forum parents $forum_parents = get_forum_parents($forum_data); @@ -735,35 +759,59 @@ function generate_forum_nav(&$forum_data) continue; } - $template->assign_block_vars('navlinks', array( + $navlinks_parents[] = array( 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, 'FORUM_NAME' => $parent_name, 'FORUM_ID' => $parent_forum_id, 'MICRODATA' => $microdata_attr . '="' . $parent_forum_id . '"', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id)) + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id), ); } } - $template->assign_block_vars('navlinks', array( + $navlinks = array( 'S_IS_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, 'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, 'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_ID' => $forum_data['forum_id'], 'MICRODATA' => $microdata_attr . '="' . $forum_data['forum_id'] . '"', - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id'])) + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']), ); - $template->assign_vars(array( + $forum_template_data = array( 'FORUM_ID' => $forum_data['forum_id'], 'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']), 'S_ENABLE_FEEDS_FORUM' => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false, - )); + ); + + /** + * Event to modify the navlinks text + * + * @event core.generate_forum_nav + * @var array forum_data Array with the forum data + * @var array forum_template_data Array with generic forum template data + * @var string microdata_attr The microdata attribute + * @var array navlinks_parents Array with the forum parents navlinks data + * @var array navlinks Array with the forum navlinks data + * @since 3.1.5-RC1 + */ + $vars = array( + 'forum_data', + 'forum_template_data', + 'microdata_attr', + 'navlinks_parents', + 'navlinks', + ); + extract($phpbb_dispatcher->trigger_event('core.generate_forum_nav', compact($vars))); + + $template->assign_block_vars_array('navlinks', $navlinks_parents); + $template->assign_block_vars('navlinks', $navlinks); + $template->assign_vars($forum_template_data); return; } diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index 811d49f1de..ed96dcf338 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -368,7 +368,7 @@ function phpbb_get_pm_data($pm_ids) */ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE') { - global $db, $user, $auth, $template; + global $db, $user, $auth, $template, $phpbb_dispatcher; $sort_days = request_var('st', 0); $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0; @@ -553,6 +553,56 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by break; } + // Default total to -1 to allow editing by the event + $total = -1; + + /** + * This event allows you to control the SQL query used to get the total number + * of reports the user can access. + * + * This total is used for the pagination and for displaying the total number + * of reports to the user + * + * + * @event core.mcp_sorting_query_before + * @var string sql The current SQL search string + * @var string mode An id related to the module(s) the user is viewing + * @var string type Which kind of information is this being used for displaying. Posts, topics, etc... + * @var int forum_id The forum id of the posts the user is trying to access, if not 0 + * @var int topic_id The topic id of the posts the user is trying to access, if not 0 + * @var int sort_days The max age of the oldest report to be shown, in days + * @var string sort_key The way the user has decided to sort the data. + * The valid values must be in the keys of the sort_by_* variables + * @var string sort_dir Either 'd' for "DESC" or 'a' for 'ASC' in the SQL query + * @var int limit_days The possible max ages of the oldest report for the user to choose, in days. + * @var array sort_by_sql SQL text (values) for the possible names of the ways of sorting data (keys). + * @var array sort_by_text Language text (values) for the possible names of the ways of sorting data (keys). + * @var int min_time Integer with the minimum post time that the user is searching for + * @var int limit_time_sql Time limiting options used in the SQL query. + * @var int total The total number of reports that exist. Only set if you want to override the result + * @var string where_sql Extra information included in the WHERE clause. It must end with "WHERE" or "AND" or "OR". + * Set to "WHERE" and set total above -1 to override the total value + * @since 3.1.4-RC1 + */ + $vars = array( + 'sql', + 'mode', + 'type', + 'forum_id', + 'topic_id', + 'sort_days', + 'sort_key', + 'sort_dir', + 'limit_days', + 'sort_by_sql', + 'sort_by_text', + 'min_time', + 'limit_time_sql', + 'total', + 'where_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_sorting_query_before', compact($vars))); + if (!isset($sort_by_sql[$sort_key])) { $sort_key = $default_key; @@ -584,7 +634,7 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by $total = (int) $db->sql_fetchfield('total'); $db->sql_freeresult($result); } - else + else if ($total < -1) { $total = -1; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f3c49badfe..a06d6f4c35 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1036,7 +1036,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms */ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { - global $user, $auth, $db, $template, $bbcode, $cache; + global $user, $auth, $db, $template, $cache; global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; $phpbb_content_visibility = $phpbb_container->get('content.visibility'); @@ -1094,13 +1094,11 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); - $bbcode_bitfield = ''; $rowset = array(); $has_attachments = false; while ($row = $db->sql_fetchrow($result)) { $rowset[$row['post_id']] = $row; - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); if ($row['post_attachment']) { @@ -1109,13 +1107,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id } $db->sql_freeresult($result); - // Instantiate BBCode class - if (!isset($bbcode) && $bbcode_bitfield !== '') - { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode(base64_encode($bbcode_bitfield)); - } - // Grab extensions $extensions = $attachments = array(); if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index e693305246..8e1561b842 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1957,7 +1957,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) */ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false) { - global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode; + global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth; // Select all receipts and the author from the pm we currently view, to only display their pm-history $sql = 'SELECT author_id, user_id @@ -2009,7 +2009,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode $title = $row['message_subject']; $rowset = array(); - $bbcode_bitfield = ''; $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder='; do @@ -2025,7 +2024,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode else { $rowset[$row['msg_id']] = $row; - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); } } while ($row = $db->sql_fetchrow($result)); @@ -2036,16 +2034,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode return false; } - // Instantiate BBCode class - if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '') - { - if (!class_exists('bbcode')) - { - include($phpbb_root_path . 'includes/bbcode.' . $phpEx); - } - $bbcode = new bbcode(base64_encode($bbcode_bitfield)); - } - $title = censor_text($title); $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index f179b2fd70..89bc31fa25 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -213,6 +213,8 @@ class filespec */ static public function get_extension($filename) { + $filename = utf8_basename($filename); + if (strpos($filename, '.') === false) { return ''; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index acf5649ed5..9cd662027e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -398,7 +398,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null) */ function user_delete($mode, $user_ids, $retain_username = true) { - global $cache, $config, $db, $user, $phpbb_dispatcher; + global $cache, $config, $db, $user, $phpbb_dispatcher, $phpbb_container; global $phpbb_root_path, $phpEx; $db->sql_transaction('begin'); @@ -672,6 +672,9 @@ function user_delete($mode, $user_ids, $retain_username = true) } phpbb_delete_users_pms($user_ids); + $phpbb_notifications = $phpbb_container->get('notification_manager'); + $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_ids); + $db->sql_transaction('commit'); /** diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 500db55456..629b6fd275 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -41,10 +41,27 @@ function mcp_front_view($id, $mode, $action) if (!empty($forum_list)) { - $sql = 'SELECT COUNT(post_id) AS total - FROM ' . POSTS_TABLE . ' - WHERE ' . $db->sql_in_set('forum_id', $forum_list) . ' - AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)); + $sql_ary = array( + 'SELECT' => 'COUNT(post_id) AS total', + 'FROM' => array( + POSTS_TABLE => 'p', + ), + 'WHERE' => $db->sql_in_set('p.forum_id', $forum_list) . ' + AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) + ); + + /** + * 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 + * @since 3.1.5-RC1 + */ + $vars = array('sql_ary', 'forum_list'); + extract($phpbb_dispatcher->trigger_event('core.mcp_front_queue_unapproved_total_before', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql); $total = (int) $db->sql_fetchfield('total'); $db->sql_freeresult($result); @@ -157,6 +174,18 @@ function mcp_front_view($id, $mode, $action) AND r.pm_id = 0 AND r.report_closed = 0 AND ' . $db->sql_in_set('p.forum_id', $forum_list); + + /** + * 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 array forum_list List of forums that contain the posts + * @since 3.1.5-RC1 + */ + $vars = array('sql', 'forum_list'); + extract($phpbb_dispatcher->trigger_event('core.mcp_front_reports_count_query_before', compact($vars))); + $result = $db->sql_query($sql); $total = (int) $db->sql_fetchfield('total'); $db->sql_freeresult($result); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 1241b8bd0e..10f1a5b8c1 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -226,6 +226,31 @@ class mcp_main break; default: + if ($quickmod) + { + switch ($action) + { + case 'lock': + case 'unlock': + case 'make_announce': + case 'make_sticky': + case 'make_global': + case 'make_normal': + case 'make_onindex': + case 'move': + case 'fork': + case 'delete_topic': + trigger_error('TOPIC_NOT_EXIST'); + break; + + case 'lock_post': + case 'unlock_post': + case 'delete_post': + trigger_error('POST_NOT_EXIST'); + break; + } + } + trigger_error('NO_MODE', E_USER_ERROR); break; } diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 804d48ea97..ccb54092b4 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -489,6 +489,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) { $post_id_list[] = $row[$id_column]; } + $db->sql_freeresult($result); $post_id_list = array_unique($post_id_list); if ($pm) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 3a456169d5..8347830d0f 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -147,21 +147,13 @@ function mcp_topic_view($id, $mode, $action) $result = $db->sql_query_limit($sql, $posts_per_page, $start); $rowset = $post_id_list = array(); - $bbcode_bitfield = ''; while ($row = $db->sql_fetchrow($result)) { $rowset[] = $row; $post_id_list[] = $row['post_id']; - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); } $db->sql_freeresult($result); - if ($bbcode_bitfield !== '') - { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode(base64_encode($bbcode_bitfield)); - } - $topic_tracking_info = array(); // Get topic tracking info @@ -267,6 +259,8 @@ function mcp_topic_view($id, $mode, $action) * @var int current_row_number Number of the post on this page * @var array post_row Template block array of the current post * @var array row Array with original post and user data + * @var array topic_info Array with topic data + * @var int total Total posts count * @since 3.1.4-RC1 */ $vars = array( @@ -278,6 +272,8 @@ function mcp_topic_view($id, $mode, $action) 'current_row_number', 'post_row', 'row', + 'topic_info', + 'total', ); extract($phpbb_dispatcher->trigger_event('core.mcp_topic_review_modify_row', compact($vars))); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 04a2726d22..63e027cd66 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -21,6 +21,19 @@ if (!defined('IN_PHPBB')) if (!class_exists('bbcode')) { + // The following lines are for extensions which include message_parser.php + // while $phpbb_root_path and $phpEx are out of the script scope + // which may lead to the 'Undefined variable' and 'failed to open stream' errors + if (!isset($phpbb_root_path)) + { + global $phpbb_root_path; + } + + if (!isset($phpEx)) + { + global $phpEx; + } + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f3b59186a6..51018e3a5d 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -90,6 +90,32 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // we include the language file here $user->add_lang('viewtopic'); + /** + * Modify the default vars before composing a PM + * + * @event core.ucp_pm_compose_modify_data + * @var int msg_id post_id in the page request + * @var int to_user_id The id of whom the message is to + * @var int to_group_id The id of the group the message is to + * @var bool submit Whether the form has been submitted + * @var bool preview Whether the user is previewing the PM or not + * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies + * @var bool delete Whether the user is deleting the PM + * @var int reply_to_all Value of reply_to_all request variable. + * @since 3.1.4-RC1 + */ + $vars = array( + 'msg_id', + 'to_user_id', + 'to_group_id', + 'submit', + 'preview', + 'action', + 'delete', + 'reply_to_all', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_data', compact($vars))); + // Output PM_TO box if message composing if ($action != 'edit') { diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 888c2e6825..d81c4ce7fe 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -53,15 +53,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Grab icons $icons = $cache->obtain_icons(); - $bbcode = false; - - // Instantiate BBCode if need be - if ($message_row['bbcode_bitfield']) - { - include($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode($message_row['bbcode_bitfield']); - } - // Load the custom profile fields if ($config['load_cpf_pm']) { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 1d3fb19f67..3c274b53c7 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -69,7 +69,7 @@ class ucp_prefs * @var array data Array with current ucp options data * @var array error Array with list of errors * @since 3.1.0-a1 - * @changed 3.1.4-rc1 Added error variable to the event + * @changed 3.1.4-RC1 Added error variable to the event */ $vars = array('submit', 'data', 'error'); extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars))); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index c1cdcf88ca..8d8d42e742 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -114,6 +114,18 @@ class ucp_profile $error[] = 'FORM_INVALID'; } + /** + * Validate user data on editing registration data in UCP + * + * @event core.ucp_profile_reg_details_validate + * @var array data Array with user profile data + * @var bool submit Flag indicating if submit button has been pressed + * @var array error Array of any generated errors + * @since 3.1.4-RC1 + */ + $vars = array('data', 'submit', 'error'); + extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_validate', compact($vars))); + if (!sizeof($error)) { $sql_ary = array( @@ -353,6 +365,18 @@ class ucp_profile $error[] = 'FORM_INVALID'; } + /** + * Validate user data on editing profile in UCP + * + * @event core.ucp_profile_validate_profile_info + * @var array data Array with user profile data + * @var bool submit Flag indicating if submit button has been pressed + * @var array error Array of any generated errors + * @since 3.1.4-RC1 + */ + $vars = array('data', 'submit', 'error'); + extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars))); + if (!sizeof($error)) { $data['notify'] = $user->data['user_notify_type']; @@ -380,9 +404,10 @@ class ucp_profile * @event core.ucp_profile_info_modify_sql_ary * @var array cp_data Array with the user custom profile fields data * @var array data Array with user profile data + * @var array sql_ary user options data we update * @since 3.1.4-RC1 */ - $vars = array('cp_data', 'data'); + $vars = array('cp_data', 'data', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars))); $sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 14f6a8bc02..0ee45b0706 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -30,7 +30,7 @@ class ucp_register function main($id, $mode) { global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; - global $request, $phpbb_container; + global $request, $phpbb_container, $phpbb_dispatcher; // if ($config['require_activation'] == USER_ACTIVATION_DISABLE || @@ -197,6 +197,19 @@ class ucp_register 'lang' => basename(request_var('lang', $user->lang_name)), 'tz' => request_var('tz', $timezone), ); + /** + * Add UCP register data before they are assigned to the template or submitted + * + * To assign data to the template, use $template->assign_vars() + * + * @event core.ucp_register_data_before + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp registration data + * @since 3.1.4-RC1 + */ + $vars = array('submit', 'data'); + extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_before', compact($vars))); // Check and initialize some variables if needed if ($submit) @@ -257,6 +270,19 @@ class ucp_register $error[] = $user->lang['NEW_PASSWORD_ERROR']; } } + /** + * Check UCP registration data after they are submitted + * + * @event core.ucp_register_data_after + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp registration data + * @var array cp_data Array with custom profile fields data + * @var array error Array with list of errors + * @since 3.1.4-RC1 + */ + $vars = array('submit', 'data', 'cp_data', 'error'); + extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars))); if (!sizeof($error)) { @@ -319,6 +345,20 @@ class ucp_register { $user_row['user_new'] = 1; } + /** + * Add into $user_row before user_add + * + * user_add allows adding more data into the users table + * + * @event core.ucp_register_user_row_after + * @var bool submit Do we display the form only + * or did the user press submit + * @var array cp_data Array with custom profile fields data + * @var array user_row Array with current ucp registration data + * @since 3.1.4-RC1 + */ + $vars = array('submit', 'cp_data', 'user_row'); + extract($phpbb_dispatcher->trigger_event('core.ucp_register_user_row_after', compact($vars))); // Register user... $user_id = user_add($user_row, $cp_data); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 511f850679..990b3136fd 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.3', + 'phpbb_version' => '3.1.4', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 3a6858a254..6f7fbd9d5f 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1164,12 +1164,10 @@ class install_install extends module foreach ($sql_query as $sql) { - //$sql = trim(str_replace('|', ';', $sql)); - if (!$db->sql_query($sql)) - { - $error = $db->sql_error(); - $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); - } + // Ignore errors when the functions or types already exist + // to allow installing phpBB twice in the same database with + // a different prefix + $db->sql_query($sql); } unset($sql_query); } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index a39bb365d6..b740977468 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.4-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.5-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/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 28cdc8829d..bacb33c70a 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -75,7 +75,7 @@ $lang = array_merge($lang, array( <li>Upload the new files</li> <li>Enable the extension</li> </ol>', - 'EXTENSION_REMOVE_HEADLINE' => 'Completly removing an extension from your board', + 'EXTENSION_REMOVE_HEADLINE' => 'Completely removing an extension from your board', 'EXTENSION_REMOVE_EXPLAIN' => '<ol> <li>Disable the extension</li> <li>Delete the extension’s data</li> diff --git a/phpBB/language/en/captcha_recaptcha.php b/phpBB/language/en/captcha_recaptcha.php index 18438ab53e..df2ad4e51b 100644 --- a/phpBB/language/en/captcha_recaptcha.php +++ b/phpBB/language/en/captcha_recaptcha.php @@ -47,6 +47,6 @@ $lang = array_merge($lang, array( 'RECAPTCHA_PRIVATE' => 'Private reCaptcha key', 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.', - 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.', + 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you type the text displayed into the field underneath.', 'RECAPTCHA_SOCKET_ERROR' => 'There was a problem connecting to the RECAPTCHA service: could not open socket. Try again later.', )); diff --git a/phpBB/language/en/email/short/newtopic_notify.txt b/phpBB/language/en/email/short/newtopic_notify.txt index bf6799e5be..5089e7dcb8 100644 --- a/phpBB/language/en/email/short/newtopic_notify.txt +++ b/phpBB/language/en/email/short/newtopic_notify.txt @@ -2,7 +2,7 @@ Subject: New topic notification - "{FORUM_NAME}" Hello {USERNAME}, -You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. +You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum. {U_FORUM} diff --git a/phpBB/language/en/email/short/topic_notify.txt b/phpBB/language/en/email/short/topic_notify.txt index 472375fb22..529478eae2 100644 --- a/phpBB/language/en/email/short/topic_notify.txt +++ b/phpBB/language/en/email/short/topic_notify.txt @@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}" Hello {USERNAME}, -You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. If you want to view the newest post made since your last visit, click the following link: {U_NEWEST_POST} diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php index f5a56816c2..244a5faadf 100644 --- a/phpBB/language/en/migrator.php +++ b/phpBB/language/en/migrator.php @@ -52,6 +52,13 @@ $lang = array_merge($lang, array( 'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds', 'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.', + 'MIGRATION_INVALID_DATA_MISSING_CONDITION' => 'A migration is invalid. An if statement helper is missing a condition.', + 'MIGRATION_INVALID_DATA_MISSING_STEP' => 'A migration is invalid. An if statement helper is missing a valid call to a migration step.', + 'MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE' => 'A migration is invalid. A custom callable function could not be called.', + 'MIGRATION_INVALID_DATA_UNKNOWN_TYPE' => 'A migration is invalid. An unknown migration tool type was encountered.', + 'MIGRATION_INVALID_DATA_UNDEFINED_TOOL' => 'A migration is invalid. An undefined migration tool was encountered.', + 'MIGRATION_INVALID_DATA_UNDEFINED_METHOD' => 'A migration is invalid. An undefined migration tool method was encountered.', + 'MODULE_ERROR' => 'An error occurred while creating a module: %s', 'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s', 'MODULE_NOT_EXIST' => 'A required module does not exist: %s', diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php index d32e7504eb..c71950c698 100644 --- a/phpBB/phpbb/auth/provider/ldap.php +++ b/phpBB/phpbb/auth/provider/ldap.php @@ -306,7 +306,7 @@ class ldap extends \phpbb\auth\provider\base return array( 'TEMPLATE_FILE' => 'auth_provider_ldap.html', 'TEMPLATE_VARS' => array( - 'AUTH_LDAP_DN' => $new_config['ldap_base_dn'], + 'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'], 'AUTH_LDAP_EMAIL' => $new_config['ldap_email'], 'AUTH_LDAP_PASSORD' => $new_config['ldap_password'], 'AUTH_LDAP_PORT' => $new_config['ldap_port'], diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index 023cf402ca..f488c2022d 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -117,7 +117,8 @@ class token_storage implements TokenStorageInterface { $service = $this->get_service_name_for_db($service); - if ($this->cachedToken) { + if ($this->cachedToken) + { return true; } @@ -232,7 +233,8 @@ class token_storage implements TokenStorageInterface { $service = $this->get_service_name_for_db($service); - if ($this->cachedToken instanceof TokenInterface) { + if ($this->cachedToken instanceof TokenInterface) + { return $this->cachedToken; } diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index 8888686b2d..36087f8ba0 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -23,8 +23,10 @@ class local extends \phpbb\avatar\driver\driver */ public function get_data($row) { + $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path(); + return array( - 'src' => $this->path_helper->get_web_root_path() . $this->config['avatar_gallery_path'] . '/' . $row['avatar'], + 'src' => $root_path . $this->config['avatar_gallery_path'] . '/' . $row['avatar'], 'width' => $row['avatar_width'], 'height' => $row['avatar_height'], ); diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index 003b23659f..ee36243844 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -48,8 +48,10 @@ class upload extends \phpbb\avatar\driver\driver */ public function get_data($row, $ignore_config = false) { + $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $this->path_helper->get_web_root_path(); + return array( - 'src' => $this->path_helper->get_web_root_path() . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'], + 'src' => $root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'], 'width' => $row['avatar_width'], 'height' => $row['avatar_height'], ); diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index fd5bce4515..9a7c4aec7f 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -279,6 +279,7 @@ class file extends \phpbb\cache\driver\base if ($var_name[0] == '_') { global $phpEx; + $var_name = $this->clean_varname($var_name); return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx"); } else @@ -334,6 +335,7 @@ class file extends \phpbb\cache\driver\base { global $phpEx; + $filename = $this->clean_varname($filename); $file = "{$this->cache_dir}$filename.$phpEx"; $type = substr($filename, 0, strpos($filename, '_')); @@ -516,6 +518,7 @@ class file extends \phpbb\cache\driver\base { global $phpEx; + $filename = $this->clean_varname($filename); $file = "{$this->cache_dir}$filename.$phpEx"; $lock = new \phpbb\lock\flock($file); @@ -584,4 +587,15 @@ class file extends \phpbb\cache\driver\base return $return_value; } + + /** + * Replace slashes in the file name + * + * @param string $varname name of a cache variable + * @return string $varname name that is safe to use as a filename + */ + protected function clean_varname($varname) + { + return str_replace('/', '-', $varname); + } } diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index a7ba994cc3..04052b3406 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -125,7 +125,7 @@ class qa */ public function is_available() { - global $config, $db, $phpbb_root_path, $phpEx, $user; + global $config, $db, $user; // load language file for pretty display in the ACP dropdown $user->add_lang('captcha_qa'); @@ -263,7 +263,7 @@ class qa */ function garbage_collect($type = 0) { - global $db, $config; + global $db; $sql = 'SELECT c.confirm_id FROM ' . $this->table_qa_confirm . ' c @@ -310,8 +310,6 @@ class qa $db_tool = new \phpbb\db\tools($db); - $tables = array($this->table_captcha_questions, $this->table_captcha_answers, $this->table_qa_confirm); - $schemas = array( $this->table_captcha_questions => array ( 'COLUMNS' => array( @@ -366,7 +364,7 @@ class qa */ function validate() { - global $config, $db, $user; + global $user; $error = ''; @@ -414,7 +412,7 @@ class qa if (!sizeof($this->question_ids)) { - return false; + return; } $this->confirm_id = md5(unique_id($user->ip)); $this->question = (int) array_rand($this->question_ids); @@ -440,7 +438,7 @@ class qa if (!sizeof($this->question_ids)) { - return false; + return; } $this->question = (int) array_rand($this->question_ids); @@ -611,8 +609,8 @@ class qa */ function acp_page($id, &$module) { - global $db, $user, $auth, $template; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $user, $template; + global $config; $user->add_lang('acp/board'); $user->add_lang('captcha_qa'); @@ -674,11 +672,7 @@ class qa else { // okay, show the editor - $error = false; - $input_question = request_var('question_text', '', true); - $input_answers = request_var('answers', '', true); - $input_lang = request_var('lang_iso', '', true); - $input_strict = request_var('strict', false); + $question_input = $this->acp_get_question_input(); $langs = $this->get_languages(); foreach ($langs as $lang => $entry) @@ -697,13 +691,11 @@ class qa { if ($question = $this->acp_get_question_data($question_id)) { - $answers = (isset($input_answers[$lang])) ? $input_answers[$lang] : implode("\n", $question['answers']); - $template->assign_vars(array( - 'QUESTION_TEXT' => ($input_question) ? $input_question : $question['question_text'], - 'LANG_ISO' => ($input_lang) ? $input_lang : $question['lang_iso'], - 'STRICT' => (isset($_REQUEST['strict'])) ? $input_strict : $question['strict'], - 'ANSWERS' => $answers, + 'QUESTION_TEXT' => ($question_input['question_text']) ? $question_input['question_text'] : $question['question_text'], + 'LANG_ISO' => ($question_input['lang_iso']) ? $question_input['lang_iso'] : $question['lang_iso'], + 'STRICT' => (isset($_REQUEST['strict'])) ? $question_input['strict'] : $question['strict'], + 'ANSWERS' => implode("\n", $question['answers']), )); } else @@ -714,18 +706,16 @@ class qa else { $template->assign_vars(array( - 'QUESTION_TEXT' => $input_question, - 'LANG_ISO' => $input_lang, - 'STRICT' => $input_strict, - 'ANSWERS' => $input_answers, + 'QUESTION_TEXT' => $question_input['question_text'], + 'LANG_ISO' => $question_input['lang_iso'], + 'STRICT' => $question_input['strict'], + 'ANSWERS' => (is_array($question_input['answers'])) ? implode("\n", $question_input['answers']) : '', )); } if ($submit && check_form_key($form_key)) { - $data = $this->acp_get_question_input(); - - if (!$this->validate_input($data)) + if (!$this->validate_input($question_input)) { $template->assign_vars(array( 'S_ERROR' => true, @@ -735,11 +725,11 @@ class qa { if ($question_id) { - $this->acp_update_question($data, $question_id); + $this->acp_update_question($question_input, $question_id); } else { - $this->acp_add_question($data); + $this->acp_add_question($question_input); } add_log('admin', 'LOG_CONFIG_VISUAL'); @@ -819,6 +809,8 @@ class qa return $question; } + + return false; } /** @@ -827,13 +819,21 @@ class qa function acp_get_question_input() { $answers = utf8_normalize_nfc(request_var('answers', '', true)); + + // Convert answers into array and filter if answers are set + if (strlen($answers)) + { + $answers = array_filter(array_map('trim', explode("\n", $answers)), function ($value) { + return $value !== ''; + }); + } + $question = array( 'question_text' => request_var('question_text', '', true), 'strict' => request_var('strict', false), 'lang_iso' => request_var('lang_iso', ''), - 'answers' => (strlen($answers)) ? explode("\n", $answers) : '', + 'answers' => $answers, ); - return $question; } diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index c8516d6c85..0ba0489cb7 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -45,7 +45,7 @@ class content_visibility /** * Event dispatcher object - * @var \phpbb\event\dispatcher + * @var \phpbb\event\dispatcher_interface */ protected $phpbb_dispatcher; @@ -66,7 +66,7 @@ class content_visibility * * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\config\config $config Config object - * @param \phpbb\event\dispatcher $phpbb_dispatcher Event dispatcher object + * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object * @param \phpbb\db\driver\driver_interface $db Database object * @param \phpbb\user $user User object * @param string $phpbb_root_path Root path @@ -76,7 +76,7 @@ class content_visibility * @param string $topics_table Topics table name * @param string $users_table Users table name */ - public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table) + public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table) { $this->auth = $auth; $this->config = $config; @@ -143,12 +143,43 @@ class content_visibility */ public function get_visibility_sql($mode, $forum_id, $table_alias = '') { + $where_sql = ''; + + $get_visibility_sql_overwrite = false; + + /** + * Allow changing the result of calling get_visibility_sql + * + * @event core.phpbb_content_visibility_get_visibility_sql_before + * @var string where_sql Extra visibility conditions. It must end with either an SQL "AND" or an "OR" + * @var string mode Either "topic" or "post" depending on the query this is being used in + * @var array forum_id The forum id in which the search is made. + * @var string table_alias Table alias to prefix in SQL queries + * @var mixed get_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event + * If false, get_visibility_sql continues normally + * It must be either boolean or string + * @since 3.1.4-RC1 + */ + $vars = array( + 'where_sql', + 'mode', + 'forum_id', + 'table_alias', + 'get_visibility_sql_overwrite', + ); + extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_visibility_sql_before', compact($vars))); + + if ($get_visibility_sql_overwrite !== false) + { + return $get_visibility_sql_overwrite; + } + if ($this->auth->acl_get('m_approve', $forum_id)) { - return '1 = 1'; + return $where_sql . '1 = 1'; } - return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED; + return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED; } /** @@ -206,7 +237,7 @@ class content_visibility if (!sizeof($forum_ids)) { // The user can see all posts/topics in all specified forums - return $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums); + return $where_sql . $this->db->sql_in_set($table_alias . 'forum_id', $approve_forums) . ')'; } else { @@ -217,8 +248,8 @@ class content_visibility else { // The user is just a normal user - return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ' - AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids, false, true); + return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ' + AND ' . $this->db->sql_in_set($table_alias . 'forum_id', $forum_ids, false, true) . ')'; } $where_sql .= '(' . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED . ' @@ -252,7 +283,7 @@ class content_visibility * @event core.phpbb_content_visibility_get_global_visibility_before * @var array where_sqls The action the user tried to execute * @var string mode Either "topic" or "post" depending on the query this is being used in - * @var array forum_ids Array of forum ids which the posts/topics are limited to + * @var array exclude_forum_ids Array of forum ids the current user doesn't have access to * @var string table_alias Table alias to prefix in SQL queries * @var array approve_forums Array of forums where the user has m_approve permissions * @var string visibility_sql_overwrite Forces the function to return an implosion of where_sqls (joined by "OR") @@ -261,7 +292,7 @@ class content_visibility $vars = array( 'where_sqls', 'mode', - 'forum_ids', + 'exclude_forum_ids', 'table_alias', 'approve_forums', 'visibility_sql_overwrite', diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index c6c470e91b..a07a396e73 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -13,6 +13,7 @@ namespace phpbb\controller; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Generator\UrlGenerator; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -142,6 +143,12 @@ class helper $base_url = $context->getBaseUrl(); + // Append page name if base URL does not contain it + if (!empty($page_name) && strpos($base_url, '/' . $page_name) === false) + { + $base_url .= '/' . $page_name; + } + // If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it. $base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url); @@ -206,12 +213,31 @@ class helper public function message($message, array $parameters = array(), $title = 'INFORMATION', $code = 200) { array_unshift($parameters, $message); + $message_text = call_user_func_array(array($this->user, 'lang'), $parameters); + $message_title = $this->user->lang($title); + + if ($this->request->is_ajax()) + { + global $refresh_data; + + return new JsonResponse( + array( + 'MESSAGE_TITLE' => $message_title, + 'MESSAGE_TEXT' => $message_text, + 'S_USER_WARNING' => false, + 'S_USER_NOTICE' => false, + 'REFRESH_DATA' => (!empty($refresh_data)) ? $refresh_data : null + ), + $code + ); + } + $this->template->assign_vars(array( - 'MESSAGE_TEXT' => call_user_func_array(array($this->user, 'lang'), $parameters), - 'MESSAGE_TITLE' => $this->user->lang($title), + 'MESSAGE_TEXT' => $message_text, + 'MESSAGE_TITLE' => $message_title, )); - return $this->render('message_body.html', $this->user->lang($title), $code); + return $this->render('message_body.html', $message_title, $code); } /** diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 2ed08211ad..c0ddfbf76c 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -34,8 +34,7 @@ class mysqli extends \phpbb\db\driver\mysql_base return $this->sql_error(''); } - // Mysqli extension supports persistent connection since PHP 5.3.0 - $this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false; + $this->persistency = $persistency; $this->user = $sqluser; // If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php new file mode 100644 index 0000000000..51475f5a05 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14.php @@ -0,0 +1,37 @@ +<?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\v30x; + +class release_3_0_14 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.14', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_14_rc1'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.14', '<'), + array('config.update', array('version', '3.0.14')), + )), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php new file mode 100644 index 0000000000..421ef06dd3 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_14_rc1.php @@ -0,0 +1,37 @@ +<?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\v30x; + +class release_3_0_14_rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.0.14-RC1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_13'); + } + + public function update_data() + { + return array( + array('if', array( + phpbb_version_compare($this->config['version'], '3.0.14-RC1', '<'), + array('config.update', array('version', '3.0.14-RC1')), + )), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/avatars.php b/phpBB/phpbb/db/migration/data/v310/avatars.php index 2698adeed5..9b03a8fa94 100644 --- a/phpBB/phpbb/db/migration/data/v310/avatars.php +++ b/phpBB/phpbb/db/migration/data/v310/avatars.php @@ -17,7 +17,29 @@ class avatars extends \phpbb\db\migration\migration { public function effectively_installed() { - return isset($this->config['allow_avatar_gravatar']); + // Get current avatar type of guest user + $sql = 'SELECT user_avatar_type + FROM ' . $this->table_prefix . 'users + WHERE user_id = ' . ANONYMOUS; + $result = $this->db->sql_query($sql); + $backup_type = $this->db->sql_fetchfield('user_avatar_type'); + $this->db->sql_freeresult($result); + + // Try to set avatar type to string + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = 'avatar.driver.upload' + WHERE user_id = " . ANONYMOUS; + $this->db->sql_return_on_error(true); + $effectively_installed = $this->db->sql_query($sql); + $this->db->sql_return_on_error(); + + // Restore avatar type of guest user to previous state + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_avatar_type = '{$backup_type}' + WHERE user_id = " . ANONYMOUS; + $this->db->sql_query($sql); + + return $effectively_installed !== false; } static public function depends_on() diff --git a/phpBB/phpbb/db/migration/data/v31x/v314.php b/phpBB/phpbb/db/migration/data/v31x/v314.php new file mode 100644 index 0000000000..b7793ca569 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v314.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 v314 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_14', + '\phpbb\db\migration\data\v31x\v314rc2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.4')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc1.php b/phpBB/phpbb/db/migration/data/v31x/v314rc1.php new file mode 100644 index 0000000000..10cdbe3f9c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v314rc1.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 v314rc1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v313', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.4-RC1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc2.php b/phpBB/phpbb/db/migration/data/v31x/v314rc2.php new file mode 100644 index 0000000000..b75b7a9be8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v314rc2.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 v314rc2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v30x\release_3_0_14_rc1', + '\phpbb\db\migration\data\v31x\v314rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.4-RC2')), + ); + } +} diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php index 57e4840380..3a709f73fd 100644 --- a/phpBB/phpbb/event/kernel_terminate_subscriber.php +++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php @@ -35,7 +35,7 @@ class kernel_terminate_subscriber implements EventSubscriberInterface public static function getSubscribedEvents() { return array( - KernelEvents::TERMINATE => 'on_kernel_terminate', + KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX), ); } } diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php index f7021875f3..7f94ca9299 100644 --- a/phpBB/phpbb/event/md_exporter.php +++ b/phpBB/phpbb/event/md_exporter.php @@ -24,6 +24,12 @@ class md_exporter /** @var string phpBB Root Path */ protected $root_path; + /** @var string The minimum version for the events to return */ + protected $min_version; + + /** @var string The maximum version for the events to return */ + protected $max_version; + /** @var string */ protected $filter; @@ -36,8 +42,10 @@ class md_exporter /** * @param string $phpbb_root_path * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core + * @param string $min_version + * @param string $max_version */ - public function __construct($phpbb_root_path, $extension = null) + public function __construct($phpbb_root_path, $extension = null, $min_version = null, $max_version = null) { $this->root_path = $phpbb_root_path; $this->path = $this->root_path; @@ -49,6 +57,8 @@ class md_exporter $this->events = array(); $this->events_by_file = array(); $this->filter = $this->current_event = ''; + $this->min_version = $min_version; + $this->max_version = $max_version; } /** @@ -152,6 +162,11 @@ class md_exporter $files = $this->validate_file_list($file_details); $since = $this->validate_since($since); + if (!$this->version_is_filtered($since)) + { + continue; + } + $this->events[$event_name] = array( 'event' => $this->current_event, 'files' => $files, @@ -164,20 +179,47 @@ class md_exporter } /** + * The version to check + * + * @param string $version + */ + protected function version_is_filtered($version) + { + return (!$this->min_version || phpbb_version_compare($this->min_version, $version, '<=')) + && (!$this->max_version || phpbb_version_compare($this->max_version, $version, '>=')); + } + + /** * Format the php events as a wiki table + * + * @param string $action * @return string Number of events found */ - public function export_events_for_wiki() + public function export_events_for_wiki($action = '') { if ($this->filter === 'adm') { - $wiki_page = '= ACP Template Events =' . "\n"; + if ($action === 'diff') + { + $wiki_page = '=== ACP Template Events ===' . "\n"; + } + else + { + $wiki_page = '= ACP Template Events =' . "\n"; + } $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n"; $wiki_page .= '! Identifier !! Placement !! Added in Release !! Explanation' . "\n"; } else { - $wiki_page = '= Template Events =' . "\n"; + if ($action === 'diff') + { + $wiki_page = '=== Template Events ===' . "\n"; + } + else + { + $wiki_page = '= Template Events =' . "\n"; + } $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n"; $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Subsilver Placement (If applicable) !! Added in Release !! Explanation' . "\n"; } diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php index 35144eeeec..8cffa4620f 100644 --- a/phpBB/phpbb/event/php_exporter.php +++ b/phpBB/phpbb/event/php_exporter.php @@ -25,6 +25,12 @@ class php_exporter /** @var string phpBB Root Path */ protected $root_path; + /** @var string The minimum version for the events to return */ + protected $min_version; + + /** @var string The maximum version for the events to return */ + protected $max_version; + /** @var string */ protected $current_file; @@ -43,14 +49,18 @@ class php_exporter /** * @param string $phpbb_root_path * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core + * @param string $min_version + * @param string $max_version */ - public function __construct($phpbb_root_path, $extension = null) + public function __construct($phpbb_root_path, $extension = null, $min_version = null, $max_version = null) { $this->root_path = $phpbb_root_path; $this->path = $phpbb_root_path; $this->events = $this->file_lines = array(); $this->current_file = $this->current_event = ''; $this->current_event_line = 0; + $this->min_version = $min_version; + $this->max_version = $max_version; $this->path = $this->root_path; if ($extension) @@ -148,11 +158,20 @@ class php_exporter /** * Format the php events as a wiki table + * + * @param string $action * @return string */ - public function export_events_for_wiki() + public function export_events_for_wiki($action = '') { - $wiki_page = '= PHP Events (Hook Locations) =' . "\n"; + if ($action === 'diff') + { + $wiki_page = '=== PHP Events (Hook Locations) ===' . "\n"; + } + else + { + $wiki_page = '= PHP Events (Hook Locations) =' . "\n"; + } $wiki_page .= '{| class="sortable zebra" cellspacing="0" cellpadding="5"' . "\n"; $wiki_page .= '! Identifier !! Placement !! Arguments !! Added in Release !! Explanation' . "\n"; foreach ($this->events as $event) @@ -215,6 +234,34 @@ class php_exporter $since_line_num = $this->find_since(); $since = $this->validate_since($this->file_lines[$since_line_num]); + $changed_line_nums = $this->find_changed('changed'); + if (empty($changed_line_nums)) + { + $changed_line_nums = $this->find_changed('change'); + } + $changed_versions = array(); + if (!empty($changed_line_nums)) + { + foreach ($changed_line_nums as $changed_line_num) + { + $changed_versions[] = $this->validate_changed($this->file_lines[$changed_line_num]); + } + } + + if (!$this->version_is_filtered($since)) + { + $valid_version = false; + foreach ($changed_versions as $changed) + { + $valid_version = $valid_version || $this->version_is_filtered($changed); + } + + if (!$valid_version) + { + continue; + } + } + // Find event description line $description_line_num = $this->find_description(); $description = substr(trim($this->file_lines[$description_line_num]), strlen('* ')); @@ -243,6 +290,17 @@ class php_exporter } /** + * The version to check + * + * @param string $version + */ + protected function version_is_filtered($version) + { + return (!$this->min_version || phpbb_version_compare($this->min_version, $version, '<=')) + && (!$this->max_version || phpbb_version_compare($this->max_version, $version, '>=')); + } + + /** * Find the name of the event inside the dispatch() line * * @param int $event_line @@ -449,6 +507,33 @@ class php_exporter } /** + * Find the "@changed" Information lines + * + * @param string $tag_name Should be 'changed' or 'change' + * @return array Absolute line numbers + * @throws \LogicException + */ + public function find_changed($tag_name) + { + $lines = array(); + $last_line = 0; + try + { + while ($line = $this->find_tag($tag_name, array('since'), $last_line)) + { + $lines[] = $line; + $last_line = $line; + } + } + catch (\LogicException $e) + { + // Not changed? No problem! + } + + return $lines; + } + + /** * Find the "@event" Information line * * @return int Absolute line number @@ -464,13 +549,14 @@ class php_exporter * @param string $find_tag Name of the tag we are trying to find * @param array $disallowed_tags List of tags that must not appear between * the tag and the actual event + * @param int $skip_to_line Skip lines until this one * @return int Absolute line number * @throws \LogicException */ - public function find_tag($find_tag, $disallowed_tags) + public function find_tag($find_tag, $disallowed_tags, $skip_to_line = 0) { - $find_tag_line = 0; - $found_comment_end = false; + $find_tag_line = $skip_to_line ? $this->current_event_line - $skip_to_line + 1 : 0; + $found_comment_end = ($skip_to_line) ? true : false; while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0) { if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**') @@ -561,6 +647,27 @@ class php_exporter } /** + * Validate "@changed" Information + * + * @param string $line + * @return string + * @throws \LogicException + */ + public function validate_changed($line) + { + $match = array(); + $line = str_replace("\t", ' ', ltrim($line, "\t ")); + preg_match('#^\* @change(d)? (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)( (?:.*))?$#', $line, $match); + if (!isset($match[2])) + { + throw new \LogicException("Invalid '@changed' information for event " + . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'"); + } + + return $match[2]; + } + + /** * Validate "@event" Information * * @param string $event_name diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index aa52eb61d0..db92170dd8 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -38,7 +38,7 @@ class manager /** @var \phpbb\config\config */ protected $config; - /** @var \phpbb\event\dispatcher */ + /** @var \phpbb\event\dispatcher_interface */ protected $phpbb_dispatcher; /** @var \phpbb\db\driver\driver_interface */ @@ -73,7 +73,7 @@ class manager * @param ContainerInterface $phpbb_container * @param \phpbb\user_loader $user_loader * @param \phpbb\config\config $config - * @param \phpbb\event\dispatcher $phpbb_dispatcher + * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\cache\service $cache * @param \phpbb\user $user @@ -85,7 +85,7 @@ class manager * * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; diff --git a/phpBB/phpbb/passwords/manager.php b/phpBB/phpbb/passwords/manager.php index fbb49d86a0..aa9147ecf4 100644 --- a/phpBB/phpbb/passwords/manager.php +++ b/phpBB/phpbb/passwords/manager.php @@ -56,7 +56,7 @@ class manager * @param array $hashing_algorithms Hashing driver * service collection * @param \phpbb\passwords\helper $helper Passwords helper object - * @param string $defaults List of default driver types + * @param array $defaults List of default driver types */ public function __construct(\phpbb\config\config $config, $hashing_algorithms, helper $helper, $defaults) { diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index 9b3dcadf32..82f59b5c20 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -277,13 +277,14 @@ class permissions 'm_approve' => array('lang' => 'ACL_M_APPROVE', 'cat' => 'post_actions'), 'm_report' => array('lang' => 'ACL_M_REPORT', 'cat' => 'post_actions'), 'm_chgposter' => array('lang' => 'ACL_M_CHGPOSTER', 'cat' => 'post_actions'), + 'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'post_actions'), + 'm_softdelete' => array('lang' => 'ACL_M_SOFTDELETE', 'cat' => 'post_actions'), 'm_move' => array('lang' => 'ACL_M_MOVE', 'cat' => 'topic_actions'), 'm_lock' => array('lang' => 'ACL_M_LOCK', 'cat' => 'topic_actions'), 'm_split' => array('lang' => 'ACL_M_SPLIT', 'cat' => 'topic_actions'), 'm_merge' => array('lang' => 'ACL_M_MERGE', 'cat' => 'topic_actions'), - 'm_info' => array('lang' => 'ACL_M_INFO', 'cat' => 'misc'), 'm_warn' => array('lang' => 'ACL_M_WARN', 'cat' => 'misc'), 'm_ban' => array('lang' => 'ACL_M_BAN', 'cat' => 'misc'), diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index 3c686a552f..ca78167ec0 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -267,8 +267,8 @@ class plupload { $resize = sprintf( 'resize: {width: %d, height: %d, quality: 100},', - (int) $this->config['img_max_height'], - (int) $this->config['img_max_width'] + (int) $this->config['img_max_width'], + (int) $this->config['img_max_height'] ); } @@ -326,7 +326,7 @@ class plupload $tmp_file = $this->temporary_filepath($upload['tmp_name']); - if (!move_uploaded_file($upload['tmp_name'], $tmp_file)) + if (!phpbb_is_writable($this->temporary_directory) || !move_uploaded_file($upload['tmp_name'], $tmp_file)) { $this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED'); } diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 93ea46ca60..4d02dd1cbf 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -823,6 +823,13 @@ class fulltext_native extends \phpbb\search\base ); } + // if using mysql and the total result count is not calculated yet, get it from the db + if (!$total_results && $is_mysql) + { + // Also count rows for the query as if there was not LIMIT. Add SQL_CALC_FOUND_ROWS to SQL + $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; + } + $sql_array['WHERE'] = implode(' AND ', $sql_where); $sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : ''; $sql_array['ORDER_BY'] = $sql_sort; @@ -838,19 +845,9 @@ class fulltext_native extends \phpbb\search\base } $this->db->sql_freeresult($result); - // if we use mysql and the total result count is not cached yet, retrieve it from the db if (!$total_results && $is_mysql) { - // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it - $sql_array_copy = $sql_array; - $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id '; - - $sql_calc = $this->db->sql_build_query('SELECT', $sql_array_copy); - unset($sql_array_copy); - - $this->db->sql_query($sql_calc); - $this->db->sql_freeresult($result); - + // Get the number of results as calculated by MySQL $sql_count = 'SELECT FOUND_ROWS() as total_results'; $result = $this->db->sql_query($sql_count); $total_results = (int) $this->db->sql_fetchfield('total_results'); diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 0a6a18ffbe..bedd581725 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -130,6 +130,10 @@ class session $script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/'; $root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/'; + $forum_id = $request->variable('f', 0); + // maximum forum id value is maximum value of mediumint unsigned column + $forum_id = ($forum_id > 0 && $forum_id < 16777215) ? $forum_id : 0; + $page_array += array( 'page_name' => $page_name, 'page_dir' => $page_dir, @@ -139,7 +143,7 @@ class session 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)), 'page' => $page, - 'forum' => request_var('f', 0), + 'forum' => $forum_id, ); return $page_array; diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index 2f8ffaa776..139a413b70 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -97,7 +97,8 @@ class loader extends \Twig_Loader_Filesystem // If this is in the cache we can skip the entire process below // as it should have already been validated - if (isset($this->cache[$name])) { + if (isset($this->cache[$name])) + { return $this->cache[$name]; } diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index 695ec4281f..c110785c4b 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -31,7 +31,8 @@ class definenode extends \Twig_Node { $compiler->addDebugInfo($this); - if ($this->getAttribute('capture')) { + if ($this->getAttribute('capture')) + { $compiler ->write("ob_start();\n") ->subcompile($this->getNode('value')) diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 826617e8e8..659495fd9e 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -47,7 +47,8 @@ class includephp extends \Twig_Node return; } - if ($this->getAttribute('ignore_missing')) { + if ($this->getAttribute('ignore_missing')) + { $compiler ->write("try {\n") ->indent() @@ -76,7 +77,8 @@ class includephp extends \Twig_Node ->write("}\n") ; - if ($this->getAttribute('ignore_missing')) { + if ($this->getAttribute('ignore_missing')) + { $compiler ->outdent() ->write("} catch (\Twig_Error_Loader \$e) {\n") diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index cfee84a363..2b88d61118 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -33,7 +33,8 @@ class defineparser extends \Twig_TokenParser $name = $this->parser->getExpressionParser()->parseExpression(); $capture = false; - if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) { + if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) + { $stream->next(); $value = $this->parser->getExpressionParser()->parseExpression(); @@ -45,7 +46,9 @@ class defineparser extends \Twig_TokenParser } $stream->expect(\Twig_Token::BLOCK_END_TYPE); - } else { + } + else + { $capture = true; $stream->expect(\Twig_Token::BLOCK_END_TYPE); diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index 38196c5290..c09f7729b0 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -31,7 +31,8 @@ class includephp extends \Twig_TokenParser $stream = $this->parser->getStream(); $ignoreMissing = false; - if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) { + if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) + { $stream->next(); $stream->expect(\Twig_Token::NAME_TYPE, 'missing'); diff --git a/phpBB/posting.php b/phpBB/posting.php index ac412c0c73..f0446cf2db 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -330,14 +330,17 @@ switch ($mode) { $is_authed = true; } - break; + + // no break; case 'soft_delete': - if ($user->data['is_registered'] && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $post_data['post_edit_locked'])) + if (!$is_authed && $user->data['is_registered'] && $phpbb_content_visibility->can_soft_delete($forum_id, $post_data['poster_id'], $post_data['post_edit_locked'])) { + // Fall back to soft_delete if we have no permissions to delete posts but to soft delete them $is_authed = true; + $mode = 'soft_delete'; } - else + else if (!$is_authed) { // Display the same error message for softdelete we use for delete $mode = 'delete'; @@ -1517,9 +1520,13 @@ if (!sizeof($error) && $preview) 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $post_data['poll_max_options']), )); - $parse_poll->message = implode("\n", $post_data['poll_options']); - $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); - $preview_poll_options = explode('<br />', $parse_poll->message); + $preview_poll_options = array(); + foreach ($post_data['poll_options'] as $poll_option) + { + $parse_poll->message = $poll_option; + $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); + $preview_poll_options[] = $parse_poll->message; + } unset($parse_poll); foreach ($preview_poll_options as $key => $option) diff --git a/phpBB/search.php b/phpBB/search.php index 164d834ff2..cece37f29c 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -797,7 +797,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } else { - $bbcode_bitfield = $text_only_message = ''; + $text_only_message = ''; $attach_list = array(); while ($row = $db->sql_fetchrow($result)) @@ -817,7 +817,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3)) { $row['display_text_only'] = false; - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); // Does this post have an attachment? If so, add it to the list if ($row['post_attachment'] && $config['allow_attachments']) @@ -837,13 +836,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) unset($text_only_message); - // Instantiate BBCode if needed - if ($bbcode_bitfield !== '') - { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode(base64_encode($bbcode_bitfield)); - } - // Pull attachment data if (sizeof($attach_list)) { diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index 34a7618f86..b39dac079a 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.3 -phpbb_version = 3.1.3 +style_version = 3.1.4 +phpbb_version = 3.1.4 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index aabc5679f6..7a377a4973 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -376,12 +376,19 @@ function parseDocument($container) { function resize() { var width = 0, - diff = $left.outerWidth(true) - $left.width(); + diff = $left.outerWidth(true) - $left.width(), + minWidth = Math.max($this.width() / 3, 240), + maxWidth; $right.each(function() { - width += $(this).outerWidth(true); + var $this = $(this); + if ($this.is(':visible')) { + width += $this.outerWidth(true); + } }); - $left.css('max-width', Math.floor($this.width() - width - diff) + 'px'); + + maxWidth = $this.width() - width - diff; + $left.css('max-width', Math.floor(Math.max(maxWidth, minWidth)) + 'px'); } resize(); @@ -410,7 +417,13 @@ function parseDocument($container) { // Function that checks breadcrumbs function check() { var height = $this.height(), - width = $body.width(); + width; + + // Test max-width set in code for .navlinks above + width = parseInt($this.css('max-width')); + if (!width) { + width = $body.width(); + } maxHeight = parseInt($this.css('line-height')); $links.each(function() { diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 3e7a2cd102..f8d6e36c8c 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -13,12 +13,14 @@ <div class="inner"> <ul class="topiclist"> <li class="header"> + <!-- EVENT forumlist_body_category_header_row_prepend --> <dl class="icon"> <dt><div class="list-inner"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt> <dd class="topics">{L_TOPICS}</dd> <dd class="posts">{L_POSTS}</dd> <dd class="lastpost"><span>{L_LAST_POST}</span></dd> </dl> + <!-- EVENT forumlist_body_category_header_row_append --> </li> </ul> <ul class="topiclist forums"> @@ -45,7 +47,7 @@ <!-- EVENT forumlist_body_subforums_before --> <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 --> + <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_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 --> <!-- EVENT forumlist_body_subforums_after --> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index eaa3838f17..4f74085968 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -22,10 +22,10 @@ <table class="table1"> <thead> <tr> - <th>{L_USERNAME}</th> - <th style="text-align: center">{L_IP}</th> - <th style="text-align: center">{L_TIME}</th> - <th>{L_ACTION}</th> + <th class="name">{L_USERNAME}</th> + <th class="center">{L_IP}</th> + <th class="center">{L_TIME}</th> + <th class="name">{L_ACTION}</th> <!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF --> </tr> </thead> @@ -34,8 +34,8 @@ <!-- BEGIN log --> <!-- IF log.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF --> <td>{log.USERNAME}</td> - <td style="text-align: center">{log.IP}</td> - <td style="text-align: center">{log.DATE}</td> + <td class="center">{log.IP}</td> + <td class="center">{log.DATE}</td> <td>{log.ACTION}<br /> {log.DATA} </td> diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index ec317b141a..3e8d47eb9d 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -65,9 +65,9 @@ <table class="table1"> <thead> <tr> - <th>{L_REPORT_BY}</th> - <th style="text-align: center">{L_IP}</th> - <th style="text-align: center">{L_TIME}</th> + <th class="name reportby">{L_REPORT_BY}</th> + <th class="center">{L_IP}</th> + <th class="center">{L_TIME}</th> <th>{L_ACTION_NOTE}</th> <!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF --> </tr> @@ -76,11 +76,11 @@ <!-- BEGIN usernotes --> <!-- IF usernotes.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF --> <td>{usernotes.REPORT_BY}</td> - <td style="text-align: center">{usernotes.IP}</td> - <td style="text-align: center">{usernotes.REPORT_AT}</td> + <td class="center">{usernotes.IP}</td> + <td class="center">{usernotes.REPORT_AT}</td> <td>{usernotes.ACTION}</td> - <!-- IF S_CLEAR_ALLOWED --><td style="width: 5%; text-align: center;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF --> + <!-- IF S_CLEAR_ALLOWED --><td class="center" style="width: 5%;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF --> </tr> <!-- BEGINELSE --> <tr> diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html index 1bfd83e3a1..4a9f764d07 100644 --- a/phpBB/styles/prosilver/template/memberlist_email.html +++ b/phpBB/styles/prosilver/template/memberlist_email.html @@ -40,21 +40,21 @@ </dl> <!-- ELSEIF S_CONTACT_ADMIN--> <dl> - <dt><label>{L_RECIPIENT}:</label></dt> + <dt><label>{L_RECIPIENT}{L_COLON}</label></dt> <dd><strong>{L_ADMINISTRATOR}</strong></dd> </dl> <!-- IF not S_IS_REGISTERED --> <dl> - <dt><label for="email">{L_SENDER_EMAIL_ADDRESS}:</label></dt> + <dt><label for="email">{L_SENDER_EMAIL_ADDRESS}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="1" value="{EMAIL}" /></dd> </dl> <dl> - <dt><label for="name">{L_SENDER_NAME}:</label></dt> + <dt><label for="name">{L_SENDER_NAME}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" tabindex="2" value="{NAME}" /></dd> </dl> <!-- ENDIF --> <dl> - <dt><label for="subject">{L_SUBJECT}:</label></dt> + <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt> <dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" tabindex="3" value="{SUBJECT}" /></dd> </dl> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html index 4a9275c898..b5a705d567 100644 --- a/phpBB/styles/prosilver/template/navbar_footer.html +++ b/phpBB/styles/prosilver/template/navbar_footer.html @@ -1,4 +1,4 @@ -<div class="navbar"> +<div class="navbar" role="navigation"> <div class="inner"> <ul id="nav-footer" class="linklist bulletin" role="menubar"> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 6f35d0e80b..8749ce60e8 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -3,7 +3,7 @@ <!-- EVENT overall_footer_page_body_after --> -<div id="page-footer"> +<div id="page-footer" role="contentinfo"> <!-- INCLUDE navbar_footer.html --> <div class="copyright"> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 121094f6e0..e0c8e51d25 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -2,7 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8" /> -<meta name="viewport" content="width=device-width" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> {META} <title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title> @@ -59,7 +59,7 @@ <div id="wrap"> <a id="top" class="anchor" accesskey="t"></a> <div id="page-header"> - <div class="headerbar"> + <div class="headerbar" role="banner"> <div class="inner"> <div id="site-description"> @@ -69,8 +69,9 @@ <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p> </div> + <!-- EVENT overall_header_searchbox_before --> <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --> - <div id="search-box" class="search-box search-header"> + <div id="search-box" class="search-box search-header" role="search"> <form action="{U_SEARCH}" method="get" id="search"> <fieldset> <input name="keywords" id="keywords" type="search" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search tiny" size="20" value="{SEARCH_WORDS}" placeholder="{L_SEARCH_MINI}" /> @@ -84,14 +85,14 @@ </div> </div> - + <!-- EVENT overall_header_navbar_before --> <!-- INCLUDE navbar_header.html --> </div> <!-- EVENT overall_header_page_body_before --> <a id="start_here" class="anchor"></a> - <div id="page-body"> + <div id="page-body" role="main"> <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) --> <div id="information" class="rules"> <div class="inner"> diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index e68e6a97e5..5804f95579 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -36,6 +36,7 @@ <!-- INCLUDE posting_buttons.html --> <div id="smiley-box"> + <!-- EVENT posting_editor_smilies_before --> <!-- IF S_SMILIES_ALLOWED and .smiley --> <strong>{L_SMILIES}</strong><br /> <!-- BEGIN smiley --> @@ -45,7 +46,7 @@ <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED --> <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a> <!-- ENDIF --> - + <!-- EVENT posting_editor_smilies_after --> <!-- IF BBCODE_STATUS --> <div class="bbcode-status"> <!-- IF .smiley --><hr /><!-- ENDIF --> @@ -58,6 +59,7 @@ {SMILIES_STATUS} </div> <!-- ENDIF --> + <!-- EVENT posting_editor_bbcode_status_after --> <!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW --> <!-- IF S_DISPLAY_REVIEW --><hr /><!-- ENDIF --> <!-- IF S_EDIT_DRAFT --><strong><a href="{S_UCP_ACTION}">{L_BACK_TO_DRAFTS}</a></strong><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/posting_pm_layout.html b/phpBB/styles/prosilver/template/posting_pm_layout.html index 3bdadd06ca..7f4a0ea8d7 100644 --- a/phpBB/styles/prosilver/template/posting_pm_layout.html +++ b/phpBB/styles/prosilver/template/posting_pm_layout.html @@ -19,7 +19,9 @@ <div class="panel" id="pmheader-postingbox"> <div class="inner"> + <!-- EVENT posting_pm_layout_include_pm_header_before --> <!-- INCLUDE posting_pm_header.html --> + <!-- EVENT posting_pm_layout_include_pm_header_after --> </div> </div> diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html index a131c10533..c3eea0d21d 100644 --- a/phpBB/styles/prosilver/template/posting_poll_body.html +++ b/phpBB/styles/prosilver/template/posting_poll_body.html @@ -43,8 +43,10 @@ <dd><label for="poll_vote_change"><input type="checkbox" id="poll_vote_change" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /> {L_POLL_VOTE_CHANGE_EXPLAIN}</label></dd> </dl> <!-- ENDIF --> + <!-- ENDIF --> + <!-- EVENT posting_poll_body_options_after --> - <!-- ELSEIF S_POLL_DELETE --> + <!-- IF S_POLL_DELETE --> <dl class="fields1"> <dt><label for="poll_delete">{L_POLL_DELETE}{L_COLON}</label></dt> <dd><label for="poll_delete"><input type="checkbox" name="poll_delete" id="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /> </label></dd> diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 970a7bcdd1..f76afe3767 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -1,21 +1,25 @@ <!-- INCLUDE overall_header.html --> +<!-- EVENT search_results_header_before --> + <h2 class="searchresults-title"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2> <!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}{L_COLON} <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF --> <!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}{L_COLON} <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF --> <!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF --> <!-- IF SEARCH_TOPIC --> - <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO_TOPIC}</a></p> + <p class="return-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO_TOPIC}</a></p> <!-- ELSE --> - <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_GO_TO_SEARCH_ADV}</a></p> + <p class="advanced-search-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_GO_TO_SEARCH_ADV}</a></p> <!-- ENDIF --> +<!-- EVENT search_results_header_after --> + <!-- IF .pagination or SEARCH_MATCHES or TOTAL_MATCHES or PAGE_NUMBER --> <div class="action-bar top"> <!-- IF TOTAL_MATCHES > 0 --> - <div class="search-box"> + <div class="search-box" role="search"> <form method="post" action="{S_SEARCH_ACTION}"> <fieldset> <input class="inputbox search tiny" type="search" name="add_keywords" id="add_keywords" value="" placeholder="{L_SEARCH_IN_RESULTS}" /> @@ -26,6 +30,8 @@ </div> <!-- ENDIF --> + <!-- EVENT search_results_searchbox_after --> + <div class="pagination"> {SEARCH_MATCHES} <!-- IF .pagination --> diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html index d5d0f45fa9..123f8992f2 100644 --- a/phpBB/styles/prosilver/template/simple_footer.html +++ b/phpBB/styles/prosilver/template/simple_footer.html @@ -1,6 +1,6 @@ </div> - <div class="copyright">{CREDIT_LINE} + <div class="copyright" role="contentinfo">{CREDIT_LINE} <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF --> </div> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index a0c7bc68bb..ab4f855a97 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -2,7 +2,7 @@ <html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta charset="utf-8" /> -<meta name="viewport" content="width=device-width" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> {META} <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title> @@ -36,4 +36,4 @@ <div id="wrap"> <a id="top" class="anchor" accesskey="t"></a> - <div id="page-body"> + <div id="page-body" role="main"> diff --git a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html index 6fec0b8aed..65909b7068 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html +++ b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html @@ -10,19 +10,19 @@ <table class="table1"> <thead> <tr> - <th>{L_LOGIN_KEY}</th> - <th>{L_IP}</th> - <th>{L_LOGIN_TIME}</th> - <th class="mark">{L_MARK}</th> + <th class="name">{L_LOGIN_KEY}</th> + <th class="center">{L_IP}</th> + <th class="center">{L_LOGIN_TIME}</th> + <th class="center mark">{L_MARK}</th> </tr> </thead> <tbody> <!-- BEGIN sessions --> <!-- IF sessions.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF --> <td><label for="{sessions.KEY}">{sessions.KEY}</label></td> - <td style="text-align: center">{sessions.IP}</td> - <td style="text-align: center">{sessions.LOGIN_TIME}</td> - <td style="text-align: center" class="mark"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}" /></td> + <td class="center">{sessions.IP}</td> + <td class="center">{sessions.LOGIN_TIME}</td> + <td class="center mark"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}" /></td> </tr> <!-- BEGINELSE --> <tr><td colspan="4" class="bg1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td></tr> diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html index e8e2aedc14..69eda8c42c 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html +++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html @@ -10,6 +10,7 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> + <!-- EVENT ucp_profile_profile_info_before --> <!-- IF S_BIRTHDAYS_ENABLED --> <dl> <dt><label for="bday_day">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> @@ -34,6 +35,7 @@ <dd>{profile_fields.FIELD}</dd> </dl> <!-- END profile_fields --> + <!-- EVENT ucp_profile_profile_info_after --> </fieldset> </div> diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html index 4b26bc2e99..2642b7a419 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html +++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html @@ -12,6 +12,7 @@ <fieldset> <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> + <!-- EVENT ucp_profile_register_details_before --> <dl> <dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> <dd><!-- IF S_CHANGE_USERNAME --><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" title="{L_USERNAME}" /><!-- ELSE --><strong>{USERNAME}</strong><!-- ENDIF --></dd> @@ -30,6 +31,7 @@ <dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{PASSWORD_CONFIRM}" class="inputbox" title="{L_CONFIRM_PASSWORD}" /></dd> </dl> <!-- ENDIF --> + <!-- EVENT ucp_profile_register_details_after --> </fieldset> </div> </div> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 43e994f1f9..b1e9d1be2c 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -1,7 +1,7 @@ <!-- INCLUDE overall_header.html --> - +<!-- EVENT viewforum_forum_title_before --> <h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2> - +<!-- EVENT viewforum_forum_title_after --> <!-- IF FORUM_DESC or MODERATORS or U_MCP --> <div> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body --> @@ -50,7 +50,7 @@ <!-- ENDIF --> <!-- IF S_DISPLAY_SEARCHBOX --> - <div class="search-box"> + <div class="search-box" role="search"> <form method="get" id="forum-search" action="{S_SEARCHBOX_ACTION}"> <fieldset> <input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_FORUM}" /> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 3b2c0a9c65..e976c36f7b 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -42,7 +42,7 @@ <!-- INCLUDE viewtopic_topic_tools.html --> <!-- IF S_DISPLAY_SEARCHBOX --> - <div class="search-box"> + <div class="search-box" role="search"> <form method="get" id="topic-search" action="{S_SEARCHBOX_ACTION}"> <fieldset> <input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_TOPIC}" /> @@ -64,7 +64,7 @@ <!-- ENDIF --> </div> <!-- ENDIF --> - + <!-- EVENT viewtopic_body_pagination_top_after --> </div> <!-- IF S_HAS_POLL --> @@ -210,6 +210,7 @@ <h3 <!-- IF postrow.S_FIRST_ROW -->class="first"<!-- ENDIF -->><!-- IF postrow.POST_ICON_IMG --><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" /> <!-- ENDIF --><a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></h3> + <!-- EVENT viewtopic_body_post_buttons_list_before --> <!-- IF not S_IS_BOT --> <!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE --> <ul class="post-buttons"> @@ -248,6 +249,7 @@ </ul> <!-- ENDIF --> <!-- ENDIF --> + <!-- EVENT viewtopic_body_post_buttons_list_after --> <!-- EVENT viewtopic_body_postrow_post_details_before --> <p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><span class="responsive-hide">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> » </span>{postrow.POST_DATE} </p> diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 889110e3fc..f3468ebcf2 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -182,8 +182,7 @@ /* Misc layout styles ---------------------------------------- */ -/* column[1-2] styles are containers for two column layouts - Also see tweaks.css */ +/* column[1-2] styles are containers for two column layouts */ .rtl .column1 { float: right; clear: right; @@ -313,6 +312,13 @@ li.breadcrumbs span:first-child > a { padding-right: 19px; } +/* Notification mark read link */ +.rtl .dropdown-extended a.mark_read { + border-radius: 0 3px 3px 0; + left: 0; + right: auto; +} + .rtl a.top { float: left; } @@ -596,9 +602,6 @@ li.breadcrumbs span:first-child > a { /** * buttons.css */ -/* Rollover buttons - Based on: http://wellstyled.com/css-nopreload-rollovers.html -----------------------------------------*/ .rtl .dropdown-select { padding-left: 24px; padding-right: 8px; @@ -976,10 +979,6 @@ li.breadcrumbs span:first-child > a { padding-left: 0; } -/** -* tweaks.css -*/ - /* Form button styles ---------------------------------------- */ diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index d600e76b44..f9a520369e 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -1,13 +1,11 @@ /* Button Styles ---------------------------------------- */ -/* Rollover buttons - Based on: http://wellstyled.com/css-nopreload-rollovers.html -----------------------------------------*/ .button { cursor: pointer; display: inline-block; height: 18px; + line-height: 18px; font-size: 13px; white-space: nowrap; border: 1px solid transparent; diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 505b18288b..4743b4b39b 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -96,7 +96,9 @@ table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) { background-color: #e1ebf2; } -.bg3 { background-color: #cadceb; } +.bg3 { + background-color: #cadceb; +} .ucprowbg { background-color: #DCDEE2; @@ -164,9 +166,9 @@ dl.details dd { ---------------------------------------- */ .pagination li a { - color: #5C758C; background-color: #ECEDEE; border-color: #B4BAC0; + color: #5C758C; } .pagination li.ellipsis span { @@ -175,14 +177,14 @@ dl.details dd { } .pagination li.active span { - color: #FFFFFF; background-color: #4692BF; border-color: #4692BF; + color: #FFFFFF; } .pagination li a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { - border-color: #368AD2; background-color: #368AD2; + border-color: #368AD2; color: #FFFFFF; } @@ -263,13 +265,13 @@ a:hover { color: #D31141; } /* Post body links */ .postlink { - color: #368AD2; border-bottom-color: #368AD2; + color: #368AD2; } .postlink:visited { - color: #5D8FBD; border-bottom-color: #5D8FBD; + color: #5D8FBD; } .postlink:hover { @@ -656,7 +658,6 @@ Colours and backgrounds for buttons.css .icon-register { background-image: url("./images/icon_register.gif"); } .icon-search, .responsive-search a { background-image: url("./images/icon_search.gif"); } .icon-search-active { background-image: url("./images/subforum_read.gif"); } -.icon-search-advanced { background-image: url("./images/icon_search_adv.gif"); } .icon-search-new { background-image: url("./images/subforum_unread.gif"); } .icon-search-self { background-image: url("./images/icon_topic_latest.gif"); } .icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); } diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 9da24b6ef9..c0cc2bb2dd 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -53,9 +53,7 @@ html { } body { - /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ font-family: Verdana, Helvetica, Arial, sans-serif; - /*font-size: 62.5%; This sets the default font size to be equivalent to 10px */ font-size: 10px; line-height: normal; margin: 0; @@ -113,7 +111,6 @@ img { } hr { - /* Also see tweaks.css */ border: 0 solid transparent; border-top-width: 1px; height: 1px; @@ -671,6 +668,8 @@ table.table1 tbody th { /* Specific column styles */ table.table1 .name { text-align: left; } +table.table1 .center { text-align: center; } +table.table1 .reportby { width: 15%; } table.table1 .posts { text-align: center; width: 7%; } table.table1 .joined { text-align: left; width: 15%; } table.table1 .active { text-align: left; width: 15%; } @@ -711,8 +710,7 @@ table.info tbody th { /* Misc layout styles ---------------------------------------- */ -/* column[1-2] styles are containers for two column layouts - Also see tweaks.css */ +/* column[1-2] styles are containers for two column layouts */ .column1 { float: left; clear: left; diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index e73f8c9d54..380b285b83 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -259,7 +259,6 @@ dd.option { } .postbody h3 img { - /* Also see tweaks.css */ vertical-align: bottom; } @@ -510,7 +509,6 @@ blockquote .codebox { } .codebox code { - /* Also see tweaks.css */ overflow: auto; display: block; height: auto; @@ -693,7 +691,6 @@ fieldset.polls dd div { /* Poster profile block ----------------------------------------*/ .postprofile { - /* Also see tweaks.css */ margin: 5px 0 10px 0; min-height: 80px; border: 1px solid transparent; diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index 8f3f55ec87..5fe8de0840 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.3 -phpbb_version = 3.1.3 +style_version = 3.1.4 +phpbb_version = 3.1.4 # 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 c1609f0979..6c9b64827a 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -56,7 +56,7 @@ <!-- EVENT forumlist_body_subforums_before --> <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 --> + <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_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 --> </p> <!-- EVENT forumlist_body_subforums_after --> diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html index ecfb4b69c5..d412a6a64b 100644 --- a/phpBB/styles/subsilver2/template/memberlist_body.html +++ b/phpBB/styles/subsilver2/template/memberlist_body.html @@ -39,11 +39,10 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> <th nowrap="nowrap">#</th> - <th nowrap="nowrap" width="25%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th> + <th nowrap="nowrap" width="36%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th> <th nowrap="nowrap" width="15%"><a href="{U_SORT_JOINED}">{L_JOINED}</a></th> <th nowrap="nowrap" width="10%"><a href="{U_SORT_POSTS}">{L_POSTS}</a></th> <th nowrap="nowrap" width="15%"><a href="{U_SORT_RANK}">{L_RANK}</a></th> - <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th> <th nowrap="nowrap" width="11%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th> <!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><th width="2%" nowrap="nowrap">{L_MARK}</th><!-- ENDIF --> </tr> @@ -52,11 +51,11 @@ <!-- IF S_SHOW_GROUP --> <!-- IF memberrow.S_FIRST_ROW and memberrow.S_GROUP_LEADER --> <tr class="row3"> - <td colspan="8"><b class="gensmall">{L_GROUP_LEADER}</b></td> + <td colspan="7"><b class="gensmall">{L_GROUP_LEADER}</b></td> </tr> <!-- ELSEIF not memberrow.S_GROUP_LEADER and not $S_MEMBER_HEADER --> <tr class="row3"> - <td colspan="8"><b class="gensmall">{L_GROUP_MEMBERS}</b></td> + <td colspan="7"><b class="gensmall">{L_GROUP_MEMBERS}</b></td> </tr> <!-- DEFINE $S_MEMBER_HEADER = 1 --> <!-- ENDIF --> @@ -69,7 +68,6 @@ <td class="genmed" align="center" nowrap="nowrap"> {memberrow.JOINED} </td> <td class="gen" align="center">{memberrow.POSTS}</td> <td class="gen" align="center"><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --></td> - <td class="gen" align="center"> <!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --> </td> <td class="gen" align="center"> <!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF --> </td> <!-- IF memberrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> @@ -81,7 +79,7 @@ <!-- BEGINELSE --> <tr> - <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"> + <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center"> <span class="gen"><!-- IF S_SHOW_GROUP -->{L_NO_GROUP_MEMBERS}<!-- ELSE -->{L_NO_MEMBERS}<!-- ENDIF --></span> </td> </tr> @@ -89,7 +87,7 @@ <!-- END memberrow --> <tr> - <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> + <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> </tr> </table> {S_FORM_TOKEN} diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 225a7d85ff..f3693eb865 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -152,7 +152,7 @@ function marklist(id, name, state) </tr> </table> </div> - + <!-- EVENT overall_header_navbar_before --> <div id="menubar"> <table width="100%" cellspacing="0"> <tr> diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index 321e4227ee..815d8c4a99 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -171,6 +171,7 @@ <!-- EVENT posting_editor_subject_after --> <tr> <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}{L_COLON}</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN} </span><br /><br /> + <!-- EVENT posting_editor_smilies_before --> <!-- IF S_SMILIES_ALLOWED --> <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center"> <tr> @@ -192,6 +193,7 @@ </table> <!-- ENDIF --> + <!-- EVENT posting_editor_smilies_after --> </td> <td class="row2" valign="top"> <script type="text/javascript"> @@ -246,6 +248,7 @@ </tr> </table> </td> + <!-- EVENT posting_editor_bbcode_status_after --> <td class="row2"> <table cellpadding="1"> <!-- EVENT posting_editor_options_prepend --> diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html index 8d98b36c86..07cb6d527e 100644 --- a/phpBB/styles/subsilver2/template/posting_poll_body.html +++ b/phpBB/styles/subsilver2/template/posting_poll_body.html @@ -27,6 +27,7 @@ <td class="row2"><input type="checkbox" class="radio" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /></td> </tr> <!-- ENDIF --> +<!-- EVENT posting_poll_body_options_after --> <!-- IF S_POLL_DELETE --> <tr> diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html index 23d0b3a146..6f651b2618 100644 --- a/phpBB/styles/subsilver2/template/search_results.html +++ b/phpBB/styles/subsilver2/template/search_results.html @@ -1,5 +1,7 @@ <!-- INCLUDE overall_header.html --> +<!-- EVENT search_results_header_before --> + <form method="post" action="{S_SEARCH_ACTION}"> <table width="100%" cellspacing="1"> @@ -8,10 +10,12 @@ </tr> <tr> <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}{L_COLON} <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}{L_COLON} <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}{L_COLON} <b>{IGNORED_WORDS}</b><!-- ENDIF --></td> - <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td> + <td align="{S_CONTENT_FLOW_END}"><!-- EVENT search_results_searchbox_after --><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td> </tr> </table> +<!-- EVENT search_results_header_after --> + <br clear="all" /> <!-- IF S_SHOW_TOPICS --> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html index 3f63319b59..087ae89743 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html @@ -16,9 +16,9 @@ </tr> <tr> <th>{L_LOGIN_KEY}</th> - <th>{L_IP}</th> - <th>{L_LOGIN_TIME}</th> - <th>{L_MARK}</th> + <th class="center">{L_IP}</th> + <th class="center">{L_LOGIN_TIME}</th> + <th class="center">{L_MARK}</th> </tr> <!-- BEGIN sessions --> <!-- IF sessions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html index 2d0140a15d..bfc2dd0244 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html @@ -12,6 +12,7 @@ <tr> <td class="row1" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td> </tr> +<!-- EVENT ucp_profile_profile_info_before --> <!-- IF S_JABBER_ENABLED --> <tr> <td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}{L_COLON} </b></td> @@ -34,6 +35,7 @@ <td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td> </tr> <!-- END profile_fields --> +<!-- EVENT ucp_profile_profile_info_after --> <tr> <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td> </tr> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html index d8fe84bf79..090d729326 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html @@ -14,6 +14,7 @@ <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td> </tr> <!-- ENDIF --> +<!-- EVENT ucp_profile_register_details_before --> <tr> <td class="row1" width="35%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td> <td class="row2"><!-- IF S_CHANGE_USERNAME --><input type="text" class="post" name="username" size="30" value="{USERNAME}" /><!-- ELSE --><b class="gen">{USERNAME}</b><!-- ENDIF --></td> @@ -32,6 +33,7 @@ <td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" /></td> </tr> <!-- ENDIF --> +<!-- EVENT ucp_profile_register_details_after --> <tr> <th colspan="2">{L_CONFIRM_CHANGES}</th> </tr> diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index 925581ffcd..906fdd7c63 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -103,8 +103,9 @@ <!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS --> <div id="pageheader"> + <!-- EVENT viewforum_forum_title_before --> <h2><!-- EVENT viewforum_forum_name_prepend --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2> - + <!-- EVENT viewforum_forum_title_after --> <!-- IF MODERATORS --> <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> <!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index ff39515876..721aa5cb01 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -44,7 +44,7 @@ <!-- IF TOTAL_POSTS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_POSTS} ] </td> - <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> + <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --><!-- EVENT viewtopic_body_pagination_top_after --></td> <!-- ENDIF --> </tr> </table> diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 3c7ff23db5..7764020567 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -322,6 +322,10 @@ th { padding: 7px 5px; } +th.center { + text-align: center; +} + td { padding: 2px; } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 92ac9171cb..cd55114bad 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -391,15 +391,29 @@ $sql_array = array( /** * Event to modify the SQL query before the topic data is retrieved * +* It may also be used to override the above assigned template vars +* * @event core.viewforum_get_topic_data * @var array forum_data Array with forum data * @var array sql_array The SQL array to get the data of all topics +* @var array forum_id The forum_id whose topics are being listed +* @var array topics_count The total number of topics for display +* @var array sort_days The oldest topic displayable in elapsed days +* @var array sort_key The sorting by. It is one of the first character of (in low case): +* Author, Post time, Replies, Subject, Views +* @var array sort_dir Either "a" for ascending or "d" for descending * @since 3.1.0-a1 * @change 3.1.0-RC4 Added forum_data var +* @change 3.1.4-RC1 Added forum_id, topics_count, sort_days, sort_key and sort_dir vars */ $vars = array( 'forum_data', 'sql_array', + 'forum_id', + 'topics_count', + 'sort_days', + 'sort_key', + 'sort_dir', ); extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars))); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 9589fb54e2..583e297682 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -86,10 +86,26 @@ if ($mode == 'whois' && $auth->acl_get('a_') && $session_id) } // Forum info -$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id - FROM ' . FORUMS_TABLE . ' - ORDER BY left_id ASC'; -$result = $db->sql_query($sql, 600); +$sql_ary = array( + 'SELECT' => 'f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id', + 'FROM' => array( + FORUMS_TABLE => 'f', + ), + 'ORDER_BY' => 'f.left_id ASC', +); + +/** +* Modify the forum data SQL query for getting additional fields if needed +* +* @event core.viewonline_modify_forum_data_sql +* @var array sql_ary The SQL array +* @since 3.1.5-RC1 +*/ +$vars = array('sql_ary'); +extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_forum_data_sql', compact($vars))); + +$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary), 600); +unset($sql_ary); $forum_data = array(); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 981941cea0..bb1f2c925d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -804,6 +804,36 @@ if (!empty($topic_data['poll_start'])) ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false; $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false; + /** + * Event to manipulate the poll data + * + * @event core.viewtopic_modify_poll_data + * @var array cur_voted_id Array with options' IDs current user has voted for + * @var int forum_id The topic's forum id + * @var array poll_info Array with the poll information + * @var bool s_can_vote Flag indicating if a user can vote + * @var bool s_display_results Flag indicating if results or poll options should be displayed + * @var int topic_id The id of the topic the user tries to access + * @var array topic_data All the information from the topic and forum tables for this topic + * @var string viewtopic_url URL to the topic page + * @var array vote_counts Array with the vote counts for every poll option + * @var array voted_id Array with updated options' IDs current user is voting for + * @since 3.1.5-RC1 + */ + $vars = array( + 'cur_voted_id', + 'forum_id', + 'poll_info', + 's_can_vote', + 's_display_results', + 'topic_id', + 'topic_data', + 'viewtopic_url', + 'vote_counts', + 'voted_id', + ); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_poll_data', compact($vars))); + if ($update && $s_can_vote) { @@ -937,6 +967,7 @@ if (!empty($topic_data['poll_start'])) $topic_data['poll_title'] = generate_text_for_display($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield'], $parse_flags, true); + $poll_template_data = $poll_options_template_data = array(); foreach ($poll_info as $poll_option) { $option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0; @@ -945,7 +976,7 @@ if (!empty($topic_data['poll_start'])) $option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100)); $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false; - $template->assign_block_vars('poll_option', array( + $poll_options_template_data[] = array( 'POLL_OPTION_ID' => $poll_option['poll_option_id'], 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'], 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'], @@ -955,12 +986,12 @@ if (!empty($topic_data['poll_start'])) 'POLL_OPTION_WIDTH' => round($option_pct * 250), 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false, 'POLL_OPTION_MOST_VOTES' => $option_most_votes, - )); + ); } $poll_end = $topic_data['poll_length'] + $topic_data['poll_start']; - $template->assign_vars(array( + $poll_template_data = array( 'POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'), @@ -976,9 +1007,45 @@ if (!empty($topic_data['poll_start'])) 'S_POLL_ACTION' => $viewtopic_url, 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll', - )); + ); - unset($poll_end, $poll_info, $voted_id); + /** + * Event to add/modify poll template data + * + * @event core.viewtopic_modify_poll_template_data + * @var array cur_voted_id Array with options' IDs current user has voted for + * @var int poll_end The poll end time + * @var array poll_info Array with the poll information + * @var array poll_options_template_data Array with the poll options template data + * @var array poll_template_data Array with the common poll template data + * @var int poll_total Total poll votes count + * @var int poll_most Mostly voted option votes count + * @var array topic_data All the information from the topic and forum tables for this topic + * @var string viewtopic_url URL to the topic page + * @var array vote_counts Array with the vote counts for every poll option + * @var array voted_id Array with updated options' IDs current user is voting for + * @since 3.1.5-RC1 + */ + $vars = array( + 'cur_voted_id', + 'poll_end', + 'poll_info', + 'poll_options_template_data', + 'poll_template_data', + 'poll_total', + 'poll_most', + 'topic_data', + 'viewtopic_url', + 'vote_counts', + 'voted_id', + ); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_poll_template_data', compact($vars))); + + $template->assign_block_vars_array('poll_option', $poll_options_template_data); + + $template->assign_vars($poll_template_data); + + unset($poll_end, $poll_info, $poll_options_template_data, $poll_template_data, $voted_id); } // If the user is trying to reach the second half of the topic, fetch it starting from the end @@ -1015,7 +1082,6 @@ else // Container for user details, only process once $post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array(); $has_unapproved_attachments = $has_approved_attachments = $display_notice = false; -$bbcode_bitfield = ''; $i = $i_total = 0; // Go ahead and pull all data for this topic @@ -1181,15 +1247,6 @@ while ($row = $db->sql_fetchrow($result)) $rowset[$row['post_id']] = $rowset_data; - // Define the global bbcode bitfield, will be used to load bbcodes - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); - - // Is a signature attached? Are we going to display it? - if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs')) - { - $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['user_sig_bbcode_bitfield']); - } - // Cache various user specific data ... so we don't have to recompute // this each time the same user appears on this page if (!isset($user_cache[$poster_id])) @@ -1463,12 +1520,6 @@ if (sizeof($attach_list)) } } -// Instantiate BBCode if need be -if ($bbcode_bitfield !== '') -{ - $bbcode = new bbcode(base64_encode($bbcode_bitfield)); -} - // Get the list of users who can receive private messages $can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm'); $can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm']; diff --git a/phpBB/web.config b/phpBB/web.config index a73c328626..99a1fe6023 100644 --- a/phpBB/web.config +++ b/phpBB/web.config @@ -1,6 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> + <rewrite> + <rules> + <rule name="Extension Routes" stopProcessing="true"> + <match url="^(.*)$" ignoreCase="true" /> + <conditions> + <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> + <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> + </conditions> + <action type="Rewrite" url="app.php" appendQueryString="true" /> + </rule> + </rules> + </rewrite> <security> <requestFiltering> <hiddenSegments> diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php new file mode 100644 index 0000000000..1f2f9f3070 --- /dev/null +++ b/tests/captcha/qa_test.php @@ -0,0 +1,94 @@ +<?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. + * + */ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_captcha_qa_test extends \phpbb_database_test_case +{ + protected $request; + + /** @var \phpbb\captcha\plugins\qa */ + protected $qa; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); + } + + public function setUp() + { + global $db; + + $db = $this->new_dbal(); + + parent::setUp(); + + $this->request = new \phpbb_mock_request(); + request_var(false, false, false, false, $this->request); + $this->qa = new \phpbb\captcha\plugins\qa('phpbb_captcha_questions', 'phpbb_captcha_answers', 'phpbb_qa_confirm'); + } + + public function test_is_installed() + { + $this->assertFalse($this->qa->is_installed()); + + $this->qa->install(); + + $this->assertTrue($this->qa->is_installed()); + } + + public function test_set_get_name() + { + $this->assertNull($this->qa->get_service_name()); + $this->qa->set_name('foobar'); + $this->assertSame('foobar', $this->qa->get_service_name()); + } + + public function data_acp_get_question_input() + { + return array( + array("foobar\ntest\nyes", array( + 'question_text' => '', + 'strict' => false, + 'lang_iso' => '', + 'answers' => array('foobar', 'test', 'yes') + )), + array("foobar\ntest\n \nyes", array( + 'question_text' => '', + 'strict' => false, + 'lang_iso' => '', + 'answers' => array( + 0 => 'foobar', + 1 => 'test', + 3 => 'yes', + ) + )), + array('', array( + 'question_text' => '', + 'strict' => false, + 'lang_iso' => '', + 'answers' => '', + )), + ); + } + + /** + * @dataProvider data_acp_get_question_input + */ + public function test_acp_get_question_input($value, $expected) + { + $this->request->overwrite('answers', $value); + + $this->assertEquals($expected, $this->qa->acp_get_question_input()); + } +} diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php index 6723e3bc52..ff1af8119b 100644 --- a/tests/controller/common_helper_route.php +++ b/tests/controller/common_helper_route.php @@ -51,6 +51,11 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case return '/app.php'; } + protected function get_base_uri() + { + return $this->get_uri(); + } + protected function get_script_name() { return 'app.php'; @@ -66,7 +71,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case $this->request = new phpbb_mock_request(); $this->request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER); $this->request->overwrite('SCRIPT_FILENAME', $this->get_script_name(), \phpbb\request\request_interface::SERVER); - $this->request->overwrite('REQUEST_URI', $this->get_uri(), \phpbb\request\request_interface::SERVER); + $this->request->overwrite('REQUEST_URI', $this->get_base_uri(), \phpbb\request\request_interface::SERVER); $this->request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER); $this->request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER); diff --git a/tests/controller/helper_route_slash_test.php b/tests/controller/helper_route_slash_test.php new file mode 100644 index 0000000000..3db5ec19e5 --- /dev/null +++ b/tests/controller/helper_route_slash_test.php @@ -0,0 +1,43 @@ +<?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. +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/common_helper_route.php'; + +class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_helper_route +{ + protected function get_phpbb_root_path() + { + return './../'; + } + + protected function get_uri() + { + return '/phpBB3/app.php'; + } + + protected function get_base_uri() + { + return '/phpBB3/'; + } + + protected function get_script_name() + { + return 'app.php'; + } + + protected function path_to_app() + { + return 'phpBB3/'; + } +} diff --git a/tests/functional/acp_attachments_test.php b/tests/functional/acp_attachments_test.php new file mode 100644 index 0000000000..8e810a508a --- /dev/null +++ b/tests/functional/acp_attachments_test.php @@ -0,0 +1,78 @@ +<?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. + * + */ + +/** + * @group functional + */ +class phpbb_functional_acp_attachments_test extends phpbb_functional_test_case +{ + public function data_imagick_path_linux() + { + return array( + array('/usr/bin', 'Configuration updated successfully'), + array('/usr/foobar', 'The entered path “/usr/foobar” does not exist.'), + array('/usr/bin/which', 'The entered path “/usr/bin/which” is not a directory.'), + ); + } + + /** + * @dataProvider data_imagick_path_linux + */ + public function test_imagick_path_linux($imagick_path, $expected) + { + if (strtolower(substr(PHP_OS, 0, 5)) !== 'linux') + { + $this->markTestSkipped('Unable to test linux specific paths on other OS.'); + } + + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?i=attachments&mode=attach&sid=' . $this->sid); + + $form = $crawler->selectButton('Submit')->form(array('config[img_imagick]' => $imagick_path)); + + $crawler = self::submit($form); + $this->assertContains($expected, $crawler->filter('#main')->text()); + } + + public function data_imagick_path_windows() + { + return array( + array('C:\Windows', 'Configuration updated successfully'), + array('C:\Windows\foobar1', 'The entered path “C:\Windows\foobar1” does not exist.'), + array('C:\Windows\explorer.exe', 'The entered path “C:\Windows\explorer.exe” is not a directory.'), + ); + } + + /** + * @dataProvider data_imagick_path_windows + */ + public function test_imagick_path_windows($imagick_path, $expected) + { + if (strtolower(substr(PHP_OS, 0, 3)) !== 'win') + { + $this->markTestSkipped('Unable to test windows specific paths on other OS.'); + } + + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?i=attachments&mode=attach&sid=' . $this->sid); + + $form = $crawler->selectButton('Submit')->form(array('config[img_imagick]' => $imagick_path)); + + $crawler = self::submit($form); + $this->assertContains($expected, $crawler->filter('#main')->text()); + } +} diff --git a/tests/functional/common_avatar_test_case.php b/tests/functional/common_avatar_test_case.php index 7278f23bcc..924eb1273c 100644 --- a/tests/functional/common_avatar_test_case.php +++ b/tests/functional/common_avatar_test_case.php @@ -62,7 +62,7 @@ abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional { if (is_array($value)) { - $form[$key]->$value[0]($value[1]); + $form[$key]->{$value[0]}($value[1]); } else { diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index 4e4995c21e..1e863210e6 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -66,6 +66,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_accessible() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', @@ -118,6 +123,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_softdeleted_post() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', @@ -180,6 +190,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case public function test_download_softdeleted_topic() { + if (!class_exists('finfo')) + { + $this->markTestSkipped('Unable to run test with fileinfo disabled'); + } + $this->load_ids(array( 'forums' => array( 'Download #1', diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index 794f0cde68..39efc99a35 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -42,6 +42,19 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_perm_from' => 2, )); $crawler = self::submit($form); + + // Create second user which does not have m_delete permission + $this->add_lang('acp/permissions'); + + $second_user = $this->create_user('no m_delete moderator'); + $this->add_user_group("GLOBAL_MODERATORS", 'no m_delete moderator', true); + + // Set m_delete to never + $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&user_id[0]=$second_user&type=m_&sid={$this->sid}"); + $form = $crawler->selectButton($this->lang('APPLY_PERMISSIONS'))->form(); + $data = array("setting[$second_user][0][m_delete]" => ACL_NEVER); + $form->setValues($data); + $crawler = self::submit($form); } public function test_create_post() @@ -98,6 +111,23 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_topics_softdeleted' => 0, 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'], ), 'after replying'); + + // Test creating another reply + $post3 = $this->create_post($this->data['forums']['Soft Delete #1'], $post['topic_id'], 'Re: Soft Delete Topic #1-#3', 'This is another test post posted by the testing framework.'); + $crawler = self::request('GET', "viewtopic.php?t={$post3['topic_id']}&sid={$this->sid}"); + + $this->assertContains('Re: Soft Delete Topic #1-#3', $crawler->filter('html')->text()); + $this->data['posts']['Re: Soft Delete Topic #1-#3'] = (int) $post3['post_id']; + + $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( + 'forum_posts_approved' => 3, + 'forum_posts_unapproved' => 0, + 'forum_posts_softdeleted' => 0, + 'forum_topics_approved' => 1, + 'forum_topics_unapproved' => 0, + 'forum_topics_softdeleted' => 0, + 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#3'], + ), 'after replying a second time'); } public function test_softdelete_post() @@ -114,21 +144,22 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3', ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( - 'forum_posts_approved' => 2, + 'forum_posts_approved' => 3, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 0, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, - 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'], + 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#3'], ), 'before softdelete'); $this->add_lang('posting'); - $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Soft Delete #1']}&p={$this->data['posts']['Re: Soft Delete Topic #1-#2']}&sid={$this->sid}"); + $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Soft Delete #1']}&p={$this->data['posts']['Re: Soft Delete Topic #1-#3']}&sid={$this->sid}"); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $form = $crawler->selectButton('Yes')->form(); @@ -136,19 +167,69 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('POST_DELETED', $crawler->text()); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( - 'forum_posts_approved' => 1, + 'forum_posts_approved' => 2, 'forum_posts_unapproved' => 0, 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, - 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'], + 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'], ), 'after softdelete'); $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); } + public function test_softdelete_post_no_m_delete() + { + $this->login('no m_delete moderator'); + $this->load_ids(array( + 'forums' => array( + 'Soft Delete #1', + 'Soft Delete #2', + ), + 'topics' => array( + 'Soft Delete Topic #1', + ), + 'posts' => array( + 'Soft Delete Topic #1', + 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3', + ), + )); + + $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( + 'forum_posts_approved' => 2, + 'forum_posts_unapproved' => 0, + 'forum_posts_softdeleted' => 1, + 'forum_topics_approved' => 1, + 'forum_topics_unapproved' => 0, + 'forum_topics_softdeleted' => 0, + 'forum_last_post_id' => $this->data['posts']['Re: Soft Delete Topic #1-#2'], + ), 'before softdelete without m_delete'); + + $this->add_lang('posting'); + $crawler = self::request('GET', "posting.php?mode=delete&f={$this->data['forums']['Soft Delete #1']}&p={$this->data['posts']['Re: Soft Delete Topic #1-#2']}&sid={$this->sid}"); + $this->assertNotContainsLang('DELETE_PERMANENTLY', $crawler->text()); + + $form = $crawler->selectButton('Yes')->form(); + $crawler = self::submit($form); + $this->assertContainsLang('POST_DELETED', $crawler->text()); + + $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( + 'forum_posts_approved' => 1, + 'forum_posts_unapproved' => 0, + 'forum_posts_softdeleted' => 2, + 'forum_topics_approved' => 1, + 'forum_topics_unapproved' => 0, + 'forum_topics_softdeleted' => 0, + 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'], + ), 'after softdelete without m_delete'); + + $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); + $this->assertContains($this->lang('POST_DISPLAY', '', ''), $crawler->text()); + } + public function test_move_softdeleted_post() { $this->login(); @@ -163,13 +244,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3', ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -212,7 +294,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -234,6 +316,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); @@ -250,7 +333,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -283,7 +366,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array( 'forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 2, + 'forum_posts_softdeleted' => 3, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -305,6 +388,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); @@ -321,7 +405,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array( 'forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 2, + 'forum_posts_softdeleted' => 3, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -344,7 +428,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 2, + 'forum_posts_softdeleted' => 3, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -376,13 +460,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 0, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 2, + 'forum_posts_softdeleted' => 3, 'forum_topics_approved' => 0, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -417,7 +502,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -449,13 +534,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -495,7 +581,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 0, + 'forum_posts_softdeleted' => 1, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -528,6 +614,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); @@ -539,7 +626,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -562,13 +649,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 1, @@ -603,7 +691,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -625,13 +713,14 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'posts' => array( 'Soft Delete Topic #1', 'Re: Soft Delete Topic #1-#2', + 'Re: Soft Delete Topic #1-#3' ), )); $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -660,7 +749,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, @@ -670,11 +759,11 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assert_forum_details($this->data['forums']['Soft Delete #2'], array( 'forum_posts_approved' => 1, 'forum_posts_unapproved' => 0, - 'forum_posts_softdeleted' => 1, + 'forum_posts_softdeleted' => 2, 'forum_topics_approved' => 1, 'forum_topics_unapproved' => 0, 'forum_topics_softdeleted' => 0, - 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'] + 2, + 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'] + 3, ), 'after forking #2'); } diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php new file mode 100644 index 0000000000..4c802d0487 --- /dev/null +++ b/tests/functions/make_clickable_email_test.php @@ -0,0 +1,222 @@ +<?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. +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; + +class phpbb_functions_make_clickable_email_test extends phpbb_test_case +{ + protected function setUp() + { + parent::setUp(); + + global $config, $user, $request; + $user = new phpbb_mock_user(); + $request = new phpbb_mock_request(); + } + + /** + * 'e' tag for email addresses html + **/ + public function data_test_make_clickable_email_positive() + { + return array( + array( + 'nobody@phpbb.com', + '<!-- e --><a href="mailto:nobody@phpbb.com">nobody@phpbb.com</a><!-- e -->' + ), + array( + 'Nobody@sub.phpbb.com', + '<!-- e --><a href="mailto:Nobody@sub.phpbb.com">Nobody@sub.phpbb.com</a><!-- e -->' + ), + array( + 'alice.bob@foo.phpbb.com', + '<!-- e --><a href="mailto:alice.bob@foo.phpbb.com">alice.bob@foo.phpbb.com</a><!-- e -->' + ), + array( + 'alice-foo@bar.phpbb.com', + '<!-- e --><a href="mailto:alice-foo@bar.phpbb.com">alice-foo@bar.phpbb.com</a><!-- e -->' + ), + array( + 'alice_foo@bar.phpbb.com', + '<!-- e --><a href="mailto:alice_foo@bar.phpbb.com">alice_foo@bar.phpbb.com</a><!-- e -->' + ), + array( + 'alice+tag@foo.phpbb.com', + '<!-- e --><a href="mailto:alice+tag@foo.phpbb.com">alice+tag@foo.phpbb.com</a><!-- e -->' + ), + array( + 'alice&tag@foo.phpbb.com', + '<!-- e --><a href="mailto:alice&tag@foo.phpbb.com">alice&tag@foo.phpbb.com</a><!-- e -->' + ), + array( + 'alice@phpbb.australia', + '<!-- e --><a href="mailto:alice@phpbb.australia">alice@phpbb.australia</a><!-- e -->' + ), + + // Test shortened text for email > 55 characters long + // Email text should be turned into: first 39 chars + ' ... ' + last 10 chars + array( + 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong', + '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->' + ), + array( + 'l3tt3rsAndNumb3rs@domain.com', + '<!-- e --><a href="mailto:l3tt3rsAndNumb3rs@domain.com">l3tt3rsAndNumb3rs@domain.com</a><!-- e -->' + ), + array( + 'has-dash@domain.com', + '<!-- e --><a href="mailto:has-dash@domain.com">has-dash@domain.com</a><!-- e -->' + ), + array( + 'hasApostrophe.o\'leary@domain.org', + '<!-- e --><a href="mailto:hasApostrophe.o\'leary@domain.org">hasApostrophe.o\'leary@domain.org</a><!-- e -->' + ), + array( + 'uncommonTLD@domain.museum', + '<!-- e --><a href="mailto:uncommonTLD@domain.museum">uncommonTLD@domain.museum</a><!-- e -->' + ), + array( + 'uncommonTLD@domain.travel', + '<!-- e --><a href="mailto:uncommonTLD@domain.travel">uncommonTLD@domain.travel</a><!-- e -->' + ), + array( + 'uncommonTLD@domain.mobi', + '<!-- e --><a href="mailto:uncommonTLD@domain.mobi">uncommonTLD@domain.mobi</a><!-- e -->' + ), + array( + 'countryCodeTLD@domain.uk', + '<!-- e --><a href="mailto:countryCodeTLD@domain.uk">countryCodeTLD@domain.uk</a><!-- e -->' + ), + array( + 'countryCodeTLD@domain.rw', + '<!-- e --><a href="mailto:countryCodeTLD@domain.rw">countryCodeTLD@domain.rw</a><!-- e -->' + ), + array( + 'numbersInDomain@911.com', + '<!-- e --><a href="mailto:numbersInDomain@911.com">numbersInDomain@911.com</a><!-- e -->' + ), + array( + 'underscore_inLocal@domain.net', + '<!-- e --><a href="mailto:underscore_inLocal@domain.net">underscore_inLocal@domain.net</a><!-- e -->' + ), + array( + 'IPInsteadOfDomain@127.0.0.1', + '<!-- e --><a href="mailto:IPInsteadOfDomain@127.0.0.1">IPInsteadOfDomain@127.0.0.1</a><!-- e -->' + ), + array( + 'IPAndPort@127.0.0.1:25', + '<!-- e --><a href="mailto:IPAndPort@127.0.0.1:25">IPAndPort@127.0.0.1:25</a><!-- e -->' + ), + array( + 'subdomain@sub.domain.com', + '<!-- e --><a href="mailto:subdomain@sub.domain.com">subdomain@sub.domain.com</a><!-- e -->' + ), + array( + 'local@dash-inDomain.com', + '<!-- e --><a href="mailto:local@dash-inDomain.com">local@dash-inDomain.com</a><!-- e -->' + ), + array( + 'dot.inLocal@foo.com', + '<!-- e --><a href="mailto:dot.inLocal@foo.com">dot.inLocal@foo.com</a><!-- e -->' + ), + array( + 'a@singleLetterLocal.org', + '<!-- e --><a href="mailto:a@singleLetterLocal.org">a@singleLetterLocal.org</a><!-- e -->' + ), + array( + 'singleLetterDomain@x.org', + '<!-- e --><a href="mailto:singleLetterDomain@x.org">singleLetterDomain@x.org</a><!-- e -->' + ), + array( + '&*=?^+{}\'~@validCharsInLocal.net', + '<!-- e --><a href="mailto:&*=?^+{}\'~@validCharsInLocal.net">&*=?^+{}\'~@validCharsInLocal.net</a><!-- e -->' + ), + array( + 'foor@bar.newTLD', + '<!-- e --><a href="mailto:foor@bar.newTLD">foor@bar.newTLD</a><!-- e -->' + ), + ); + } + + public function data_test_make_clickable_email_negative() + { + return array( + array('foo.example.com'), // @ is missing + array('.foo.example.com'), // . as first character + array('Foo.@example.com'), // . is last in local part + array('foo..123@example.com'), // . doubled + array('a@b@c@example.com'), // @ doubled + + // Emails with invalid characters + // (only 'valid' pieces having localparts prepended with one of the \n \t ( > chars should parsed if any) + array('()[]\;:,<>@example.com'), // invalid characters + array('abc(def@example.com', 'abc(<!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character ( + array('abc)def@example.com'), // invalid character ) + array('abc[def@example.com'), // invalid character [ + array('abc]def@example.com'), // invalid character ] + array('abc\def@example.com'), // invalid character \ + array('abc;def@example.com'), // invalid character ; + array('abc:def@example.com'), // invalid character : + array('abc,def@example.com'), // invalid character , + array('abc<def@example.com'), // invalid character < + array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character > + + // http://fightingforalostcause.net/misc/2006/compare-email-regex.php + array('missingDomain@.com'), + array('@missingLocal.org'), + array('missingatSign.net'), + array('missingDot@com'), + array('two@@signs.com'), + // Trailing colon is ignored + array('colonButNoPort@127.0.0.1:', '<!-- e --><a href="mailto:colonButNoPort@127.0.0.1">colonButNoPort@127.0.0.1</a><!-- e -->:'), + + array(''), + // Trailing part after the 3rd dot is ignored + array('someone-else@127.0.0.1.26', '<!-- e --><a href="mailto:someone-else@127.0.0.1">someone-else@127.0.0.1</a><!-- e -->.26'), + + array('.localStartsWithDot@domain.com'), + array('localEndsWithDot.@domain.com'), + array('two..consecutiveDots@domain.com'), + array('domainStartsWithDash@-domain.com'), + array('domainEndsWithDash@domain-.com'), + array('numbersInTLD@domain.c0m'), + array('missingTLD@domain.'), + array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'), + array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'), + array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'), + // The domain zone name part after the 63rd char is ignored + array( + 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlongZ', + '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->Z' + ), + ); + } + + /** + * @dataProvider data_test_make_clickable_email_positive + */ + public function test_email_matching_positive($email, $expected) + { + $this->assertSame($expected, make_clickable($email)); + } + + /** + * @dataProvider data_test_make_clickable_email_negative + */ + public function test_email_matching_negative($email, $expected = null) + { + $expected = ($expected) ?: $email; + $this->assertSame($expected, make_clickable($email)); + } +} diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php index 3c9af4a889..32738e4351 100644 --- a/tests/functions_acp/validate_config_vars_test.php +++ b/tests/functions_acp/validate_config_vars_test.php @@ -162,4 +162,100 @@ class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case $this->assertEquals($expected, $phpbb_error); } + + public function data_validate_path_linux() + { + return array( + array('/usr/bin', 'absolute_path', true), + array('/usr/bin/', 'absolute_path:50:200', true), + array('/usr/bin/which', 'absolute_path', 'DIRECTORY_NOT_DIR'), + array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + array('C:\Windows', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + array('.', 'absolute_path', true), + array('', 'absolute_path', true), + array('mkdir /foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + // Make sure above command didn't do anything + array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + ); + } + + /** + * @dataProvider data_validate_path_linux + */ + public function test_validate_path_linux($path, $validation_type, $expected) + { + if (strtolower(substr(PHP_OS, 0, 5)) !== 'linux') + { + $this->markTestSkipped('Unable to test linux specific paths on other OS.'); + } + + $error = array(); + $config_ary = array( + 'path' => $path, + ); + + validate_config_vars(array( + 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type), + ), + $config_ary, + $error + ); + + if ($expected === true) + { + $this->assertEmpty($error); + } + else + { + $this->assertEquals(array($expected), $error); + } + } + + public function data_validate_path_windows() + { + return array( + array('C:\Windows', 'absolute_path', true), + array('C:\Windows\\', 'absolute_path:50:200', true), + array('C:\Windows\explorer.exe', 'absolute_path', 'DIRECTORY_NOT_DIR'), + array('C:\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + array('/usr/bin', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + array('.', 'absolute_path', true), + array('', 'absolute_path', true), + array('mkdir C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + // Make sure above command didn't do anything + array('C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'), + ); + } + + /** + * @dataProvider data_validate_path_windows + */ + public function test_validate_path_windows($path, $validation_type, $expected) + { + if (strtolower(substr(PHP_OS, 0, 3)) !== 'win') + { + $this->markTestSkipped('Unable to test windows specific paths on other OS.'); + } + + $error = array(); + $config_ary = array( + 'path' => $path, + ); + + validate_config_vars(array( + 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type), + ), + $config_ary, + $error + ); + + if ($expected === true) + { + $this->assertEmpty($error); + } + else + { + $this->assertEquals(array($expected), $error); + } + } } diff --git a/tests/lint_test.php b/tests/lint_test.php index 9fb1c7624c..fb43196bae 100644 --- a/tests/lint_test.php +++ b/tests/lint_test.php @@ -38,31 +38,34 @@ class phpbb_lint_test extends phpbb_test_case self::markTestSkipped(sprintf('Could not run PHP_BINARY %s. Output: %s', self::$php_binary, $output)); } } - - self::$exclude = array( - dirname(__FILE__) . '/../.git', - dirname(__FILE__) . '/../build/new_version', - dirname(__FILE__) . '/../build/old_versions', - dirname(__FILE__) . '/../phpBB/cache', - // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20 - // https://gist.github.com/e003913ffd493da63cbc - dirname(__FILE__) . '/../phpBB/vendor', - ); } - public function test_lint() + /** + * @dataProvider lint_data + */ + public function test_lint($path) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { $this->markTestSkipped('phpBB uses PHP 5.3 syntax in some files, linting on PHP < 5.3 will fail'); } - $root = dirname(__FILE__) . '/..'; - $this->check($root); + $cmd = sprintf('(%s -l %s) 2>&1', self::$php_binary, escapeshellarg($path)); + $output = array(); + $status = 1; + exec($cmd, $output, $status); + $output = implode("\n", $output); + $this->assertEquals(0, $status, "PHP lint failed for $path:\n$output"); + } + + public function lint_data() + { + return $this->check(dirname(__FILE__) . '/..'); } protected function check($root) { + $files = array(); $dh = opendir($root); while (($filename = readdir($dh)) !== false) { @@ -76,19 +79,23 @@ class phpbb_lint_test extends phpbb_test_case { continue; } - if (is_dir($path) && !in_array($path, self::$exclude)) + if (is_dir($path) && !in_array($path, array( + dirname(__FILE__) . '/../.git', + dirname(__FILE__) . '/../build/new_version', + dirname(__FILE__) . '/../build/old_versions', + dirname(__FILE__) . '/../phpBB/cache', + // PHP Fatal error: Cannot declare class Container because the name is already in use in /var/www/projects/phpbb3/tests/../phpBB/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php on line 20 + // https://gist.github.com/e003913ffd493da63cbc + dirname(__FILE__) . '/../phpBB/vendor', + ))) { - $this->check($path); + $files = array_merge($files, $this->check($path)); } else if (substr($filename, strlen($filename)-4) == '.php') { - $cmd = sprintf('(%s -l %s) 2>&1', self::$php_binary, escapeshellarg($path)); - $output = array(); - $status = 1; - exec($cmd, $output, $status); - $output = implode("\n", $output); - $this->assertEquals(0, $status, "PHP lint failed for $path:\n$output"); + $files[] = array($path); } } + return $files; } } diff --git a/tests/plupload/plupload_test.php b/tests/plupload/plupload_test.php new file mode 100644 index 0000000000..2f47bf2b39 --- /dev/null +++ b/tests/plupload/plupload_test.php @@ -0,0 +1,53 @@ +<?php +/** + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +class phpbb_plupload_test extends phpbb_test_case +{ + public function generate_resize_string_data() + { + return array( + array( + 0, + 0, + '', + ), + array( + 130, + 150, + 'resize: {width: 130, height: 150, quality: 100},' + ), + ); + } + + /** + * @dataProvider generate_resize_string_data + */ + public function test_generate_resize_string($config_width, $config_height, $expected) + { + $config = new \phpbb\config\config(array( + 'img_max_width' => $config_width, + 'img_max_height' => $config_height, + 'upload_path' => 'files', + )); + $plupload = new \phpbb\plupload\plupload( + '', + $config, + new phpbb_mock_request, + new \phpbb\user('\phpbb\datetime'), + new \phpbb\php\ini, + new \phpbb\mimetype\guesser(array(new \phpbb\mimetype\extension_guesser)) + ); + + $this->assertEquals($expected, $plupload->generate_resize_string()); + } +} diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 21fb103ed1..a88fc63858 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -23,9 +23,9 @@ class phpbb_security_redirect_test extends phpbb_security_test_base { // array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false)) return array( - array('data://x', false, false, 'http://localhost/phpBB'), + array('data://x', false, 'INSECURE_REDIRECT', false), array('bad://localhost/phpBB/index.php', false, 'INSECURE_REDIRECT', false), - array('http://www.otherdomain.com/somescript.php', false, false, 'http://localhost/phpBB'), + array('http://www.otherdomain.com/somescript.php', false, 'INSECURE_REDIRECT', false), array("http://localhost/phpBB/memberlist.php\n\rConnection: close", false, 'INSECURE_REDIRECT', false), array('javascript:test', false, false, 'http://localhost/phpBB/javascript:test'), array('http://localhost/phpBB/index.php;url=', false, 'INSECURE_REDIRECT', false), @@ -51,6 +51,11 @@ class phpbb_security_redirect_test extends phpbb_security_test_base array('../index.php', false, false, 'http://localhost/index.php'), array('../index.php', true, false, 'http://localhost/index.php'), array('./index.php', false, false, 'http://localhost/phpBB/index.php'), + array('https://foobar.com\@http://localhost/phpBB', false, 'INSECURE_REDIRECT', false), + array('https://foobar.com\@localhost/troll/http://localhost/', false, 'INSECURE_REDIRECT', false), + array('http://localhost.foobar.com\@localhost/troll/http://localhost/', false, 'INSECURE_REDIRECT', false), + array('http://localhost/phpBB', false, false, 'http://localhost/phpBB'), + array('http://localhost/phpBB/', false, false, 'http://localhost/phpBB/'), ); } @@ -105,7 +110,7 @@ class phpbb_security_redirect_test extends phpbb_security_test_base if ($expected_error !== false) { - $this->setExpectedTriggerError(E_USER_ERROR, $expected_error); + $this->setExpectedTriggerError(E_USER_ERROR, $user->lang[$expected_error]); } $result = redirect($test, true, $disable_cd_check); diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index b6769f08d0..844caa8f54 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -410,6 +410,18 @@ class phpbb_functional_test_case extends phpbb_test_case $form = $crawler->selectButton('Enable')->form(); $crawler = self::submit($form); $this->add_lang('acp/extensions'); + + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (sizeof($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match); + $url = $match[1]; + $crawler = self::request('POST', $url); + $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]'); + } + $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('div.successbox')->text()); $this->logout(); diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index d8fa82e2b5..ed28bcb38f 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -213,6 +213,8 @@ class phpbb_filespec_test extends phpbb_test_case array('file.phpbb.gif', 'gif'), array('file..', ''), array('.file..jpg.webp', 'webp'), + array('/test.com/file', ''), + array('/test.com/file.gif', 'gif'), ); } @@ -266,6 +268,11 @@ class phpbb_filespec_test extends phpbb_test_case */ public function test_is_image_get_mimetype($filename, $mimetype, $expected) { + if (!class_exists('finfo') && strtolower(substr(PHP_OS, 0, 3)) === 'win') + { + $this->markTestSkipped('Unable to test mimetype guessing without fileinfo support on Windows'); + } + $filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype)); $filespec->get_mimetype($this->path . $filename); $this->assertEquals($expected, $filespec->is_image()); diff --git a/travis/check-image-icc-profiles.sh b/travis/check-image-icc-profiles.sh index bb070ccc27..5926962d40 100755 --- a/travis/check-image-icc-profiles.sh +++ b/travis/check-image-icc-profiles.sh @@ -15,6 +15,6 @@ TRAVIS_PHP_VERSION=$2 if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ] then - find . -type f -not -path './phpBB/vendor/*' -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' | \ + find . -type f -a -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' -a -not -wholename '*vendor/*' | \ parallel --gnu --keep-order 'phpBB/develop/strip_icc_profiles.sh {}' fi diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml index 4c963895fc..b12ae6fe8b 100644 --- a/travis/phpunit-mysqli-travis.xml +++ b/travis/phpunit-mysqli-travis.xml @@ -18,9 +18,6 @@ <exclude>../tests/lint_test.php</exclude> <exclude>../tests/ui</exclude> </testsuite> - <testsuite name="phpBB Lint Test"> - <file>../tests/lint_test.php</file> - </testsuite> <testsuite name="phpBB Functional Tests"> <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory> </testsuite> diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index ab045431cc..911ba12f3c 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -11,12 +11,6 @@ set -e set -x -if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] -then - # Add PPA providing dependencies for recent HHVM on Ubuntu 12.04. - sudo add-apt-repository -y ppa:mapnik/boost -fi - sudo apt-get update sudo apt-get install -y nginx realpath @@ -30,11 +24,9 @@ APP_SOCK=$(realpath "$DIR")/php-app.sock if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] then - # Upgrade to a recent stable version of HHVM - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y hhvm-nightly - HHVM_LOG=$(realpath "$DIR")/hhvm.log + sudo service hhvm stop sudo hhvm \ --mode daemon \ --user "$USER" \ |