aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2013-11-30 14:43:45 +0100
committerMaat <maat-pub@mageia.biz>2013-11-30 14:47:18 +0100
commit33193de3c84f52917ba5c340591cc2d97dc42ebb (patch)
tree4b6635e7e8e8b9e69a3e58689a6f9c1241dee8f3
parent41b19431251f19f607d192a555fdf1e57fb36643 (diff)
parent446ea9928d8373cf7695d3adda6d5ee30d5f94b4 (diff)
downloadforums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar
forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.gz
forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.bz2
forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.xz
forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.zip
Merge remote-tracking branch 'upstream/prep-release-3.0.12'
-rw-r--r--.gitignore2
-rw-r--r--.travis.yml16
-rw-r--r--README.md2
-rw-r--r--build/build.xml75
-rwxr-xr-xcomposer.pharbin0 -> 799883 bytes
-rwxr-xr-xgit-tools/hooks/pre-commit57
-rwxr-xr-xgit-tools/merge.php27
-rwxr-xr-xgit-tools/setup_github_network.php92
-rw-r--r--phpBB/adm/images/phpbb_logo.gifbin3883 -> 0 bytes
-rw-r--r--phpBB/adm/images/phpbb_logo.pngbin0 -> 9313 bytes
-rw-r--r--phpBB/adm/index.php9
-rw-r--r--phpBB/adm/style/acp_profile.html4
-rw-r--r--phpBB/adm/style/acp_users_overview.html3
-rw-r--r--phpBB/adm/style/admin.css6
-rw-r--r--phpBB/adm/style/install_footer.html2
-rw-r--r--phpBB/common.php7
-rw-r--r--phpBB/composer.json8
-rw-r--r--phpBB/composer.lock966
-rw-r--r--phpBB/develop/create_schema_files.php3
-rw-r--r--phpBB/develop/generate_utf_casefold.php2
-rw-r--r--phpBB/develop/generate_utf_confusables.php2
-rw-r--r--phpBB/develop/generate_utf_tables.php2
-rw-r--r--phpBB/develop/mysql_upgrader.php24
-rw-r--r--phpBB/develop/utf_normalizer_test.php2
-rw-r--r--phpBB/docs/AUTHORS21
-rw-r--r--phpBB/docs/CHANGELOG.html207
-rw-r--r--phpBB/docs/FAQ.html12
-rw-r--r--phpBB/docs/INSTALL.html161
-rw-r--r--phpBB/docs/README.html105
-rw-r--r--phpBB/docs/auth_api.html4
-rw-r--r--phpBB/docs/coding-guidelines.html8
-rw-r--r--phpBB/docs/hook_system.html2
-rw-r--r--phpBB/download/file.php41
-rw-r--r--phpBB/includes/acm/acm_apc.php2
-rw-r--r--phpBB/includes/acm/acm_eaccelerator.php4
-rw-r--r--phpBB/includes/acm/acm_memcache.php4
-rw-r--r--phpBB/includes/acm/acm_redis.php4
-rw-r--r--phpBB/includes/acm/acm_wincache.php2
-rw-r--r--phpBB/includes/acm/acm_xcache.php2
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php14
-rw-r--r--phpBB/includes/acp/acp_board.php4
-rw-r--r--phpBB/includes/acp/acp_captcha.php2
-rw-r--r--phpBB/includes/acp/acp_groups.php114
-rw-r--r--phpBB/includes/acp/acp_main.php4
-rw-r--r--phpBB/includes/acp/acp_profile.php6
-rw-r--r--phpBB/includes/acp/acp_send_statistics.php2
-rw-r--r--phpBB/includes/acp/acp_update.php2
-rw-r--r--phpBB/includes/captcha/captcha_non_gd.php2
-rw-r--r--phpBB/includes/constants.php3
-rw-r--r--phpBB/includes/db/db_tools.php16
-rw-r--r--phpBB/includes/db/dbal.php2
-rw-r--r--phpBB/includes/db/mssql.php66
-rw-r--r--phpBB/includes/db/mssql_odbc.php40
-rw-r--r--phpBB/includes/db/mssqlnative.php55
-rw-r--r--phpBB/includes/db/mysql.php45
-rw-r--r--phpBB/includes/db/mysqli.php32
-rw-r--r--phpBB/includes/db/oracle.php53
-rw-r--r--phpBB/includes/db/sqlite.php41
-rw-r--r--phpBB/includes/functions.php84
-rw-r--r--phpBB/includes/functions_admin.php21
-rw-r--r--phpBB/includes/functions_database_helper.php206
-rw-r--r--phpBB/includes/functions_install.php53
-rw-r--r--phpBB/includes/functions_jabber.php2
-rw-r--r--phpBB/includes/functions_messenger.php37
-rw-r--r--phpBB/includes/functions_posting.php40
-rw-r--r--phpBB/includes/functions_privmsgs.php205
-rw-r--r--phpBB/includes/functions_profile_fields.php42
-rw-r--r--phpBB/includes/functions_user.php29
-rw-r--r--phpBB/includes/mcp/mcp_forum.php15
-rw-r--r--phpBB/includes/mcp/mcp_main.php22
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php1
-rw-r--r--phpBB/includes/mcp/mcp_topic.php56
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php2
-rw-r--r--phpBB/includes/search/fulltext_mysql.php13
-rw-r--r--phpBB/includes/session.php7
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php2
-rw-r--r--phpBB/includes/ucp/ucp_activate.php2
-rw-r--r--phpBB/includes/ucp/ucp_groups.php8
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php16
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php17
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php32
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php4
-rw-r--r--phpBB/install/database_update.php212
-rw-r--r--phpBB/install/index.php2
-rw-r--r--phpBB/install/install_convert.php2
-rw-r--r--phpBB/install/install_install.php25
-rw-r--r--phpBB/install/install_update.php4
-rw-r--r--phpBB/install/schemas/firebird_schema.sql1
-rw-r--r--phpBB/install/schemas/mssql_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql1
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql1
-rw-r--r--phpBB/install/schemas/oracle_schema.sql1
-rw-r--r--phpBB/install/schemas/postgres_schema.sql1
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql1
-rw-r--r--phpBB/language/en/acp/board.php2
-rw-r--r--phpBB/language/en/acp/common.php4
-rw-r--r--phpBB/language/en/acp/permissions.php2
-rw-r--r--phpBB/language/en/acp/posting.php3
-rw-r--r--phpBB/language/en/acp/profile.php2
-rw-r--r--phpBB/language/en/acp/search.php2
-rw-r--r--phpBB/language/en/acp/users.php2
-rw-r--r--phpBB/language/en/common.php11
-rw-r--r--phpBB/language/en/email/forum_notify.txt2
-rw-r--r--phpBB/language/en/email/installed.txt2
-rw-r--r--phpBB/language/en/email/newtopic_notify.txt2
-rw-r--r--phpBB/language/en/email/topic_notify.txt2
-rw-r--r--phpBB/language/en/help_faq.php4
-rw-r--r--phpBB/language/en/install.php16
-rw-r--r--phpBB/language/en/posting.php6
-rw-r--r--phpBB/language/en/search.php1
-rw-r--r--phpBB/language/en/ucp.php7
-rw-r--r--phpBB/posting.php16
-rw-r--r--phpBB/report.php155
-rw-r--r--phpBB/search.php3
-rw-r--r--phpBB/styles/prosilver/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/prosilver/style.cfg2
-rw-r--r--phpBB/styles/prosilver/template/login_forum.html45
-rw-r--r--phpBB/styles/prosilver/template/mcp_front.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html8
-rw-r--r--phpBB/styles/prosilver/template/report_body.html4
-rw-r--r--phpBB/styles/prosilver/template/search_results.html1
-rw-r--r--phpBB/styles/prosilver/template/template.cfg2
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_manage.html19
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_membership.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html7
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html12
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_print.html2
-rw-r--r--phpBB/styles/prosilver/theme/stylesheet.css2
-rw-r--r--phpBB/styles/prosilver/theme/theme.cfg2
-rw-r--r--phpBB/styles/subsilver2/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/subsilver2/style.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/captcha_qa.html2
-rw-r--r--phpBB/styles/subsilver2/template/login_forum.html8
-rw-r--r--phpBB/styles/subsilver2/template/report_body.html8
-rw-r--r--phpBB/styles/subsilver2/template/simple_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/template.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html4
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_print.html2
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css2
-rw-r--r--phpBB/styles/subsilver2/theme/theme.cfg2
-rw-r--r--phpBB/ucp.php6
-rw-r--r--phpBB/viewtopic.php9
-rw-r--r--phpunit.xml.all4
-rw-r--r--phpunit.xml.dist4
-rw-r--r--phpunit.xml.functional4
-rw-r--r--tests/RUNNING_TESTS.md151
-rw-r--r--tests/RUNNING_TESTS.txt76
-rw-r--r--tests/bbcode/url_bbcode_test.php2
-rw-r--r--tests/bootstrap.php15
-rw-r--r--tests/compress/archive/.gitkeep0
-rw-r--r--tests/compress/compress_test.php173
-rw-r--r--tests/compress/extract/.gitkeep0
-rw-r--r--tests/compress/fixtures/1.txt1
-rw-r--r--tests/compress/fixtures/archive.tarbin0 -> 10240 bytes
-rw-r--r--tests/compress/fixtures/archive.tar.bz2bin0 -> 224 bytes
-rw-r--r--tests/compress/fixtures/archive.tar.gzbin0 -> 239 bytes
-rw-r--r--tests/compress/fixtures/archive.zipbin0 -> 412 bytes
-rw-r--r--tests/compress/fixtures/dir/2.txt1
-rw-r--r--tests/compress/fixtures/dir/3.txt1
-rw-r--r--tests/compress/fixtures/dir/subdir/4.txt1
-rw-r--r--tests/dbal/connect_test.php43
-rw-r--r--tests/dbal/order_lower_test.php9
-rw-r--r--tests/dbal/select_test.php16
-rw-r--r--tests/dbal/write_sequence_test.php55
-rw-r--r--tests/dbal/write_test.php4
-rw-r--r--tests/fixtures/empty.xml9
-rw-r--r--tests/functional/acp_groups_test.php21
-rw-r--r--tests/functional/auth_test.php14
-rw-r--r--tests/functional/browse_test.php6
-rw-r--r--tests/functional/common_groups_test.php93
-rw-r--r--tests/functional/forum_style_test.php45
-rw-r--r--tests/functional/mcp_test.php67
-rw-r--r--tests/functional/posting_test.php35
-rw-r--r--tests/functional/report_post_captcha_test.php66
-rw-r--r--tests/functional/ucp_groups_test.php21
-rw-r--r--tests/functions/clean_path_test.php44
-rw-r--r--tests/functions/fixtures/language_select.xml21
-rw-r--r--tests/functions/fixtures/obtain_online.xml121
-rw-r--r--tests/functions/fixtures/style_select.xml23
-rw-r--r--tests/functions/fixtures/validate_email.xml23
-rw-r--r--tests/functions/fixtures/validate_username.xml38
-rw-r--r--tests/functions/get_formatted_filesize_test.php71
-rw-r--r--tests/functions/get_remote_file_test.php75
-rw-r--r--tests/functions/is_absolute_test.php56
-rw-r--r--tests/functions/language_select_test.php39
-rw-r--r--tests/functions/obtain_online_test.php238
-rw-r--r--tests/functions/style_select_test.php41
-rw-r--r--tests/functions/validate_data_helper.php36
-rw-r--r--tests/functions/validate_date_test.php82
-rw-r--r--tests/functions/validate_email_test.php108
-rw-r--r--tests/functions/validate_hex_colour_test.php121
-rw-r--r--tests/functions/validate_jabber_test.php79
-rw-r--r--tests/functions/validate_lang_iso_test.php60
-rw-r--r--tests/functions/validate_match_test.php49
-rw-r--r--tests/functions/validate_num_test.php59
-rw-r--r--tests/functions/validate_password_test.php96
-rw-r--r--tests/functions/validate_string_test.php70
-rw-r--r--tests/functions/validate_username_test.php190
-rw-r--r--tests/functions_database_helper/fixtures/bookmarks_duplicates.xml47
-rw-r--r--tests/functions_database_helper/fixtures/topics_watch_duplicates.xml80
-rw-r--r--tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php101
-rw-r--r--tests/functions_database_helper/update_rows_avoiding_duplicates_test.php71
-rw-r--r--tests/lint_test.php74
-rw-r--r--tests/mock/cache.php27
-rw-r--r--tests/mock/null_cache.php42
-rw-r--r--tests/mock/user.php (renamed from tests/mock_user.php)13
-rw-r--r--tests/privmsgs/delete_user_pms_test.php102
-rw-r--r--tests/privmsgs/fixtures/delete_user_pms.xml215
-rw-r--r--tests/request/request_var_test.php2
-rw-r--r--tests/security/extract_current_page_test.php2
-rw-r--r--tests/security/hash_test.php8
-rw-r--r--tests/security/redirect_test.php2
-rw-r--r--tests/session/append_sid_test.php101
-rw-r--r--tests/session/creation_test.php (renamed from tests/session/init_test.php)7
-rw-r--r--tests/template/template_test.php49
-rw-r--r--tests/template/templates/include_define.html2
-rw-r--r--tests/template/templates/include_define_variable.html2
-rw-r--r--tests/template/templates/include_loop_define.html4
-rw-r--r--tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php37
-rw-r--r--tests/test_framework/phpbb_database_test_case.php88
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php302
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php646
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php4
-rw-r--r--tests/text_processing/censor_text_test.php2
-rw-r--r--tests/text_processing/make_clickable_test.php2
-rw-r--r--tests/utf/utf8_clean_string_test.php2
-rw-r--r--travis/phpunit-mysql-travis.xml4
-rw-r--r--travis/phpunit-postgres-travis.xml4
-rwxr-xr-xtravis/setup-webserver.sh54
-rw-r--r--vendor/goutte.pharbin267414 -> 0 bytes
236 files changed, 7694 insertions, 1061 deletions
diff --git a/.gitignore b/.gitignore
index 4093aeb56d..c757210654 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,7 @@
/phpunit.xml
/phpBB/cache/*.html
/phpBB/cache/*.php
-/phpBB/cache/queue.php.lock
+/phpBB/cache/*.lock
/phpBB/composer.phar
/phpBB/config.php
/phpBB/config_dev.php
diff --git a/.travis.yml b/.travis.yml
index 6a1ecedac4..5e2569dd22 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,21 +4,25 @@ php:
- 5.3.3
- 5.3
- 5.4
+ - 5.5
env:
- DB=mysql
- DB=postgres
before_script:
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi"
+ - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi"
- - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi"
- - phpenv rehash
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; phpenv rehash; fi"
+ - cd phpBB
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' ]; then php ../composer.phar install --dev --no-interaction --prefer-source; fi"
+ - cd ..
+ - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi"
script:
- - phpunit --configuration travis/phpunit-$DB-travis.xml
-
+ - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then phpunit --configuration travis/phpunit-$DB-travis.xml; else phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi"
+
notifications:
email:
recipients:
diff --git a/README.md b/README.md
index 51e65176c6..f6ef523e17 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![phpBB](http://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com)
+[![phpBB](https://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com)
## ABOUT
diff --git a/build/build.xml b/build/build.xml
index c1179015eb..ac656d79df 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,18 +2,17 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.0.11-RC1" />
- <property name="prevversion" value="3.0.10" />
- <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9" />
+ <property name="newversion" value="3.0.12" />
+ <property name="prevversion" value="3.0.11" />
+ <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10, 3.0.12-RC1, 3.0.12-RC2, 3.0.12-RC3" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
<property name="versions" value="${oldversions}, ${newversion}" />
<!-- These are the main targets which you will probably want to use -->
- <target name="package" depends="clean,prepare,create-package" />
- <target name="all" depends="clean,prepare,test,docs,create-package" />
- <target name="build" depends="clean,prepare,test,docs" />
+ <target name="all" depends="clean,prepare,composer,test,docs,package" />
+ <target name="build" depends="clean,prepare,composer,test,docs" />
<target name="prepare">
<mkdir dir="build/logs" />
@@ -43,17 +42,31 @@
<delete dir="build/save" />
</target>
- <target name="test" depends="clean,prepare">
+ <!--
+ This target basically just runs composer in the phpBB tree to ensure
+ all dependencies are loaded. Additional development dependencies are
+ loaded because testing framework may depend on them.
+ -->
+ <target name="composer">
+ <exec dir="phpBB"
+ command="php ../composer.phar install --dev"
+ checkreturn="true"
+ passthru="true" />
+ </target>
+
+ <target name="test" depends="clean,prepare,composer">
<exec dir="."
- command="phpunit --log-junit build/logs/phpunit.xml
+ command="phpBB/vendor/bin/phpunit
+ --log-junit build/logs/phpunit.xml
--coverage-clover build/logs/clover.xml
--coverage-html build/coverage"
passthru="true" />
</target>
- <target name="test-slow" depends="clean,prepare">
+ <target name="test-slow" depends="clean,prepare,composer">
<exec dir="."
- command="phpunit --log-junit build/logs/phpunit.xml
+ command="phpBB/vendor/bin/phpunit
+ --log-junit build/logs/phpunit.xml
--configuration phpunit.xml.all
--group slow
--coverage-clover build/logs/clover-slow.xml
@@ -116,7 +129,7 @@
</target>
- <target name="create-package" depends="prepare-new-version,old-version-diffs">
+ <target name="package" depends="clean,prepare,prepare-new-version,old-version-diffs">
<exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" />
<exec dir="build" command="php -f build_diff.php '${prevversion}' '${newversion}' > logs/build_diff.log" escape="false" />
@@ -155,6 +168,45 @@
<exec dir="phpBB"
command="git archive ${revision} | tar -xf - -C ../${dir}"
checkreturn="true" />
+
+ <!-- Install composer dependencies, if there are any. -->
+ <exec dir="."
+ command='php -r "\$j = json_decode(file_get_contents("composer.json")); echo isset(\$j->require);"'
+ checkreturn="true"
+ outputProperty='composer-has-dependencies' />
+ <if>
+ <equals arg1="${composer-has-dependencies}" arg2="1" trim="true" />
+ <then>
+ <!-- We have non-dev composer dependencies -->
+ <exec dir="."
+ command="git ls-tree ${revision} composer.phar"
+ checkreturn="true"
+ outputProperty='composer-ls-tree-output' />
+ <if>
+ <equals arg1="${composer-ls-tree-output}" arg2="" trim="true" />
+ <then>
+ <fail message="There are composer dependencies, but composer.phar is missing." />
+ </then>
+ <else>
+ <!-- Export the phar, install dependencies, delete phar. -->
+ <exec dir="."
+ command="git archive ${revision} composer.phar | tar -xf - -C ${dir}"
+ checkreturn="true" />
+ <exec dir="${dir}"
+ command="php composer.phar install"
+ checkreturn="true"
+ passthru="true" />
+ <delete file="${dir}/composer.phar" />
+ </else>
+ </if>
+ </then>
+ <else>
+ <!-- We do not have composer dependencies, do not ship composer files -->
+ <delete file="${dir}/composer.json" />
+ <delete file="${dir}/composer.lock" />
+ </else>
+ </if>
+
<delete file="${dir}/config.php" />
<delete dir="${dir}/develop" />
<delete dir="${dir}/install/data" />
@@ -176,6 +228,7 @@
<delete dir="${dir}/files" />
<delete dir="${dir}/install" />
<delete dir="${dir}/store" />
+ <delete dir="${dir}/vendor" />
</target>
</project>
diff --git a/composer.phar b/composer.phar
new file mode 100755
index 0000000000..a035fdc911
--- /dev/null
+++ b/composer.phar
Binary files differ
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 03babe47cd..06ba15c7fa 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -33,9 +33,7 @@ else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
-error=0
errors=""
-
if ! which "$PHP_BIN" >/dev/null 2>&1
then
echo "PHP Syntax check failed:"
@@ -73,63 +71,18 @@ do
# check the staged file content for syntax errors
# using php -l (lint)
- # note: if display_errors=stderr in php.ini,
- # parse errors are printed on stderr; otherwise
- # they are printed on stdout.
- # we filter everything other than parse errors
- # with a grep below, therefore it should be safe
- # to combine stdout and stderr in all circumstances
- result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>&1)
+ result=$(git cat-file -p $sha | "$PHP_BIN" -n -l -ddisplay_errors\=1 -derror_reporting\=E_ALL -dlog_errrors\=0 2>&1)
if [ $? -ne 0 ]
then
- error=1
# Swap back in correct filenames
- errors=$(echo "$errors"; echo "$result" |sed -e "s@in - on@in $filename on@g")
+ errors=$(echo "$errors"; echo "$result" | grep ':' | sed -e "s@in - on@in $filename on@g")
fi
done
unset IFS
-if [ $error -eq 1 ]
+if [ -n "$errors" ]
then
- echo "PHP Syntax check failed:"
- # php "display errors" (display_errors php.ini value)
- # and "log errors" (log_errors php.ini value).
- # these are independent settings - see main/main.c in php source.
- # the "log errors" setting produces output which
- # starts with "PHP Parse error:"; the "display errors"
- # setting produces output starting with "Parse error:".
- # if both are turned on php dumps the parse error twice.
- # therefore here we try to grep for one version and
- # if that yields no results grep for the other version.
- #
- # other fun php facts:
- #
- # 1. in cli, display_errors and log_errors have different
- # destinations by default. display_errors prints to
- # standard output and log_errors prints to standard error.
- # whether these destinations make sense is left
- # as an exercise for the reader.
- # 2. as mentioned above, with all output turned on
- # php will print parse errors twice, one time on stdout
- # and one time on stderr.
- # 3. it is possible to set both display_errors and log_errors
- # to off. if this is done php will print the text
- # "Errors parsing <file>" but will not say what
- # the errors are. useful behavior, this.
- # 4. on my system display_errors defaults to on and
- # log_errors defaults to off, therefore providing
- # by default one copy of messages. your mileage may vary.
- # 5. by setting display_errors=stderr and log_errors=on,
- # both sets of messages will be printed on stderr.
- # 6. php-cgi binary, given display_errors=stderr and
- # log_errors=on, still prints both sets of messages
- # on stderr, but formats one set as an html fragment.
- # 7. your entry here? ;)
- $echo_e "$errors" | grep "^Parse error:"
- if [ $? -ne 0 ]
- then
- # match failed
- $echo_e "$errors" | grep "^PHP Parse error:"
- fi
+ echo "PHP Syntax check failed: "
+ $echo_e "$errors"
exit 1
fi
diff --git a/git-tools/merge.php b/git-tools/merge.php
index 034bd2032c..f6142095fb 100755
--- a/git-tools/merge.php
+++ b/git-tools/merge.php
@@ -78,12 +78,12 @@ function work($pull_id, $remote)
add_remote($pull_user, 'phpbb3');
run("git fetch $pull_user");
run("git merge --no-ff $pull_user/$pull_branch");
- run("phpunit");
+ run("phpBB/vendor/bin/phpunit");
run("git checkout develop");
run("git pull $remote develop");
run("git merge --no-ff develop-olympus");
- run("phpunit");
+ run("phpBB/vendor/bin/phpunit");
break;
case 'develop':
@@ -93,7 +93,7 @@ function work($pull_id, $remote)
add_remote($pull_user, 'phpbb3');
run("git fetch $pull_user");
run("git merge --no-ff $pull_user/$pull_branch");
- run("phpunit");
+ run("phpBB/vendor/bin/phpunit");
break;
default:
@@ -124,19 +124,34 @@ function get_repository_url($username, $repository, $ssh = false)
function api_request($query)
{
- $contents = file_get_contents("http://github.com/api/v2/json/$query");
+ return api_url_request("https://api.github.com/$query?per_page=100");
+}
+
+function api_url_request($url)
+{
+ $contents = file_get_contents($url, false, stream_context_create(array(
+ 'http' => array(
+ 'header' => "User-Agent: phpBB/1.0\r\n",
+ ),
+ )));
if ($contents === false)
{
throw new RuntimeException("Error: failed to retrieve pull request data\n", 4);
}
+ $contents = json_decode($contents);
+
+ if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
+ {
+ throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
+ }
- return json_decode($contents);
+ return $contents;
}
function get_pull($username, $repository, $pull_id)
{
- $request = api_request("pulls/$username/$repository/$pull_id");
+ $request = api_request("repos/$username/$repository/pulls/$pull_id");
$pull = $request->pull;
diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php
index 5f2e1609a7..4e144edae6 100755
--- a/git-tools/setup_github_network.php
+++ b/git-tools/setup_github_network.php
@@ -15,14 +15,14 @@ function show_usage()
echo "$filename adds repositories of a github network as remotes to a local git repository.\n";
echo "\n";
- echo "Usage: [php] $filename -s collaborators|organisation|contributors|network [OPTIONS]\n";
+ echo "Usage: [php] $filename -s collaborators|organisation|contributors|forks [OPTIONS]\n";
echo "\n";
echo "Scopes:\n";
echo " collaborators Repositories of people who have push access to the specified repository\n";
echo " contributors Repositories of people who have contributed to the specified repository\n";
echo " organisation Repositories of members of the organisation at github\n";
- echo " network All repositories of the whole github network\n";
+ echo " forks All repositories of the whole github network\n";
echo "\n";
echo "Options:\n";
@@ -55,31 +55,31 @@ exit(work($scope, $username, $repository, $developer));
function work($scope, $username, $repository, $developer)
{
// Get some basic data
- $network = get_network($username, $repository);
+ $forks = get_forks($username, $repository);
$collaborators = get_collaborators($username, $repository);
- if ($network === false || $collaborators === false)
+ if ($forks === false || $collaborators === false)
{
- echo "Error: failed to retrieve network or collaborators\n";
+ echo "Error: failed to retrieve forks or collaborators\n";
return 1;
}
switch ($scope)
{
case 'collaborators':
- $remotes = array_intersect_key($network, $collaborators);
+ $remotes = array_intersect_key($forks, $collaborators);
break;
case 'organisation':
- $remotes = array_intersect_key($network, get_organisation_members($username));
+ $remotes = array_intersect_key($forks, get_organisation_members($username));
break;
case 'contributors':
- $remotes = array_intersect_key($network, get_contributors($username, $repository));
+ $remotes = array_intersect_key($forks, get_contributors($username, $repository));
break;
- case 'network':
- $remotes = $network;
+ case 'forks':
+ $remotes = $forks;
break;
default:
@@ -145,26 +145,66 @@ function get_repository_url($username, $repository, $ssh = false)
function api_request($query)
{
- $contents = file_get_contents("http://github.com/api/v2/json/$query");
+ return api_url_request("https://api.github.com/$query?per_page=100");
+}
+
+function api_url_request($url)
+{
+ $contents = file_get_contents($url, false, stream_context_create(array(
+ 'http' => array(
+ 'header' => "User-Agent: phpBB/1.0\r\n",
+ ),
+ )));
+
+ $sub_request_result = array();
+ // Check headers for pagination links
+ if (!empty($http_response_header))
+ {
+ foreach ($http_response_header as $header_element)
+ {
+ // Find Link Header which gives us a link to the next page
+ if (strpos($header_element, 'Link: ') === 0)
+ {
+ list($head, $header_content) = explode(': ', $header_element);
+ foreach (explode(', ', $header_content) as $links)
+ {
+ list($url, $rel) = explode('; ', $links);
+ if ($rel == 'rel="next"')
+ {
+ // Found a next link, follow it and merge the results
+ $sub_request_result = api_url_request(substr($url, 1, -1));
+ }
+ }
+ }
+ }
+ }
+
if ($contents === false)
{
return false;
}
- return json_decode($contents);
+ $contents = json_decode($contents);
+
+ if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0)
+ {
+ throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4);
+ }
+
+ return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents;
}
function get_contributors($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/contributors");
+ $request = api_request("repos/$username/$repository/stats/contributors");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->contributors as $contributor)
+ foreach ($request as $contribution)
{
- $usernames[$contributor->login] = $contributor->login;
+ $usernames[$contribution->author->login] = $contribution->author->login;
}
return $usernames;
@@ -172,14 +212,14 @@ function get_contributors($username, $repository)
function get_organisation_members($username)
{
- $request = api_request("organizations/$username/public_members");
+ $request = api_request("orgs/$username/public_members");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->users as $member)
+ foreach ($request as $member)
{
$usernames[$member->login] = $member->login;
}
@@ -189,35 +229,35 @@ function get_organisation_members($username)
function get_collaborators($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/collaborators");
+ $request = api_request("repos/$username/$repository/collaborators");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->collaborators as $collaborator)
+ foreach ($request as $collaborator)
{
- $usernames[$collaborator] = $collaborator;
+ $usernames[$collaborator->login] = $collaborator->login;
}
return $usernames;
}
-function get_network($username, $repository)
+function get_forks($username, $repository)
{
- $request = api_request("repos/show/$username/$repository/network");
+ $request = api_request("repos/$username/$repository/forks");
if ($request === false)
{
return false;
}
$usernames = array();
- foreach ($request->network as $network)
+ foreach ($request as $fork)
{
- $usernames[$network->owner] = array(
- 'username' => $network->owner,
- 'repository' => $network->name,
+ $usernames[$fork->owner->login] = array(
+ 'username' => $fork->owner->login,
+ 'repository' => $fork->name,
);
}
diff --git a/phpBB/adm/images/phpbb_logo.gif b/phpBB/adm/images/phpbb_logo.gif
deleted file mode 100644
index 239993182b..0000000000
--- a/phpBB/adm/images/phpbb_logo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/adm/images/phpbb_logo.png b/phpBB/adm/images/phpbb_logo.png
new file mode 100644
index 0000000000..c3f9248ed7
--- /dev/null
+++ b/phpBB/adm/images/phpbb_logo.png
Binary files differ
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 3c984f8290..85908476a1 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -199,7 +199,7 @@ function adm_page_footer($copyright_html = true)
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'S_COPYRIGHT_HTML' => $copyright_html,
- 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
+ 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
'VERSION' => $config['version'])
);
@@ -449,6 +449,13 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
}
break;
+ case 'email':
+ if (!preg_match('/^' . get_preg_expression('email') . '$/i', $cfg_array[$config_name]))
+ {
+ $error[] = $user->lang['EMAIL_INVALID_EMAIL'];
+ }
+ break;
+
// Absolute path
case 'script_path':
if (!$cfg_array[$config_name])
diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html
index 85d37568c2..1c9c038f8f 100644
--- a/phpBB/adm/style/acp_profile.html
+++ b/phpBB/adm/style/acp_profile.html
@@ -64,6 +64,10 @@
<dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
<dl>
+ <dt><label for="field_show_novalue">{L_SHOW_NOVALUE_FIELD}:</label><br /><span>{L_SHOW_NOVALUE_FIELD_EXPLAIN}</span></dt>
+ <dd><input type="checkbox" class="radio" id="field_show_novalue" name="field_show_novalue" value="1"<!-- IF S_FIELD_SHOW_NOVALUE --> checked="checked"<!-- ENDIF --> /></dd>
+ </dl>
+ <dl>
<dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><input type="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
</dl>
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index e2dcdb6307..ba350a13fb 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -142,10 +142,11 @@
<dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
<dd>
<!-- IF USER_HAS_POSTS -->
- <select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
+ <select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select>
<!-- ELSE -->
{L_USER_NO_POSTS_TO_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" />
<!-- ENDIF -->
+ </dd>
</dl>
<p class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 666f4921ba..b9996fd1d1 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -142,15 +142,15 @@ li {
#page-header {
clear: both;
text-align: right;
- background: url("../images/phpbb_logo.gif") top left no-repeat;
- height: 49px;
+ background: url("../images/phpbb_logo.png") top left no-repeat;
+ height: 54px;
font-size: 0.85em;
margin-bottom: 10px;
}
.rtl #page-header {
text-align: left;
- background: url("../images/phpbb_logo.gif") top right no-repeat;
+ background: url("../images/phpbb_logo.png") top right no-repeat;
}
#page-header h1 {
diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html
index 26a3c6ab3d..319f7e06c7 100644
--- a/phpBB/adm/style/install_footer.html
+++ b/phpBB/adm/style/install_footer.html
@@ -8,7 +8,7 @@
</div>
<div id="page-footer">
- Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
</div>
</div>
diff --git a/phpBB/common.php b/phpBB/common.php
index 491addc5e0..31ca746924 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -26,6 +26,8 @@ if (file_exists($phpbb_root_path . 'config.' . $phpEx))
if (!defined('PHPBB_INSTALLED'))
{
// Redirect the user to the installer
+ require($phpbb_root_path . 'includes/functions.' . $phpEx);
+
// We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
@@ -38,10 +40,13 @@ if (!defined('PHPBB_INSTALLED'))
$script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
}
+ // $phpbb_root_path accounts for redirects from e.g. /adm
+ $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx;
// Replace any number of consecutive backslashes and/or slashes with a single slash
// (could happen on some proxy setups and/or Windows servers)
- $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
+ // Eliminate . and .. from the path
+ $script_path = phpbb_clean_path($script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
diff --git a/phpBB/composer.json b/phpBB/composer.json
new file mode 100644
index 0000000000..9e73936322
--- /dev/null
+++ b/phpBB/composer.json
@@ -0,0 +1,8 @@
+{
+ "require-dev": {
+ "fabpot/goutte": "v0.1.0",
+ "phpunit/dbunit": "1.2.*",
+ "phpunit/phpunit": "3.7.*",
+ "phing/phing": "2.4.*"
+ }
+}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
new file mode 100644
index 0000000000..c7194c2fb5
--- /dev/null
+++ b/phpBB/composer.lock
@@ -0,0 +1,966 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+ ],
+ "hash": "ef6d05965cca4e390fff7ce63e9d2d49",
+ "packages": [
+
+ ],
+ "packages-dev": [
+ {
+ "name": "fabpot/goutte",
+ "version": "v0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fabpot/Goutte",
+ "reference": "v0.1.0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/fabpot/Goutte/archive/v0.1.0.zip",
+ "reference": "v0.1.0",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "guzzle/guzzle": "3.0.*",
+ "php": ">=5.3.0",
+ "symfony/browser-kit": "2.1.*",
+ "symfony/css-selector": "2.1.*",
+ "symfony/dom-crawler": "2.1.*",
+ "symfony/finder": "2.1.*",
+ "symfony/process": "2.1.*"
+ },
+ "type": "application",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Goutte": "."
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "A simple PHP Web Scraper",
+ "homepage": "https://github.com/fabpot/Goutte",
+ "keywords": [
+ "scraper"
+ ],
+ "time": "2012-12-02 13:44:35"
+ },
+ {
+ "name": "guzzle/guzzle",
+ "version": "v3.0.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/guzzle",
+ "reference": "v3.0.7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/guzzle/guzzle/archive/v3.0.7.zip",
+ "reference": "v3.0.7",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": ">=5.3.2",
+ "symfony/event-dispatcher": ">=2.1"
+ },
+ "replace": {
+ "guzzle/batch": "self.version",
+ "guzzle/cache": "self.version",
+ "guzzle/common": "self.version",
+ "guzzle/http": "self.version",
+ "guzzle/inflection": "self.version",
+ "guzzle/iterator": "self.version",
+ "guzzle/log": "self.version",
+ "guzzle/parser": "self.version",
+ "guzzle/plugin": "self.version",
+ "guzzle/plugin-async": "self.version",
+ "guzzle/plugin-backoff": "self.version",
+ "guzzle/plugin-cache": "self.version",
+ "guzzle/plugin-cookie": "self.version",
+ "guzzle/plugin-curlauth": "self.version",
+ "guzzle/plugin-history": "self.version",
+ "guzzle/plugin-log": "self.version",
+ "guzzle/plugin-md5": "self.version",
+ "guzzle/plugin-mock": "self.version",
+ "guzzle/plugin-oauth": "self.version",
+ "guzzle/service": "self.version",
+ "guzzle/stream": "self.version"
+ },
+ "require-dev": {
+ "doctrine/common": "*",
+ "monolog/monolog": "1.*",
+ "phpunit/phpunit": "3.7.*",
+ "symfony/class-loader": "*",
+ "zend/zend-cache1": "1.12",
+ "zend/zend-log1": "1.12",
+ "zendframework/zend-cache": "2.0.*",
+ "zendframework/zend-log": "2.0.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Guzzle\\Tests": "tests/",
+ "Guzzle": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "Guzzle Community",
+ "homepage": "https://github.com/guzzle/guzzle/contributors"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "time": "2012-12-19 23:06:35"
+ },
+ {
+ "name": "phing/phing",
+ "version": "2.4.14",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phingofficial/phing",
+ "reference": "2.4.14"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/phingofficial/phing/archive/2.4.14.zip",
+ "reference": "2.4.14",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "bin": [
+ "bin/phing"
+ ],
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "classes/phing/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "classes"
+ ],
+ "license": [
+ "LGPL3"
+ ],
+ "authors": [
+ {
+ "name": "Michiel Rook",
+ "email": "mrook@php.net"
+ },
+ {
+ "name": "Phing Community",
+ "homepage": "http://www.phing.info/trac/wiki/Development/Contributors"
+ }
+ ],
+ "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.",
+ "homepage": "http://www.phing.info/",
+ "keywords": [
+ "build",
+ "task",
+ "tool"
+ ],
+ "time": "2012-11-29 21:23:47"
+ },
+ {
+ "name": "phpunit/dbunit",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/dbunit.git",
+ "reference": "1.2.3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/1.2.3",
+ "reference": "1.2.3",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pdo": "*",
+ "ext-simplexml": "*",
+ "php": ">=5.3.3",
+ "phpunit/phpunit": ">=3.7.0@stable"
+ },
+ "bin": [
+ "dbunit.php"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHPUnit/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "",
+ "../../symfony/yaml/"
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "DbUnit port for PHP/PHPUnit to support database interaction testing.",
+ "homepage": "https://github.com/sebastianbergmann/dbunit/",
+ "keywords": [
+ "database",
+ "testing",
+ "xunit"
+ ],
+ "time": "2013-03-01 11:50:46"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "1.2.12",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "1.2.12"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.12",
+ "reference": "1.2.12",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-file-iterator": ">=1.3.0@stable",
+ "phpunit/php-text-template": ">=1.1.1@stable",
+ "phpunit/php-token-stream": ">=1.1.3@stable"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*@dev"
+ },
+ "suggest": {
+ "ext-dom": "*",
+ "ext-xdebug": ">=2.0.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2013-07-06 06:26:16"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.3.3",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "1.3.3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3",
+ "reference": "1.3.3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "File/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2012-10-11 04:44:38"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "1.1.4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4",
+ "reference": "1.1.4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "Text/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2012-10-31 11:15:28"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.4",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/sebastianbergmann/php-timer.git",
+ "reference": "1.0.4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4",
+ "reference": "1.0.4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2012-10-11 04:45:58"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "1.1.5",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "1.1.5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5",
+ "reference": "1.1.5",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHP/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2012-10-11 04:47:14"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "3.7.22",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "3.7.22"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.22",
+ "reference": "3.7.22",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=5.3.3",
+ "phpunit/php-code-coverage": "~1.2.1",
+ "phpunit/php-file-iterator": ">=1.3.1",
+ "phpunit/php-text-template": ">=1.1.1",
+ "phpunit/php-timer": "~1.0.2",
+ "phpunit/phpunit-mock-objects": "~1.2.0",
+ "symfony/yaml": "~2.0"
+ },
+ "require-dev": {
+ "pear-pear/pear": "1.9.4"
+ },
+ "suggest": {
+ "ext-json": "*",
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "phpunit/php-invoker": ">=1.1.0,<1.2.0"
+ },
+ "bin": [
+ "composer/bin/phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.7.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHPUnit/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "",
+ "../../symfony/yaml/"
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "http://www.phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2013-07-06 06:29:15"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "1.2.3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip",
+ "reference": "1.2.3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "phpunit/php-text-template": ">=1.1.1@stable"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "PHPUnit/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2013-01-13 10:24:48"
+ },
+ {
+ "name": "symfony/browser-kit",
+ "version": "v2.1.11",
+ "target-dir": "Symfony/Component/BrowserKit",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/BrowserKit.git",
+ "reference": "v2.1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/v2.1.11",
+ "reference": "v2.1.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/dom-crawler": "2.1.*"
+ },
+ "require-dev": {
+ "symfony/css-selector": "2.1.*",
+ "symfony/process": "2.1.*"
+ },
+ "suggest": {
+ "symfony/process": "2.1.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\BrowserKit": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony BrowserKit Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-04-29 20:22:06"
+ },
+ {
+ "name": "symfony/css-selector",
+ "version": "v2.1.11",
+ "target-dir": "Symfony/Component/CssSelector",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/CssSelector.git",
+ "reference": "v2.1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/CssSelector/zipball/v2.1.11",
+ "reference": "v2.1.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\CssSelector": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony CssSelector Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-17 00:31:34"
+ },
+ {
+ "name": "symfony/dom-crawler",
+ "version": "v2.1.11",
+ "target-dir": "Symfony/Component/DomCrawler",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/DomCrawler.git",
+ "reference": "v2.1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.1.11",
+ "reference": "v2.1.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/css-selector": "2.1.*"
+ },
+ "suggest": {
+ "symfony/css-selector": "2.1.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\DomCrawler": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony DomCrawler Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-16 00:06:15"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v2.3.1",
+ "target-dir": "Symfony/Component/EventDispatcher",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/EventDispatcher.git",
+ "reference": "v2.3.1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.1",
+ "reference": "v2.3.1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/dependency-injection": ">=2.0,<3.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-13 14:36:40"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v2.1.11",
+ "target-dir": "Symfony/Component/Finder",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Finder.git",
+ "reference": "v2.1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.1.11",
+ "reference": "v2.1.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Finder": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-25 15:47:15"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v2.1.11",
+ "target-dir": "Symfony/Component/Process",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Process.git",
+ "reference": "v2.1.11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/v2.1.11",
+ "reference": "v2.1.11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Process": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Process Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-06 10:21:56"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v2.3.1",
+ "target-dir": "Symfony/Component/Yaml",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Yaml.git",
+ "reference": "v2.3.1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.1",
+ "reference": "v2.3.1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Yaml\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "http://symfony.com",
+ "time": "2013-05-10 18:12:13"
+ }
+ ],
+ "aliases": [
+
+ ],
+ "minimum-stability": "stable",
+ "stability-flags": [
+
+ ],
+ "platform": [
+
+ ],
+ "platform-dev": [
+
+ ]
+}
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index d44efb8870..7b1fff40fb 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -237,7 +237,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '
foreach ($supported_dbms as $dbms)
{
- $fp = fopen($schema_path . $dbms . '_schema.sql', 'wt');
+ $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
$line = '';
@@ -1448,6 +1448,7 @@ function get_schema_struct()
'field_default_value' => array('VCHAR_UNI', ''),
'field_validation' => array('VCHAR_UNI:20', ''),
'field_required' => array('BOOL', 0),
+ 'field_show_novalue' => array('BOOL', 0),
'field_show_on_reg' => array('BOOL', 0),
'field_show_on_vt' => array('BOOL', 0),
'field_show_profile' => array('BOOL', 0),
diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php
index 73951cb4dc..08f67c3eb6 100644
--- a/phpBB/develop/generate_utf_casefold.php
+++ b/phpBB/develop/generate_utf_casefold.php
@@ -111,7 +111,7 @@ function my_var_export($var)
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
-* @return void
+* @return null
*/
function download($url)
{
diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php
index d2ffbcfc65..fd0439a4bb 100644
--- a/phpBB/develop/generate_utf_confusables.php
+++ b/phpBB/develop/generate_utf_confusables.php
@@ -199,7 +199,7 @@ function my_var_export($var)
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
-* @return void
+* @return null
*/
function download($url)
{
diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php
index 6fe5d68ffd..6372270b78 100644
--- a/phpBB/develop/generate_utf_tables.php
+++ b/phpBB/develop/generate_utf_tables.php
@@ -481,7 +481,7 @@ function my_var_export($var)
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
-* @return void
+* @return null
*/
function download($url)
{
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 05d279a099..dcf2f2c88b 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -149,7 +149,8 @@ foreach ($schema_data as $table_name => $table_data)
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
$column_type = sprintf($dbms_type_map['mysql_41'][$orig_column_type . ':'], $column_length);
- if (isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0]))
+ if (isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit']) &&
+ isset($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0]))
{
switch ($dbms_type_map['mysql_40'][$orig_column_type . ':']['limit'][0])
{
@@ -694,6 +695,24 @@ function get_schema_struct()
),
);
+ $schema_data['phpbb_login_attempts'] = array(
+ 'COLUMNS' => array(
+ 'attempt_ip' => array('VCHAR:40', ''),
+ 'attempt_browser' => array('VCHAR:150', ''),
+ 'attempt_forwarded_for' => array('VCHAR:255', ''),
+ 'attempt_time' => array('TIMESTAMP', 0),
+ 'user_id' => array('UINT', 0),
+ 'username' => array('VCHAR_UNI:255', 0),
+ 'username_clean' => array('VCHAR_CI', 0),
+ ),
+ 'KEYS' => array(
+ 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
+ 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
+ 'att_time' => array('INDEX', array('attempt_time')),
+ 'user_id' => array('INDEX', 'user_id'),
+ ),
+ );
+
$schema_data['phpbb_moderator_cache'] = array(
'COLUMNS' => array(
'forum_id' => array('UINT', 0),
@@ -897,6 +916,7 @@ function get_schema_struct()
'field_default_value' => array('VCHAR_UNI', ''),
'field_validation' => array('VCHAR_UNI:20', ''),
'field_required' => array('BOOL', 0),
+ 'field_show_novalue' => array('BOOL', 0),
'field_show_on_reg' => array('BOOL', 0),
'field_show_on_vt' => array('BOOL', 0),
'field_show_profile' => array('BOOL', 0),
@@ -1396,5 +1416,3 @@ function get_schema_struct()
return $schema_data;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php
index 71f24a716b..b8709888fe 100644
--- a/phpBB/develop/utf_normalizer_test.php
+++ b/phpBB/develop/utf_normalizer_test.php
@@ -222,7 +222,7 @@ die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
-* @return void
+* @return null
*/
function download($url)
{
diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS
index 446b204a08..5995bd2ab4 100644
--- a/phpBB/docs/AUTHORS
+++ b/phpBB/docs/AUTHORS
@@ -22,15 +22,11 @@ involved in phpBB.
phpBB Lead Developer: naderman (Nils Adermann)
-phpBB Developers: Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
- Arty (Vjacheslav Trushkin)
- bantu (Andreas Fischer)
+phpBB Developers: bantu (Andreas Fischer)
+ EXreaction (Nathan Guse)
+ dhruv.goel92 (Dhruv Goel)
imkingdavid (David King)
- igorw (Igor Wiedler)
nickvergessen (Joas Schilling)
- Oleg (Oleg Pudeyev)
- rxu (Ruslan Uzdenov)
- ToonArmy (Chris Smith)
Contributions by: leviatan21 (Gabriel Vazquez)
Raimon (Raimon Meuldijk)
@@ -39,13 +35,16 @@ Contributions by: leviatan21 (Gabriel Vazquez)
-- Former Contributors --
-phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
+phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
SHS` (Jonathan Stanley)
-phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005]
+phpBB Lead Developer: Acyd Burn (Meik Sievertsen) [09/2005 - 01/2010]
+ psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
+ Acyd Burn (Meik Sievertsen) [02/2003 - 09/2005]
APTX (Marek A. Ruszczyński) [12/2007 - 04/2011]
+ Arty (Vjacheslav Trushkin) [02/2012 - 07/2012]
Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
BartVB (Bart van Bragt) [11/2000 - 03/2006]
ckwalsh (Cullen Walsh) [01/2010 - 07/2011]
@@ -53,7 +52,11 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
dhn (Dominik Dröscher) [05/2007 - 01/2011]
GrahamJE (Graham Eames) [09/2005 - 11/2006]
kellanved (Henry Sudhof) [04/2007 - 03/2011]
+ igorw (Igor Wiedler) [08/2010 - 02/2013]
+ Oleg (Oleg Pudeyev) [01/2011 - 05/2013]
+ rxu (Ruslan Uzdenov) [04/2010 - 12/2012]
TerraFrost (Jim Wigginton) [04/2009 - 01/2011]
+ ToonArmy (Chris Smith) [06/2008 - 11/2011]
Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
-- Copyrights --
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 71e28be9bc..71795f83ac 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -53,6 +53,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
+ <li><a href="#v3011">Changes since 3.0.11</a></li>
<li><a href="#v3010">Changes since 3.0.10</a></li>
<li><a href="#v309">Changes since 3.0.9</a></li>
<li><a href="#v308">Changes since 3.0.8</a></li>
@@ -92,7 +93,162 @@
<div class="content">
- <a name="v3010"></a><h3>1.i. Changes since 3.0.10</h3>
+ <a name="v3011"></a><h3>1.i. Changes since 3.0.11</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6723">PHPBB3-6723</a>] - Empty message in deleted messages in PM history</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7262">PHPBB3-7262</a>] - Clarify docs about is_dynamic not being updated by set_config()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8319">PHPBB3-8319</a>] - LOCAL_URL not enforced in bbcodes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9551">PHPBB3-9551</a>] - Mysql fulltext index creation fails due to partial collation change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9975">PHPBB3-9975</a>] - Hard coded language in sessions.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10184">PHPBB3-10184</a>] - Bots can be sent private messages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10491">PHPBB3-10491</a>] - Fatal error in functional tests when server returns 404</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10568">PHPBB3-10568</a>] - Modify the trigger language when you edit a PM</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10602">PHPBB3-10602</a>] - A bug in mail queue processing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10661">PHPBB3-10661</a>] - UCP &gt; PM &gt; Compose &gt; enumerated recipients &gt; BCC group misses a &amp;nbsp; (prosilver)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10678">PHPBB3-10678</a>] - Provide Firebird, Oracle, and increased MSSQL support in unit tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10772">PHPBB3-10772</a>] - trigger_error is using the default style</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10789">PHPBB3-10789</a>] - PM print template (prosilver) with unnecessary variables</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10820">PHPBB3-10820</a>] - Display images directly in IE9 and 10 instead of download</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10828">PHPBB3-10828</a>] - PostgreSQL dbal tests try to connect to the database named as user specified in configuration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10838">PHPBB3-10838</a>] - Functional tests are not mentioned in RUNNING_TESTS.txt</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10840">PHPBB3-10840</a>] - If you add a member to a group, the form_token can be set to 0 if the creation_time is 0 too. Maybe even if creation_time is unchanged.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10848">PHPBB3-10848</a>] - Wrong redirect to installer from acp</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10850">PHPBB3-10850</a>] - create_schema_files.php is not creating the oracle or postgres' schema file properly</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10879">PHPBB3-10879</a>] - prosilver: attachment-link will be displayed wrong, when filename is too long </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10880">PHPBB3-10880</a>] - m_approve should not imply f_noapprove</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10896">PHPBB3-10896</a>] - board_email &amp; board_contact are not validated as email addresses in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10897">PHPBB3-10897</a>] - Bot Definitions are outdated</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10918">PHPBB3-10918</a>] - docs/INSTALL.html claims there are tar.gz packages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10943">PHPBB3-10943</a>] - Search Box should display keywords entered by the user</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10967">PHPBB3-10967</a>] - PHPBB_USE_BOARD_URL_PATH not implemented in posting_gen_topic_icons</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10986">PHPBB3-10986</a>] - Invalid email message ids because config variable server_name is used even when force server URL settings is disabled</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10995">PHPBB3-10995</a>] - Return value of $db-&gt;sql_fetchrow() on empty tables is not consistent on mssqlnative</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10996">PHPBB3-10996</a>] - Travis tests fail on Postgres because database does not exist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11034">PHPBB3-11034</a>] - The functional test case framework does not install a full board each time</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11066">PHPBB3-11066</a>] - MSSQLnative driver contains debug code error_reporting(E_ALL)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11069">PHPBB3-11069</a>] - missing closing span in subsilver2 simple_footer.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11081">PHPBB3-11081</a>] - Duplicated /TD in styles/subsilver2/template/catpcha_qa.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11093">PHPBB3-11093</a>] - acp_users_overview.html has a wrongly placed &lt;/dd&gt;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11094">PHPBB3-11094</a>] - prosilver: searching for users: no textbox for Jabber</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11105">PHPBB3-11105</a>] - Missing mandatory space in meta http-equiv=refresh</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11112">PHPBB3-11112</a>] - phpBB Footer Link should be SSL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11122">PHPBB3-11122</a>] - Update docs/AUTHORS for 3.0.12-RC1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11144">PHPBB3-11144</a>] - {FORUM_NAME} is not filled in login mask when logging into a password protected forum</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11145">PHPBB3-11145</a>] - ATTACHED_IMAGE_NOT_IMAGE thrown because of file limit in php.ini</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11158">PHPBB3-11158</a>] - modules table lacks acl_u_sig for signature module</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11159">PHPBB3-11159</a>] - Coding guidelines: static public</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11164">PHPBB3-11164</a>] - Composer not finding symfony/config in PHP 5.3.3</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11178">PHPBB3-11178</a>] - database_update.php should not set error_reporting to E_ALL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11186">PHPBB3-11186</a>] - Database unit tests fail on windows using sqlite2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11190">PHPBB3-11190</a>] - Functional tests do not clear the cache between each test</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11196">PHPBB3-11196</a>] - /includes/session.php sends 401 HTTP status with &quot;Not authorized&quot; instead of &quot;Unauthorized&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11219">PHPBB3-11219</a>] - Database sequences are not updated for tests using fixtures with auto_incremented columns</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11227">PHPBB3-11227</a>] - @return void -&gt; @return null</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11233">PHPBB3-11233</a>] - Anonymous can be selected as a PM recipient</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11248">PHPBB3-11248</a>] - CRLF line endings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11262">PHPBB3-11262</a>] - .lock files are not in .gitignore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11265">PHPBB3-11265</a>] - Functional tests do not assert that board installation succeeded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11269">PHPBB3-11269</a>] - Travis functional test case errors</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11278">PHPBB3-11278</a>] - Firebird tables are not removed correctly on 3.0.9-rc1 update</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11291">PHPBB3-11291</a>] - &quot;Could not open input file: ../composer.phar&quot; error during phing's create-package</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11292">PHPBB3-11292</a>] - Newlines removed in display of PM reports, no clickable links in PM reports</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11301">PHPBB3-11301</a>] - &quot;String offset cast occured&quot; error on PHP 5.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11304">PHPBB3-11304</a>] - check_form_key breaks in tests when form is submitted in the same second it is retrieved</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11343">PHPBB3-11343</a>] - Loose string comparison during new password activation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11355">PHPBB3-11355</a>] - Incorrect error message when no user selected for action on group membership management page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11358">PHPBB3-11358</a>] - Success message even withot selecting a user and performing a group operation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11361">PHPBB3-11361</a>] - &quot;Array to string conversion&quot; error in $user-&gt;format_date()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11493">PHPBB3-11493</a>] - Functional tests should fail if any debug output is made</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11517">PHPBB3-11517</a>] - Numbering is wrong in coding guidelines</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11536">PHPBB3-11536</a>] - Installer incorrectly removes /install from script_path</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11537">PHPBB3-11537</a>] - UCP group manage page's error box differs heavily from the rest of the UCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11538">PHPBB3-11538</a>] - SQL error on UCP groups manage page caused by setting color to 7 characters long string</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11544">PHPBB3-11544</a>] - Add admin_login() to 3.0 functional test case</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11545">PHPBB3-11545</a>] - is_absolute() should not depend on DIRECTORY_SEPARATOR</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11546">PHPBB3-11546</a>] - is_absolute() throws E_NOTICE for empty string</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11547">PHPBB3-11547</a>] - Test fixtures do not support utf8 characters</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11548">PHPBB3-11548</a>] - Untranslated TOO_SHORT in UCP &quot;Manage Groups&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11566">PHPBB3-11566</a>] - Reporting a post should require a captcha to be solved by guests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11568">PHPBB3-11568</a>] - Functional tests fail with retrieving install pages using file_get_contents</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11575">PHPBB3-11575</a>] - phpbb_dbal_order_lower_test::test_cross_join should be called test_order_lower</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11578">PHPBB3-11578</a>] - Missing underscore after function prefix in validate_data()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11579">PHPBB3-11579</a>] - Add unit tests for validate_data()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11580">PHPBB3-11580</a>] - Avoid API Limit from composer downloads on github</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11588">PHPBB3-11588</a>] - install/install_update.php should use version.phpbb.com instead of www</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11590">PHPBB3-11590</a>] - Close database connections from tests whenever possible</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11601">PHPBB3-11601</a>] - Allow manual resync of database columns in unit tests not only on fixture load</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11603">PHPBB3-11603</a>] - git-tools use invalid api urls</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11604">PHPBB3-11604</a>] - Functional tests fail when phpBB can not create the config file</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11617">PHPBB3-11617</a>] - Missing U_ACTION in acp_captcha.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11618">PHPBB3-11618</a>] - Template tests fail on some systems due to a PHP error in glob()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11619">PHPBB3-11619</a>] - get_remote_file() should use HTTP 1.0</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11630">PHPBB3-11630</a>] - Improvements to the PHP lint pre-commit hook</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11644">PHPBB3-11644</a>] - Skip phpbb_dbal_order_lower_test on MySQL 5.6</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11662">PHPBB3-11662</a>] - &quot;occured&quot; should be &quot;occurred&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11670">PHPBB3-11670</a>] - Replace trademark ™ with ® on &quot;Welcome to phpBB&quot; install page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11674">PHPBB3-11674</a>] - Do not include vendor folder if there are no dependencies.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11524">PHPBB3-11524</a>] - MySQL Upgrader throws warnings on PHP 5.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11720">PHPBB3-11720</a>] - Reporting posts leads to white page error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11769">PHPBB3-11769</a>] - Wrong poster in subscription email when poster is using the Quote button</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11775">PHPBB3-11775</a>] - Error while moving posts to a new topic</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11802">PHPBB3-11802</a>] - Undefined variable $browser in /download/file.php</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8743">PHPBB3-8743</a>] - New topic / reply notifications do not contain author's name.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10050">PHPBB3-10050</a>] - subsilver2: Do not show &quot;Mark topics as read&quot; when there are no topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10205">PHPBB3-10205</a>] - More informative reporting of errors when database connection fails (MySQL and others)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10716">PHPBB3-10716</a>] - PHP-parse all php files as part of the test suite</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10841">PHPBB3-10841</a>] - Disable style and language selectors if there's only one installed.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10854">PHPBB3-10854</a>] - sql server drop default constraint when dropping column </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10865">PHPBB3-10865</a>] - Updated and Added to docs/INSTALL.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10873">PHPBB3-10873</a>] - Change language entry for deleted PMs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10981">PHPBB3-10981</a>] - Upgrade Goutte and use Composer for Installation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11131">PHPBB3-11131</a>] - Phrasing &amp; semantics of Board settings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11162">PHPBB3-11162</a>] - Get rid of $db-&gt;sql_return_on_error(true) trickery when splitting/merging topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11192">PHPBB3-11192</a>] - Add Tebibyte to get_formatted_filesize()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11202">PHPBB3-11202</a>] - Add response status checks to functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11220">PHPBB3-11220</a>] - Improve tooltip explaining the [list=] - BBcode</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11238">PHPBB3-11238</a>] - Specify goutte version</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11285">PHPBB3-11285</a>] - Use more granularity in dependency checks in compress test</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11293">PHPBB3-11293</a>] - Prefer mysqli over mysql due to php 5.5 alpha 2 deprecating mysql</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11294">PHPBB3-11294</a>] - Update extension list in running tests doc</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11368">PHPBB3-11368</a>] - Latest pm reports row count</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11583">PHPBB3-11583</a>] - InnoDB supports FULLTEXT index since MySQL 5.6.4.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11740">PHPBB3-11740</a>] - Update link in FAQ to Ideas Centre</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11873">PHPBB3-11873</a>] - Prevent expensive hash computation in phpbb_check_hash() by rejecting very long passwords</li>
+</ul>
+<h4>Sub-task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10974">PHPBB3-10974</a>] - Move tests/mock_user.php to tests/mock/user.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11009">PHPBB3-11009</a>] - Backport phing build.xml from develop to develop-olympus so it uses composer.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11540">PHPBB3-11540</a>] - Add unit tests for (phpbb_)is_absolute()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11541">PHPBB3-11541</a>] - Add unit tests for style_select() in functions.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11542">PHPBB3-11542</a>] - Add unit tests for language_select() in functions.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11543">PHPBB3-11543</a>] - Add unit tests for obtain online functions in functions.php</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10877">PHPBB3-10877</a>] - Have bamboo generate and publish a phpBB package for every build.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11045">PHPBB3-11045</a>] - Add unit tests for the compress class</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11059">PHPBB3-11059</a>] - Fix README logo</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11060">PHPBB3-11060</a>] - Fix travis.yml pyrus config</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11240">PHPBB3-11240</a>] - Turn on PHPUnit's verbose mode on Travis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11324">PHPBB3-11324</a>] - Add PHP 5.5 environment on Travis-CI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11337">PHPBB3-11337</a>] - Run functional tests on Travis CI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11513">PHPBB3-11513</a>] - Install PHPUnit via Composer's require-dev to simplify test running (no need for pear)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11526">PHPBB3-11526</a>] - Increase composer minimum-stability from beta to stable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11527">PHPBB3-11527</a>] - Upgrade composer.phar to 1.0.0-alpha7</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11529">PHPBB3-11529</a>] - Rename RUNNING_TESTS file to .md file to render it on GitHub</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11576">PHPBB3-11576</a>] - Make phpBB Test Suite MySQL behave at least as strict as phpBB MySQL driver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11671">PHPBB3-11671</a>] - Add phing/phing to composer.json</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11752">PHPBB3-11752</a>] - Update phpBB.com URLs to https in email templates</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li>
+</ul>
+
+ <a name="v3010"></a><h3>1.ii. Changes since 3.0.10</h3>
<h4>Bug</h4>
<ul>
@@ -158,6 +314,14 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10890">PHPBB3-10890</a>] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10908">PHPBB3-10908</a>] - No remote avatar size limit results in files limited only by PHP memory limit</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10913">PHPBB3-10913</a>] - Admin is logged out when accessing any url under adm/ without session id</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10441">PHPBB3-10441</a>] - Update to docs/README.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10773">PHPBB3-10773</a>] - ACP phpBB logo needs registered trademark symbol</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10935">PHPBB3-10935</a>] - Limit number of PM rules per user</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10937">PHPBB3-10937</a>] - Comment removal functions: Backward compatibility broken</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10950">PHPBB3-10950</a>] - Deleting user with undelivered PMs causes SQL error</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10952">PHPBB3-10952</a>] - includes/constants.php version number incorrect</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10965">PHPBB3-10965</a>] - Dropdown CPF now shows in profile when no value is selected</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10978">PHPBB3-10978</a>] - Typo in prosilvers ucp_groups_membership.html</li>
</ul>
<h4>Improvement</h4>
<ul>
@@ -188,6 +352,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10891">PHPBB3-10891</a>] - Allow specifying test config file name via environment variable</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10892">PHPBB3-10892</a>] - Cosmetic improvements to RUNNING_TESTS.txt</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10898">PHPBB3-10898</a>] - Do not write ?&gt; into config.php to avoid whitespace output</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10925">PHPBB3-10925</a>] - Clarify that SQLite3 is not supported for phpBB 3.0.x</li>
</ul>
<h4>New Feature</h4>
<ul>
@@ -208,7 +373,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
</ul>
- <a name="v309"></a><h3>1.ii. Changes since 3.0.9</h3>
+ <a name="v309"></a><h3>1.iii. Changes since 3.0.9</h3>
<h4>Bug</h4>
<ul>
@@ -344,7 +509,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
</ul>
- <a name="v308"></a><h3>1.iii. Changes since 3.0.8</h3>
+ <a name="v308"></a><h3>1.iv. Changes since 3.0.8</h3>
<h4> Bug
</h4>
@@ -712,7 +877,7 @@
</ul>
- <a name="v307-PL1"></a><h3>1.iv. Changes since 3.0.7-PL1</h3>
+ <a name="v307-PL1"></a><h3>1.v. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@@ -1170,13 +1335,13 @@
</ul>
- <a name="v307"></a><h3>1.iv. Changes since 3.0.7</h3>
+ <a name="v307"></a><h3>1.vi. Changes since 3.0.7</h3>
<ul>
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
</ul>
- <a name="v306"></a><h3>1.vi. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>1.vii. Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@@ -1280,7 +1445,7 @@
</ul>
- <a name="v305"></a><h3>1.vii. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>1.viii. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -1502,7 +1667,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.viii. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>1.ix. Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@@ -1591,7 +1756,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
- <a name="v303"></a><h3>1.ix. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>1.x. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -1623,7 +1788,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
- <a name="v302"></a><h3>1.x. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>1.xi. Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@@ -1722,7 +1887,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
- <a name="v301"></a><h3>1.xi. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>1.xii. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -1770,7 +1935,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.xii Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>1.xiii Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -1841,7 +2006,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
- <a name="v30rc8"></a><h3>1.xiii. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>1.xiv. Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@@ -1850,7 +2015,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
- <a name="v30rc7"></a><h3>1.xiv. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>1.xv. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -1885,7 +2050,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xv. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>1.xvi. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -1895,7 +2060,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xvi. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>1.xvii. Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@@ -1958,7 +2123,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xvii. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>1.xviii. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -2009,7 +2174,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xviii. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>1.xix. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -2118,7 +2283,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xviv. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>1.xx. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -2164,7 +2329,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xx. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>1.xxi. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
@@ -2299,7 +2464,7 @@
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html
index dbcefc44c1..9b6440ab21 100644
--- a/phpBB/docs/FAQ.html
+++ b/phpBB/docs/FAQ.html
@@ -89,7 +89,7 @@
<p>There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!</p>
-<p>We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at <a href="http://www.phpbb.com/">www.phpbb.com</a> and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.</p>
+<p>We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at <a href="https://www.phpbb.com/">www.phpbb.com</a> and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.</p>
</div>
@@ -150,7 +150,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="content">
-<p>This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP <code>mail()</code> function or directly via SMTP. Some hosting providers limit the <code>mail()</code> function to prevent its use in spamming, others may rename it or limit its functionality. If the <code>mail()</code> function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see <a href="http://www.phpbb.com/">www.phpbb.com</a> for additional help on this matter.</p>
+<p>This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP <code>mail()</code> function or directly via SMTP. Some hosting providers limit the <code>mail()</code> function to prevent its use in spamming, others may rename it or limit its functionality. If the <code>mail()</code> function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see <a href="https://www.phpbb.com/">www.phpbb.com</a> for additional help on this matter.</p>
<p>If you do require SMTP services please do not ask (on our forums or elsewhere) for someone to provide you with one. Open relays are now things of the past thanks to the unthinking spammers out there. Therefore you are unlikely to find someone willing to offer you (free) services.</p>
@@ -250,7 +250,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="content">
-<p>Please read the paragraph about permissions in our extensive <a href="http://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p>
+<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p>
</div>
@@ -306,11 +306,11 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="content">
-<p>Please read our <a href="http://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p>
+<p>Please read our <a href="https://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p>
<p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p>
-<p><a href="http://www.phpbb.com">www.phpbb.com</a></p>
+<p><a href="https://www.phpbb.com">www.phpbb.com</a></p>
</div>
@@ -328,7 +328,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index e17f496c56..3fa0597fc8 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -46,7 +46,7 @@
<p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
-<p>A basic overview of running phpBB3 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 phpBB3 you should read <a href="http://www.phpbb.com/support/documentation/3.0/">the documentation</a> available online.</p>
+<p>A basic overview of running phpBB3 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 phpBB3 you should read <a href="https://www.phpbb.com/support/documentation/3.0/">the documentation</a> available online.</p>
<h1>Install</h1>
@@ -62,7 +62,7 @@
<li><a href="#update">Updating from stable releases of phpBB 3.0.x</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#update_full">Full package</a></li>
- <li><a href="#update_files">Changed files only</a></li>
+ <li><a href="#update_files">Changed files</a></li>
<li><a href="#update_patch">Patch file</a></li>
<li><a href="#update_auto">Automatic update package</a></li>
<li><a href="#update_all">All package types</a></li>
@@ -82,6 +82,7 @@
<li><a href="#webserver_configuration">Webserver configuration</a></li>
</ol>
</li>
+ <li><a href="#anti_spam">Anti-Spam Measures</a></li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
@@ -107,10 +108,10 @@
<li>Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)</li>
<li>Change the permissions on the following directories to be writable by all (777 or -rwxrwxrwx within your FTP Client):<br />
<code>store/</code>, <code>cache/</code>, <code>files/</code> and <code>images/avatars/upload/</code>.</li>
- <li>Using your web browser visit the location you placed phpBB3 with the addition of install/index.php or pointing directly to install/, e.g. http://www.mydomain.com/phpBB3/install/, http://www.mydomain.com/forum/install/ etc.</li>
- <li>Click the <em>INSTALL</em> tab, follow the steps and fill out all the requested information.</li>
+ <li>Point your web browser to the location where you uploaded the phpBB3 files with the addition of <code>install/index.php</code> or simply <code>install/</code>, e.g. <code>http://www.example.com/phpBB3/install/index.php</code>, <code>http://www.example.com/forum/install/</code>.</li>
+ <li>Click the <strong><em>INSTALL</em></strong> tab, follow the steps and fill out all the requested information.</li>
<li>Change the permissions on config.php to be writable only by yourself (644 or -rw-r--r-- within your FTP Client)</li>
- <li>phpBB3 should now be available, please <strong>MAKE SURE</strong> you read at least <a href="#postinstall">Section 6</a> below for important, security related post-installation instructions.</li>
+ <li>phpBB3 should now be available, please <strong>MAKE SURE</strong> you read at least <a href="#postinstall">Section 6</a> below for important, security related post-installation instructions, and also take note of <a href="#anti_spam">Section 7</a> regarding anti-spam measures.</li>
</ol>
<p>If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.</p>
@@ -131,7 +132,7 @@
<div class="content">
- <p>phpBB3 has a few requirements which must be met before you are able to install and use it.</p>
+ <p>phpBB 3.0.x has a few requirements which must be met before you are able to install and use it.</p>
<ul>
<li>A webserver or web hosting account running on any major Operating System with support for PHP</li>
@@ -139,14 +140,14 @@
<ul>
<li>MySQL 3.23 or above (MySQLi supported)</li>
<li>PostgreSQL 7.3+</li>
- <li>SQLite 2.8.2+</li>
+ <li>SQLite 2.8.2+ (SQLite 3 is not supported)</li>
<li>Firebird 2.1+</li>
<li>MS SQL Server 2000 or above (directly or via ODBC or the native adapter)</li>
<li>Oracle</li>
</ul>
</li>
- <li><strong>PHP 4.3.3+ (>=4.3.3, >=4.4.x, >=5.x.x, >=5.4.x)</strong> with support for the database you intend to use.</li>
- <li>getimagesize() function need to be enabled.</li>
+ <li><strong>PHP (>=4.3.3, >=4.4.0, >=5.0.0)</strong> with support for the database you intend to use.</li>
+ <li>getimagesize() function must be enabled.</li>
<li>Presence of the following modules within PHP will provide access to additional features, but they are not required:
<ul>
<li>zlib Compression support</li>
@@ -158,7 +159,7 @@
</li>
</ul>
- <p>If your server or hosting account does not meet the requirements above we are afraid phpBB3 is not for you.</p>
+ <p>If your server or hosting account does not meet the requirements above then you will be unable to install phpBB 3.0.x.</p>
</div>
@@ -178,21 +179,21 @@
<p>Installation of phpBB3 will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.</p>
- <p>If you do not have shell access or do not wish to use it you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case doing so will cause errors later.</p>
+ <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p>
- <p>All .php, .inc, .sql, .cfg, .html and .txt files should be uploaded in <strong>ASCII</strong> mode, while all graphics should be uploaded in <strong>BINARY</strong> mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client but if you encounter problems later you should be sure the files where uploaded correctly as described here.</p>
+ <p>All .php, .sql, .cfg, .css, .js, .html, .htaccess and .txt files should be uploaded in <strong>ASCII</strong> mode, while all graphics should be uploaded in <strong>BINARY</strong> mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client, but if you encounter problems later you should be sure the files were uploaded correctly as described here.</p>
- <p>phpBB3 comes supplied with British English as its standard language. However a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can of course change this default at a later stage). For more details of language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
+ <p>phpBB3 comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
- <p>Once all the files have been uploaded to your site you should point your browser at this location with the addition of <code>install/</code>. For example if your domain name is <em>www.mydomain.tld</em> and you placed phpBB3 in a directory /phpBB3 off your web root you would enter <em>http://www.mydomain.tld/phpBB3/install/</em> or (alternatively) <em>http://www.mydomain.tld/phpBB3/install/index.php</em> into your browser. When you have done this you should see the phpBB3 Installation screen appear.</p>
+ <p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB3 files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB3 Introduction</em></strong> screen appear.</p>
<h4>Introduction:</h4>
- <p>The installation screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License) and provides information about how you can receive support. To start the installation, use the <em>Install</em> button.</p>
+ <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p>
<h4>Requirements</h4>
- <p>The first page you will see after starting the installation is the Requirements list. phpBB3 checks automatically whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and do have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
+ <p>The first page you will see after starting the installation is the Requirements list. phpBB3 automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
<h4>Database settings</h4>
@@ -210,33 +211,33 @@
<p><strong>Note:</strong> if you are installing using SQLite, you should enter the full path to your database file in the DSN field and leave the username and password fields blank. For security reasons, you should make sure that the database file is not stored in a location accessible from the web.</p>
</div>
- <p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case you can use a different prefix for each installation to make it work.</p>
+ <p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case, you can use a different prefix for each installation to make it work.</p>
- <p>After you entered your details, you can continue with the Proceed to next step button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
+ <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
<p>A <em>Could not connect to the database</em> error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.</p>
<p>If you installed another version of phpBB before on the same database with the same prefix, phpBB will inform you and you just need to enter a different database prefix.</p>
- <p>If you see the Successful Connection message, you can continue to the next step.</p>
+ <p>If you see the <em>Successful Connection</em> message, you can continue to the next step.</p>
<h4>Administrator details</h4>
- <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation we only include English. You can download further languages from <a href="http://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
+ <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation, we only include British English. You can download further languages from <a href="https://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
<h4>Configuration file</h4>
- <p>In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration to run properly. It contains all database settings, so without it, phpBB will not be able to access the database.</p>
+ <p>In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration file in order to operate. It contains all the database settings, so without it, phpBB will not be able to access the database.</p>
- <p>Usually writing the configuration file automatically works fine. But in some cases it can fail due to wrong file permissions, for instance. In this case, you need to upload the file manually. phpBB asks you to download the config.php file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use <em>Done</em> to get to the last step. If <em>Done</em> returns you to the same page as before, and does not return a success message, you did not upload the file correctly.</p>
+ <p>Usually, writing the configuration file automatically works fine. If the file permissions are not set correctly, this process can fail. In this case, you need to upload the file manually. phpBB asks you to download the <code>config.php</code> file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use <em>Done</em> to get to the last step. If <em>Done</em> returns you to the same page as before, and does not return a success message, you did not upload the file correctly.</p>
<h4>Advanced settings</h4>
- <p>The Advanced settings allow you to set some parameters of the board configuration. They are optional, and you can always change them later. So if you are not sure what these settings mean, proceed to the final step and finish the installation.</p>
+ <p>The Advanced settings allow you to set additional parameters of the board configuration. They are optional and you can always change them later. So, even if you are not sure what these settings mean, you can still proceed to the final step and finish the installation.</p>
- <p>If the installation was successful, you can now use the Login button to visit the Administration Control Panel. Congratulations, you have installed phpBB3 successfully. But there is still work ahead!</p>
+ <p>If the installation was successful, you can now use the <em>Login</em> button to visit the Administration Control Panel. Congratulations, you have installed phpBB successfully. But there is still work ahead!</p>
- <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section to find out where you can ask for further assistance.</p>
+ <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p>
<p>At this point if you are converting from phpBB 2.0.x, you should refer to the <a href="#convert">conversion steps</a> for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.</p>
@@ -256,55 +257,55 @@
<div class="content">
-<p>If you are currently using a stable release of phpBB3 updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Please Note</strong>: That before updating we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
+<p>If you are currently using a stable release of phpBB3, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
<p><strong>Please make sure you update your phpBB3 source files too, even if you run the <code>database_update.php</code> file.</strong></p>
<a name="update_full"></a><h3>4.i. Full package</h3>
- <p>The full package is normally meant for new installations only, but if you want to replace all source files this package comes in handy.</p>
+ <p>The full package is normally meant for new installations only, but if you want to replace all source files, this package comes in handy.</p>
- <p>First you should make a copy of your existing <em>config.php</em> file, keep it in a safe place! Next delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directory in place. You can leave alternative styles in-place too. With this complete you can upload the new phpBB3 files (see <a href="#install">New installation</a> for details if necessary). Once complete copy back your saved <em>config.php</em>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
+ <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directorie in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
- <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure, they should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p>
+ <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p>
- <p>Once the install/database_update.php has completed you may proceed to the Administration Control Panel and check remove the install directory as advised.</p>
+ <p>Once <code>install/database_update.php</code> has completed, you may proceed to the Administration Control Panel and then remove the install directory as advised.</p>
-<a name="update_files"></a><h3>4.ii. Changed files only</h3>
+<a name="update_files"></a><h3>4.ii. Changed files</h3>
- <p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
+ <p>This package is meant for those wanting to only replace the files that were changed between a previous version and the latest version.</p>
- <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.10</samp> you should select the phpBB-3.0.10_to_3.0.11.zip/tar.gz file.</p>
+ <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <strong>3.0.11</strong> you should select the appropriate <code>phpBB-3.0.12-files.zip/tar.bz2</code> file.</p>
- <p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
+ <p>The directory structure has been preserved, enabling you (if you wish) to simply upload the uncompressed contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any modifications (MODs) these files will overwrite the originals, possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
- <p>As for the other update procedures you should run <b>install/database_update.php</b> after you have finished updating the files. This will update your database schema and increment the version number.</p>
+ <p>As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and increment the version number.</p>
<a name="update_patch"></a><h3>4.iii. Patch file</h3>
- <p>The patch file package is for those wanting to update through the patch application, and being comfortable with it.</p>
+ <p>The patch file package is for those wanting to update through the patch application, and should only be used by those who are comfortable with it.</p>
- <p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
+ <p>The patch file is one solution for those with many Modifications (MODs) or other changes and do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application, but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
- <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <samp>3.0.10</samp> you need the phpBB-3.0.10_to_3.0.11.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
+ <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <strong>3.0.11</strong>, you need the <code>phpBB-3.0.12-patch.zip/tar.bz2</code> file. Place the correct patch in the parent directory containing the phpBB core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <code>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</code> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
- <p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
+ <p>If you do get failures, you should look at using the <a href="#update_files">Changed Files</a> package to replace the files which failed to patch. Please note that you will need to manually re-add any MODs to these particular files. Alternatively, if you know how, you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
- <p>You should of course delete the patch file (or files) after use. As for the other update procedures you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p>
+ <p>You should, of course, delete the patch file (or files) after use. As for the other update procedures, you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p>
<a name="update_auto"></a><h3>4.iv. Automatic update package</h3>
- <p>This update method is the recommended method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
+ <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 contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</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.11</strong>, you need the <code>phpBB-3.0.11_to_3.0.12.zip/tar.bz2</code> file.</p>
- <p>To perform the update, either follow the instructions from the <code>Administration Control Panel-&gt;System</code> 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>
+ <p>To perform the update, either follow the instructions from the <strong>Administration Control Panel-&gt;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>
<ul>
- <li>Go to the <a href="http://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
- <li>Upload the archives contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li>
+ <li>Go to the <a href="https://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
+ <li>Upload the uncompressed archive contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li>
<li>After the install folder is present, phpBB3 will go offline automatically.</li>
- <li>Point your browser to the install directory, for example <samp>http://www.example.com/phpBB3/install/</samp></li>
+ <li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li>
<li>Choose the "Update" Tab and follow the instructions</li>
</ul>
@@ -312,7 +313,9 @@
<a name="update_all"></a><h3>4.v. All package types</h3>
- <p>If you have non-English language packs installed you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p>
+ <p>If you have non-English language packs installed, you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p>
+
+ <p>These update methods will only update the standard styles, <code>prosilver</code> and <code>subsilver2</code>, any other styles you have installed for your board will usually also need to be updated.</p>
</div>
@@ -334,47 +337,47 @@
<a name="prereq"></a><h3>5.i. Requirements before converting</h3>
- <p>Before converting we heavily recommend you do a <em>full backup of your database and files</em>! If you are unsure how to achieve this please ask your hosting provider for advice. You basically need to follow the basic instructions given for <a href="#install">New installations</a>. Please <strong>do not</strong> overwrite any old files - install phpBB3 at a different location.</p>
+ <p>Before converting, we heavily recommend you do a <em>full backup of your database and files</em>! If you are unsure how to achieve this, please ask your hosting provider for advice. You basically need to follow the instructions given for <a href="#install">New installations</a>. Please <strong>do not</strong> overwrite any old files - install phpBB3 at a different location.</p>
<p>Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.</p>
- <p>Note that the conversion requires CREATE and DROP privileges for the phpBB3's database user account.</p>
+ <p>Note that the conversion requires <code>CREATE</code> and <code>DROP</code> privileges for the phpBB3 database user account.</p>
<a name="conversion"></a><h3>5.ii. Converting</h3>
- <p>To begin the conversion visit the install folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab <em>Convert</em>. Click this tab.</p>
+ <p>To begin the conversion, visit the <code>install/</code> folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab <em>Convert</em>. Click this tab.</p>
- <p>As with install the conversion is automated. Your previous 2.0.x database tables will not be changed as well as the original 2.0.x files remaining unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend you disable your old installation while converting, else you may have inconsistent data after the conversion.</p>
+ <p>As with install, the conversion is automated. Your previous 2.0.x database tables will not be changed and the original 2.0.x files will remain unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong, you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend that you disable your old installation while converting, else you may have inconsistent data after the conversion.</p>
- <p>Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server or other timeout issues). If this is the case you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful).</p>
+ <p>Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server resource limits or other timeout issues). If this is the case, you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful). If your host is unwilling to increase the limits to run the convertor, please see this article for performing the conversion on your local machine: <a href="https://www.phpbb.com/kb/article/offline-conversions/">Knowledge Base - Offline Conversions</a></p>
- <p>Once completed your board should be immediately available. If you encountered errors you should report the problems to our bug tracker or seek help via our forums (see <a href="README.html">README</a> for details).</p>
+ <p>Once completed, your board should be immediately available. If you encountered errors, you should report the problems to our bug tracker or seek help via our forums (see <a href="README.html">README</a> for details).</p>
<a name="postreq"></a><h3>5.iii. Things to do after conversion</h3>
- <p>After successful conversion there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.</p>
+ <p>After a successful conversion, there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.</p>
- <p>The first thing you may want to do is going to the administration control panel and checking every configuration item within the general tab. Thereafter you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.</p>
+ <p>The first thing you may want to do is to go to the administration control panel and check every configuration item within the general tab. Thereafter, you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.</p>
- <p>Within the conversion the search index has not been created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within <code>Admin -&gt; Maintenance -&gt; Database -&gt; Search Index</code>.</p>
+ <p>During the conversion, the search index is not created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within <strong>Administration Control Panel -&gt; Maintenance -&gt; Database -&gt; Search Index</strong>.</p>
<p>After verifying the settings in the ACP, you can delete the install directory to enable the board. The board will stay disabled until you do so.</p>
- <p>Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.</p>
+ <p>Once you are pleased with your new installation, you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems, but you may still want to check your cookie settings within the administration panel; in case your cookie path needs to be adjusted prior to renaming.</p>
<a name="convprob"></a><h3>5.iv. Common conversion problems</h3>
<p><strong>Broken non-latin characters</strong> The conversion script assumes that the database encoding in the source phpBB2 matches the encoding defined in the <code>lang_main.php</code> file of the default language pack of the source installation. Edit that file to match the database's encoding and re-start the conversion procedure.</p>
- <p><strong>http 500 / white pages</strong> The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: too low values for the php settings <code>memory_limit</code> and <code>max_execution_time</code>. Limits on the allowed CPU time are also a frequent cause for such errors, as are caps on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.</p>
+ <p><strong>http 500 / white pages</strong> The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: values too low for the PHP settings <code>memory_limit</code> and <code>max_execution_time</code>. Limits on the allowed CPU time are also a frequent cause for such errors, as are limits on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.</p>
- <p><strong>Password conversion</strong> Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the "forgotten password" function.</p>
+ <p><strong>Password conversion</strong> Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the <em>I forgot my password</em> link on the login page.</p>
- <p><strong>Path to your former board</strong> The converter expects the relative path to your old board's files. So, - for instance - if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p>
+ <p><strong>Path to your former board</strong> The convertor expects the relative path to your old board's files. So, for instance, if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p>
<p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p>
- <p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
+ <p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. This can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
</div>
@@ -393,28 +396,44 @@
<div class="content">
- <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire install/ directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB3 will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directories if you wish.</p>
+ <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p>
- <p>With these directories deleted you should proceed to the administration panel. Depending on how the installation completed you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Panel</strong> link at the bottom of any page. Ensure that details specified in <code>Admin -&gt; General</code> are correct!</p>
+ <p>With these directories deleted, you should proceed to the administration panel. Depending on how the installation completed, you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Control Panel</strong> link at the bottom of any page. Ensure that details specified on the <strong>General</strong> tab are correct!</p>
<a name="avatars"></a><h3>6.i. Uploadable avatars</h3>
<p>phpBB3 supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p>
- <p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct paths for uploadeable avatars is set in <code>Admin -&gt; General -&gt; Board Configuration -&gt; Avatar settings</code>. By default this is <em>images/avatars/uploads</em> but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to. Exactly how you should do this depends on your ftp client or server operating system.</p>
+ <p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct path for uploadable avatars is set in <strong>Administration Control Panel -&gt; General -&gt; Board Configuration -&gt; Avatar settings</strong>. By default this is <code>images/avatars/uploads</code>, but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to it. Exactly how you should do this depends on your FTP client or server operating system.</p>
- <p>On UNIX systems for example you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialoge box, see your FTP clients documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.</p>
+ <p>On UNIX systems, for example, you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialog box, see your FTP client's documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.</p>
- <p>On Windows system you need to ensure the directory is not write-protected and that it has global write permissions (see your servers documentation or contact your hosting provider if you are unsure on how to achieve this).</p>
+ <p>On Windows systems, you need to ensure the directory is not write-protected and that it has global write permissions (see your server's documentation or contact your hosting provider if you are unsure on how to achieve this).</p>
- <p>Please be aware that setting a directories permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.</p>
+ <p>Please be aware that setting a directory's permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.</p>
<a name="webserver_configuration"></a><h3>6.ii. Webserver configuration</h3>
- <p>Depending on your web server you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>store/</code> and other directories. This is to prevent users from accessing sensitive files.</p>
+ <p>Depending on your web server, you may have to configure your server to deny web access to the <code>cache/</code>, <code>files/</code>, <code>store/</code> and other directories. This is to prevent users from accessing sensitive files.</p>
+
+ <p>For <strong>Apache</strong> there are <code>.htaccess</code> files already in place to do this for you. Similarly, for <strong>Windows</strong> based servers using <strong>IIS</strong> there are <code>web.config</code> files already in place to do this for you. For other webservers, you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in <code>docs/</code> directory.</p>
- <p>For <strong>apache</strong> there are <code>.htaccess</code> files already in place to do this for you. For other webservers you will have to adjust the configuration yourself. Sample files for <strong>nginx</strong> and <strong>lighttpd</strong> to help you get started may be found in docs directory.</p>
+ </div>
+ <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
+
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+
+ <hr />
+
+<a name="anti_spam"></a><h2>7. Anti-Spam Measures</h2>
+
+ <div class="paragraph">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <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>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
@@ -424,14 +443,14 @@
<hr />
-<a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2>
+<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="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see the source code and <code>docs/</code> directory for more details. This package and its contents are Copyright &copy; <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index e6fb77ac08..89f573de04 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -41,7 +41,7 @@
<!-- BEGIN DOCUMENT -->
- <p>Thank you for downloading phpBB3. This README will guide through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p>
+ <p>Thank you for downloading phpBB3. This README will guide you through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p>
<h1>Readme</h1>
@@ -54,7 +54,7 @@
<li><a href="#install">Installing phpBB3</a></li>
<li><a href="#run">Running phpBB3</a>
<ol style="list-style-type: lower-roman;">
- <li><a href="#i18n">Internationalisation (i18n)</a></li>
+ <li><a href="#i18n">Languages (Internationalisation - i18n)</a></li>
<li><a href="#styles">Styles</a></li>
<li><a href="#mods">Modifications</a></li>
</ol>
@@ -62,12 +62,13 @@
<li><a href="#help">Getting help with phpBB3</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#docs">Documentation</a></li>
+ <li><a href="#kb">Knowledge Base</a></li>
<li><a href="#website">Community Forums</a></li>
- <li><a href="#irc">Internet Relay Chat</a></li>
+ <li><a href="#irc">Internet Relay Chat (IRC)</a></li>
</ol>
</li>
<li><a href="#status">Status of this version</a></li>
- <li><a href="#bugs">Reporting Bugs</a>
+ <li><a href="#bugs">Reporting bugs</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#securitybugs">Security related bugs</a></li>
</ol>
@@ -91,11 +92,11 @@
<div class="content">
- <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x installation we highly recommend you backup any existing data before proceeding!</p>
+ <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 installation we highly recommend that you backup any existing data before proceeding!</p>
<p>Users of phpBB3 Beta versions cannot directly update.</p>
- <p>Please note that we won't support the following installation types:</p>
+ <p>Please note that we don't support the following installation types:</p>
<ul>
<li>Updates from phpBB3 Beta versions to phpBB3 RC1 and higher</li>
<li>Conversions from phpBB 2.0.x to phpBB3 Beta versions</li>
@@ -108,7 +109,7 @@
<li>Updates from phpBB3 RC1 to the latest version</li>
<li>Note: if using the <em>Automatic Update Package</em>, updates are supported from phpBB 3.0.2 onward. To update a pre-3.0.2 installation, first update to 3.0.2 and then update to the current version.</li>
<li>Conversions from phpBB 2.0.x to the latest version</li>
- <li>New installations of phpBB3 - always only the latest released version</li>
+ <li>New installations of phpBB3 - only the latest released version</li>
</ul>
</div>
@@ -127,41 +128,41 @@
<div class="content">
- <p>Once installed phpBB is easily managed by both admin and moderator control panels. If you need help or advice with phpBB please see <a href="#help">Section 3</a> below.</p>
+ <p>Once installed, phpBB is easily managed via the Administration and Moderator Control Panels. If you need help or advice with phpBB, please see <a href="#help">Section 3</a> below.</p>
- <a name="i18n"></a><h3>2.i. Internationalisation (i18n)</h3>
+ <a name="i18n"></a><h3>2.i. Languages (Internationalisation - i18n)</h3>
- <p>A number of language packs and style localisations are available. You can find them on our official language packs page:</p>
+ <p>A number of language packs with included style localisations are available. You can find them listed in the <a href="https://www.phpbb.com/languages/">Language Packs</a> pages of our downloads section or from the <a href="https://www.phpbb.com/customise/db/language_packs-25/">Language Packs</a> section of the <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
- <p><a href="http://www.phpbb.com/languages/">http://www.phpbb.com/languages/</a></p>
+ <p>For more information about language packs, please see: <a href="https://www.phpbb.com/languages/">https://www.phpbb.com/languages/</a></p>
- <p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. So please, do not ask for help in these cases!</p>
+ <p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. Please do not ask for support if you download a language pack from a 3rd party site.</p>
- <p>Installation of these packages is straightforward, simply download the required language pack and unarchive it into the <samp>languages/</samp> folder. Please ensure you retain the directory structure when doing this! Once uploaded go to the <code>Admin-&gt;System-&gt;Language Packs</code> and install the now appearing new language pack. To install the style imageset you should download the imageset for your language and unarchive the file/s into the relevant imageset directory (styles/prosilver/imageset or styles/subsilver2/imageset), again you must retain the directory structure. Once installed the imageset will become immediately available.</p>
+ <p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>System tab -&gt; General Tasks -&gt; Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
- <p>If your language is not available please visit our forums where you will find a topic listing translations currently available or in preparation. This topic also gives you information should you wish to volunteer to translate a language not currently listed.</p>
+ <p>If your language is not available, please visit our <a href="https://www.phpbb.com/community/viewforum.php?f=66">[3.0.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
<a name="styles"></a><h3>2.ii. Styles</h3>
- <p>Although phpBB Group are rather proud of the included styles we realise that they may not be to everyone's tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at</p>
+ <p>Although the phpBB Group is rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB3 allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="https://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
- <p><a href="http://www.phpbb.com/customise/db/styles-2/">http://www.phpbb.com/customise/db/styles-2/</a></p>
+ <p>For more information about styles, please see: <a href="https://www.phpbb.com/styles/">https://www.phpbb.com/styles/</a></p>
- <p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3.</p>
+ <p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3. It is also important to ensure that the style is updated to match the current version of the phpBB software you are using.</p>
- <p>Once you have downloaded a style the usual next step is to unarchive (or upload the unarchived contents of) the package into your <samp>styles/</samp> directory. You then need to visit <code>Administration -&gt; Styles</code>, you should see the new style available, click install and it will become available for all your users.</p>
+ <p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -&gt; Styles tab</code> where you should see the new style available. Click &quot;Install&quot; to install the style.</p>
- <p><strong>Please note</strong> that if you create your own style or modify existing ones, please remember to enable the &quot;Recompile stale style components&quot; setting within the <code>Admin-&gt;General-&gt;Load Settings</code> screen. This setting allows the cache to detect changes made to the style and automatically refresh it. If this setting is disabled, you will not see your changes taking effect.</p>
+ <p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to &quot;Refresh&quot; the appropriate style components <code>Administration Control Panel -&gt; Styles tab -&gt; Style Components</code> screen. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the changed components are not refreshed you will not see your changes taking effect.</p>
<a name="mods"></a><h3>2.iii. Modifications</h3>
- <p>Although not officially supported by phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB extend its capabilities still further and can be found at:</p>
+ <p>Although not officially supported by the phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB software, known as <strong>MODs</strong>, extend its capabilities still further. You can browse through many of the MODs in the <a href="https://www.phpbb.com/customise/db/modifications-1/">Modifications</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
- <p><a href="http://www.phpbb.com/customise/db/modifications-1/">http://www.phpbb.com/customise/db/modifications-1/</a></p>
+ <p>For more information about MODs, please see: <a href="https://www.phpbb.com/mods/">https://www.phpbb.com/mods/</a></p>
- <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the modification and see if the problem is resolved.</p>
+ <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the MOD and see if the problem is resolved. Any support for a MOD should only be sought in the &quot;Discussion/Support&quot; forum for that MOD.</p>
- <p>Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success.</p>
+ <p>Also remember that any modifications, particularly those which modify the database in any way, may render upgrading your forum to future versions more difficult. With all this said, many users have and continue to utilise many of the MODs already available with great success.</p>
</div>
@@ -179,29 +180,35 @@
<div class="content">
- <p>phpBB3 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a> which covers a few basic getting started questions. If you need additional help there are several places you should look.</p>
+ <p>phpBB3 can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a>, which covers a few basic getting started questions. If you need additional help there are several places you can find it.</p>
<a name="docs"></a><h3>3.i. phpBB3 Documentation</h3>
- <p>A comprehensive documentation is now available online and can be accessed from the following location:</p>
+ <p>Comprehensive documentation is now available on the phpBB website:</p>
- <p><a href="http://www.phpbb.com/support/documentation/3.0/">http://www.phpbb.com/support/documentation/3.0/</a></p>
+ <p><a href="https://www.phpbb.com/support/documentation/3.0/">https://www.phpbb.com/support/documentation/3.0/</a></p>
- <p>This covers everything from installation through setting permissions and managing users.</p>
+ <p>This covers everything from installation to setting permissions and managing users.</p>
- <a name="website"></a><h3>3.ii. Community Forums</h3>
+ <a name="kb"></a><h3>3.ii. Knowledge Base</h3>
- <p>phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
+ <p>The Knowledge Base consists of a number of detailed articles on some common issues phpBB users may encounter while using the product. The Knowledge Base can be found at:</p>
- <p><a href="http://www.phpbb.com/community/">http://www.phpbb.com/community/</a></p>
+ <p><a href="https://www.phpbb.com/kb/">https://www.phpbb.com/kb/</a></p>
- <p>If you do seek help via our forums please be sure to do a Search before posting. This may well save both you and us time and allow the developer, moderator and support groups to spend more time responding to people with unknown issues and problems. Please also remember that phpBB is an entirely volunteer effort, no one receives any compensation for the time they give, this includes moderators as well as developers. So please be respectful and mindful when awaiting responses.</p>
+ <a name="website"></a><h3>3.iii. Community Forums</h3>
- <a name="irc"></a><h3>3.iii Internet Relay Chat</h3>
+ <p>The phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p>
- <p>Another place you may find help is our IRC channel. This operates on the Freenode IRC network, <em>irc.freenode.net</em> and the channel is <em>#phpbb</em> and can be accessed by any good IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.</p>
+ <p><a href="https://www.phpbb.com/community/">https://www.phpbb.com/community/</a></p>
- <p>There are other IRC channels available, please see <a href="http://www.phpbb.com/support/irc/">http://www.phpbb.com/support/irc/</a> for the complete list.</p>
+ <p>If you do seek help via our forums please be sure to do a search before posting; if someone has experienced the issue before, then you may find that your question has already been answered. Please remember that phpBB is entirely staffed by volunteers, no one receives any compensation for the time they give, including moderators as well as developers; please be respectful and mindful when awaiting responses and receiving support.</p>
+
+ <a name="irc"></a><h3>3.iv Internet Relay Chat</h3>
+
+ <p>Another place you may find help is our IRC channel. This operates on the Freenode IRC network, <a href="irc://irc.freenode.net">irc.freenode.net</a> and the channel is <em>#phpbb</em> and can be accessed by any decent IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.</p>
+
+ <p>There are other IRC channels available, please see <a href="https://www.phpbb.com/support/irc/">https://www.phpbb.com/support/irc/</a> for the complete list.</p>
</div>
@@ -225,7 +232,7 @@
<p><a href="http://area51.phpbb.com/phpBB/">http://area51.phpbb.com/phpBB/</a></p>
- <p>Please note that this forum should <strong>NOT</strong> be used to obtain support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.</p>
+ <p>Please note that the development forums should <strong>NOT</strong> be used to seek support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.</p>
</div>
@@ -250,13 +257,13 @@
<p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p>
<ul>
- <li>Firstly determine if your bug is reproduceable, how to determine this depends on the bug in question. Only if the bug is reproduceable it is likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues.<br /><br /></li>
- <li>Next please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
- <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it's related to something you have done rather phpBB3.<br /><br /></li>
- <li>If no existing bug exists then please feel free to add it.</li>
+ <li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
+ <li>Next, please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
+ <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it&rsquo;s related to something you have done rather than phpBB3<br /><br /></li>
+ <li>If no existing bug exists then please feel free to add it</li>
</ul>
- <p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) firstly make sure you have logged in (your username and password are the same as for the community forums) then please include the following details:</p>
+ <p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) first make sure that you have logged in (your username and password are the same as for the community forums) then please include the following details:</p>
<ul>
<li>Your server type/version, e.g. Apache 1.3.28, IIS 4, Sambar, etc.</li>
@@ -266,7 +273,7 @@
<p>The relevant database type/version is listed within the administration control panel.</p>
- <p>Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
+ <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
<p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.0.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/30x/coding-guidelines.html">http://area51.phpbb.com/docs/30x/coding-guidelines.html</a></p>
@@ -276,7 +283,7 @@
<p>If you find a potential security related vulnerability in phpBB please <strong>DO NOT</strong> post it to the bug tracker, public forums, etc.! Doing so may allow unscrupulous users to take advantage of it before we have time to put a fix in place. All security related bugs should be sent to our security tracker:</p>
- <p><a href="http://www.phpbb.com/security/">http://www.phpbb.com/security/</a></p>
+ <p><a href="https://www.phpbb.com/security/">https://www.phpbb.com/security/</a></p>
</div>
@@ -294,11 +301,11 @@
<div class="content">
- <p>This list is not complete but does represent those bugs which may effect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.</p>
+ <p>This list is not complete but does represent those bugs which may affect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.</p>
<ul>
- <li>Conversions may fail to complete on large boards under some hosts</li>
- <li>Updates may fail to complete on large update sets under some hosts</li>
+ <li>Conversions may fail to complete on large boards under some hosts.</li>
+ <li>Updates may fail to complete on large update sets under some hosts.</li>
<li>Smilies placed directly after bbcode tags will not get parsed. Smilies always need to be separated by spaces.</li>
</ul>
@@ -318,11 +325,11 @@
<div class="content">
- <p>phpBB is no longer supported on PHP3 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 4.3.3.</p>
+ <p>phpBB is no longer supported on PHP3 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 4.3.3. The minimum version that will be required for phpBB 3.1 is PHP 5.3.3.</p>
- <p>Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
+ <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
- <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 4.3.3 to 5.4.x without problem. </p>
+ <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite 2 and Firebird. Versions of PHP used range from 4.3.3 to 5.4.x without problem. </p>
<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3>
@@ -344,7 +351,7 @@
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright &copy; <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index 29469c21ac..eb168e26a6 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -200,7 +200,7 @@ $user_id = 2;
$auth->acl_clear_prefetch($user_id);
</pre></div>
- <p>This method returns void.</p>
+ <p>This method returns null.</p>
<a name="acl_get_list"></a><h3>2.viii. acl_get_list</h3>
@@ -275,7 +275,7 @@ $auth_admin = new auth_admin();
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index cd113a7226..a541fe8866 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -956,6 +956,8 @@ $action_ary = request_var('action', array('' =&gt; 0));
<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>
+ <p><code>$forum_data</code> should contain at least the <code>forum_id</code> and <code>forum_password</code> fields. If the field <code>forum_name</code> is available, then it is displayed on the forum login page.</p>
+
<p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
<h4>Sensitive Operations: </h4>
@@ -1189,7 +1191,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<span class="comment">&lt;!-- INCLUDEPHP somefile&#46;php --&gt;</span>
</pre></div>
-<p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="http://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p>
+<p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="https://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p>
<h4>Conditionals/Control structures</h4>
<p>The most significant addition to 3.0.x are conditions or control structures, &quot;if something then do this else do that&quot;. The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p>
@@ -2314,14 +2316,14 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<hr />
-<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
+<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="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
index 1b8131efaf..fbc8baaf75 100644
--- a/phpBB/docs/hook_system.html
+++ b/phpBB/docs/hook_system.html
@@ -867,7 +867,7 @@ function phpbb_hook_register(&amp;$hook)
<div class="content">
- <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
+ <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) <a href="https://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p>
</div>
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index bf277c69fa..ed33fc0962 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -170,7 +170,7 @@ else
if (!$attachment['in_message'])
{
//
- $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
+ $sql = 'SELECT p.forum_id, f.forum_name, f.forum_password, f.parent_id
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';
@@ -285,7 +285,7 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHME
$db->sql_query($sql);
}
-if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false)))
+if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))
{
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
file_gc();
@@ -343,8 +343,8 @@ function send_avatar_to_browser($file, $browser)
$image_data = @getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
-
- if (strpos(strtolower($browser), 'msie') !== false && strpos(strtolower($browser), 'msie 8.0') === false)
+
+ if ((strpos(strtolower($browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
{
header('Content-Disposition: attachment; ' . header_filename($file));
@@ -477,10 +477,9 @@ function send_file_to_browser($attachment, $upload_dir, $category)
*/
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
- $is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
header('Content-Type: ' . $attachment['mimetype']);
-
- if ($is_ie8)
+
+ if (phpbb_is_greater_ie_version($user->browser, 7))
{
header('X-Content-Type-Options: nosniff');
}
@@ -492,7 +491,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
else
{
- if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
+ if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
{
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
@@ -503,7 +502,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
else
{
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
+ if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('X-Download-Options: noopen');
}
@@ -680,7 +679,8 @@ function set_modified_headers($stamp, $browser)
{
// let's see if we have to send the file at all
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
- if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false))
+
+ if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
{
if ($last_load !== false && $last_load >= $stamp)
{
@@ -709,4 +709,25 @@ function file_gc()
exit;
}
+/**
+* Check if the browser is internet explorer version 7+
+*
+* @param string $user_agent User agent HTTP header
+* @param int $version IE version to check against
+*
+* @return bool true if internet explorer version is greater than $version
+*/
+function phpbb_is_greater_ie_version($user_agent, $version)
+{
+ if (preg_match('/msie (\d+)/', strtolower($user_agent), $matches))
+ {
+ $ie_version = (int) $matches[1];
+ return ($ie_version > $version);
+ }
+ else
+ {
+ return false;
+ }
+}
+
?> \ No newline at end of file
diff --git a/phpBB/includes/acm/acm_apc.php b/phpBB/includes/acm/acm_apc.php
index 1a487f94ad..205353d3a5 100644
--- a/phpBB/includes/acm/acm_apc.php
+++ b/phpBB/includes/acm/acm_apc.php
@@ -33,7 +33,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
diff --git a/phpBB/includes/acm/acm_eaccelerator.php b/phpBB/includes/acm/acm_eaccelerator.php
index 645067c199..ecec3ac9a5 100644
--- a/phpBB/includes/acm/acm_eaccelerator.php
+++ b/phpBB/includes/acm/acm_eaccelerator.php
@@ -37,7 +37,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
@@ -54,7 +54,7 @@ class acm extends acm_memory
/**
* Perform cache garbage collection
*
- * @return void
+ * @return null
*/
function tidy()
{
diff --git a/phpBB/includes/acm/acm_memcache.php b/phpBB/includes/acm/acm_memcache.php
index e54fa36c38..70bc219952 100644
--- a/phpBB/includes/acm/acm_memcache.php
+++ b/phpBB/includes/acm/acm_memcache.php
@@ -71,7 +71,7 @@ class acm extends acm_memory
/**
* Unload the cache resources
*
- * @return void
+ * @return null
*/
function unload()
{
@@ -83,7 +83,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
diff --git a/phpBB/includes/acm/acm_redis.php b/phpBB/includes/acm/acm_redis.php
index 41533eaacb..dc11ca7768 100644
--- a/phpBB/includes/acm/acm_redis.php
+++ b/phpBB/includes/acm/acm_redis.php
@@ -80,7 +80,7 @@ class acm extends acm_memory
/**
* Unload the cache resources
*
- * @return void
+ * @return null
*/
function unload()
{
@@ -92,7 +92,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php
index 0501ab74c5..7faba4f5b6 100644
--- a/phpBB/includes/acm/acm_wincache.php
+++ b/phpBB/includes/acm/acm_wincache.php
@@ -32,7 +32,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
diff --git a/phpBB/includes/acm/acm_xcache.php b/phpBB/includes/acm/acm_xcache.php
index d0a614660c..e3d83f8bfa 100644
--- a/phpBB/includes/acm/acm_xcache.php
+++ b/phpBB/includes/acm/acm_xcache.php
@@ -48,7 +48,7 @@ class acm extends acm_memory
/**
* Purge cache data
*
- * @return void
+ * @return null
*/
function purge()
{
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 0644b38eb1..31166a56dc 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -113,8 +113,8 @@ class acp_bbcodes
{
$template->assign_block_vars('token', array(
'TOKEN' => '{' . $token . '}',
- 'EXPLAIN' => $token_explain)
- );
+ 'EXPLAIN' => ($token === 'LOCAL_URL') ? sprintf($token_explain, generate_board_url() . '/') : $token_explain,
+ ));
}
return;
@@ -345,6 +345,9 @@ class acp_bbcodes
'LOCAL_URL' => array(
'!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')"
),
+ 'RELATIVE_URL' => array(
+ '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')"
+ ),
'EMAIL' => array(
'!(' . get_preg_expression('email') . ')!ie' => "\$this->bbcode_specialchars('$1')"
),
@@ -371,6 +374,7 @@ class acp_bbcodes
$sp_tokens = array(
'URL' => '(?i)((?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))(?-i)',
'LOCAL_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)',
+ 'RELATIVE_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)',
'EMAIL' => '(' . get_preg_expression('email') . ')',
'TEXT' => '(.*?)',
'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)',
@@ -427,7 +431,11 @@ class acp_bbcodes
$fp_replace = str_replace($token, $replace, $fp_replace);
$sp_match = str_replace(preg_quote($token, '!'), $sp_tokens[$token_type], $sp_match);
- $sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
+
+ // Prepend the board url to local relative links
+ $replace_prepend = ($token_type === 'LOCAL_URL') ? generate_board_url() . '/' : '';
+
+ $sp_replace = str_replace($token, $replace_prepend . '${' . ($n + 1) . '}', $sp_replace);
}
$fp_match = '!' . $fp_match . '!' . $modifiers;
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index f437dca8f9..ebbf66657e 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -408,8 +408,8 @@ class acp_board
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
- 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
- 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
+ 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'email', 'type' => 'text:25:100', 'explain' => true),
+ 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'email', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 469a367bba..bfec7c27d8 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -124,6 +124,8 @@ class acp_captcha
'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id),
'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(),
'CAPTCHA_SELECT' => $captcha_select,
+
+ 'U_ACTION' => $this->u_action,
));
}
}
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 486616c33d..c9d476b8ae 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -80,6 +80,11 @@ class acp_groups
case 'approve':
case 'demote':
case 'promote':
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -120,48 +125,64 @@ class acp_groups
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ else if (empty($mark_ary))
+ {
+ trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
+ }
if (confirm_box(true))
{
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
+ }
+ else
+ {
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ 'mark' => $mark_ary,
+ 'g' => $group_id,
+ 'i' => $id,
+ 'mode' => $mode,
+ 'action' => $action))
+ );
+ }
+ break;
- if (!sizeof($mark_ary))
- {
- $start = 0;
+ case 'set_default_on_all':
+ if (confirm_box(true))
+ {
+ $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+
+ $start = 0;
- do
+ do
+ {
+ $sql = 'SELECT user_id
+ FROM ' . USER_GROUP_TABLE . "
+ WHERE group_id = $group_id
+ ORDER BY user_id";
+ $result = $db->sql_query_limit($sql, 200, $start);
+
+ $mark_ary = array();
+ if ($row = $db->sql_fetchrow($result))
{
- $sql = 'SELECT user_id
- FROM ' . USER_GROUP_TABLE . "
- WHERE group_id = $group_id
- ORDER BY user_id";
- $result = $db->sql_query_limit($sql, 200, $start);
-
- $mark_ary = array();
- if ($row = $db->sql_fetchrow($result))
+ do
{
- do
- {
- $mark_ary[] = $row['user_id'];
- }
- while ($row = $db->sql_fetchrow($result));
+ $mark_ary[] = $row['user_id'];
+ }
+ while ($row = $db->sql_fetchrow($result));
- group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
- $start = (sizeof($mark_ary) < 200) ? 0 : $start + 200;
- }
- else
- {
- $start = 0;
- }
- $db->sql_freeresult($result);
+ $start = (sizeof($mark_ary) < 200) ? 0 : $start + 200;
}
- while ($start);
- }
- else
- {
- group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ else
+ {
+ $start = 0;
+ }
+ $db->sql_freeresult($result);
}
+ while ($start);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
@@ -175,10 +196,13 @@ class acp_groups
'action' => $action))
);
}
-
break;
case 'deleteusers':
+ if (empty($mark_ary))
+ {
+ trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
+ }
case 'delete':
if (!$group_id)
{
@@ -233,6 +257,11 @@ class acp_groups
break;
case 'addusers':
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -394,13 +423,21 @@ class acp_groups
}
}
- // Validate the length of "Maximum number of allowed recipients per private message" setting.
- // We use 16777215 as a maximum because it matches MySQL unsigned mediumint maximum value
- // which is the lowest amongst DBMSes supported by phpBB3
- if ($max_recipients_error = validate_data($submit_ary, array('max_recipients' => array('num', false, 0, 16777215))))
+ /*
+ * Validate the length of "Maximum number of allowed recipients per
+ * private message" setting. We use 16777215 as a maximum because it matches
+ * MySQL unsigned mediumint maximum value which is the lowest amongst DBMSes
+ * supported by phpBB3. Also validate the submitted colour value.
+ */
+ $validation_checks = array(
+ 'max_recipients' => array('num', false, 0, 16777215),
+ 'colour' => array('hex_colour', true),
+ );
+
+ if ($validation_error = validate_data($submit_ary, $validation_checks))
{
// Replace "error" string with its real, localised form
- $error = array_merge($error, array_map(array(&$user, 'lang'), $max_recipients_error));
+ $error = array_merge($error, $validation_error);
}
if (!sizeof($error))
@@ -493,6 +530,7 @@ class acp_groups
if (sizeof($error))
{
+ $error = array_map(array(&$user, 'lang'), $error);
$group_rank = $submit_ary['rank'];
$group_desc_data = array(
@@ -683,7 +721,7 @@ class acp_groups
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'),
- 'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=default&amp;g=$group_id",
+ 'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=set_default_on_all&amp;g=$group_id",
));
// Grab the members
@@ -795,4 +833,4 @@ class acp_groups
}
}
-?> \ No newline at end of file
+?>
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index cffe296651..d80b0d1532 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -398,11 +398,11 @@ class acp_main
// Version check
$user->add_lang('install');
- if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.2', '<'))
+ if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<'))
{
$template->assign_vars(array(
'S_PHP_VERSION_OLD' => true,
- 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=2152375">', '</a>'),
+ 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=2152375">', '</a>'),
));
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index a591474fce..19223847f0 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -365,6 +365,7 @@ class acp_profile
$field_row = array_merge($default_values[$field_type], array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,
+ 'field_show_novalue'=> 0,
'field_hide' => 0,
'field_show_profile'=> 0,
'field_no_view' => 0,
@@ -380,7 +381,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@@ -405,6 +406,7 @@ class acp_profile
// Visibility Options...
$visibility_ary = array(
'field_required',
+ 'field_show_novalue',
'field_show_on_reg',
'field_show_on_vt',
'field_show_profile',
@@ -757,6 +759,7 @@ class acp_profile
$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
+ 'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
@@ -1073,6 +1076,7 @@ class acp_profile
'field_default_value' => $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],
+ 'field_show_novalue' => $cp->vars['field_show_novalue'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
'field_hide' => $cp->vars['field_hide'],
diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php
index b3baf54983..b8fc2d2c45 100644
--- a/phpBB/includes/acp/acp_send_statistics.php
+++ b/phpBB/includes/acp/acp_send_statistics.php
@@ -29,7 +29,7 @@ class acp_send_statistics
{
global $config, $template, $phpbb_admin_path, $phpEx;
- $collect_url = "http://www.phpbb.com/stats/receive_stats.php";
+ $collect_url = "https://www.phpbb.com/stats/receive_stats.php";
$this->tpl_name = 'acp_send_statistics';
$this->page_title = 'ACP_SEND_STATISTICS';
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 7e3d1a1024..5d3e9abcea 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -39,7 +39,7 @@ class acp_update
$info = obtain_latest_version_info(request_var('versioncheck_force', false));
- if ($info === false)
+ if (empty($info))
{
trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
}
diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php
index f82896f628..2adf909b96 100644
--- a/phpBB/includes/captcha/captcha_non_gd.php
+++ b/phpBB/includes/captcha/captcha_non_gd.php
@@ -119,7 +119,7 @@ class captcha
$new_line = '';
$end = strlen($scanline) - ceil($width/2);
- for ($i = floor($width/2); $i < $end; $i++)
+ for ($i = (int) floor($width / 2); $i < $end; $i++)
{
$pixel = ord($scanline{$i});
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 5b72d89795..3533c49d46 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.0.11-RC1');
+define('PHPBB_VERSION', '3.0.12');
// QA-related
// define('PHPBB_QA', 1);
@@ -157,6 +157,7 @@ define('PHYSICAL_LINK', 2);
define('CONFIRM_REG', 1);
define('CONFIRM_LOGIN', 2);
define('CONFIRM_POST', 3);
+define('CONFIRM_REPORT', 4);
// Categories - Attachments
define('ATTACHMENT_CATEGORY_NONE', 0);
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index c6dd23e6bd..f63ff18cbe 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -1819,6 +1819,22 @@ class phpbb_db_tools
case 'mssql':
case 'mssqlnative':
+ // remove default cosntraints first
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
+ SET @drop_default_name =
+ (SELECT so.name FROM sysobjects so
+ JOIN sysconstraints sc ON so.id = sc.constid
+ WHERE object_name(so.parent_obj) = '{$table_name}'
+ AND so.xtype = 'D'
+ AND sc.colid = (SELECT colid FROM syscolumns
+ WHERE id = object_id('{$table_name}')
+ AND name = '{$column_name}'))
+ IF @drop_default_name <> ''
+ BEGIN
+ SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
+ EXEC(@cmd)
+ END";
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
break;
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 9cc337955b..30d2870938 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -827,7 +827,7 @@ class dbal
</div>
</div>
<div id="page-footer">
- Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
</div>
</div>
</body>
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index b7178593dc..2dd95c2508 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -25,11 +25,19 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
*/
class dbal_mssql extends dbal
{
+ var $connect_error = '';
+
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
{
+ if (!function_exists('mssql_connect'))
+ {
+ $this->connect_error = 'mssql_connect function does not exist, is mssql extension installed?';
+ return $this->sql_error('');
+ }
+
$this->persistency = $persistency;
$this->user = $sqluser;
$this->dbname = $database;
@@ -355,34 +363,44 @@ class dbal_mssql extends dbal
*/
function _sql_error()
{
- $error = array(
- 'message' => @mssql_get_last_message(),
- 'code' => ''
- );
-
- // Get error code number
- $result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
- if ($result_id)
+ if (function_exists('mssql_get_last_message'))
{
- $row = @mssql_fetch_assoc($result_id);
- $error['code'] = $row['code'];
- @mssql_free_result($result_id);
- }
+ $error = array(
+ 'message' => @mssql_get_last_message(),
+ 'code' => '',
+ );
- // Get full error message if possible
- $sql = 'SELECT CAST(description as varchar(255)) as message
- FROM master.dbo.sysmessages
- WHERE error = ' . $error['code'];
- $result_id = @mssql_query($sql);
-
- if ($result_id)
- {
- $row = @mssql_fetch_assoc($result_id);
- if (!empty($row['message']))
+ // Get error code number
+ $result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
+ if ($result_id)
+ {
+ $row = @mssql_fetch_assoc($result_id);
+ $error['code'] = $row['code'];
+ @mssql_free_result($result_id);
+ }
+
+ // Get full error message if possible
+ $sql = 'SELECT CAST(description as varchar(255)) as message
+ FROM master.dbo.sysmessages
+ WHERE error = ' . $error['code'];
+ $result_id = @mssql_query($sql);
+
+ if ($result_id)
{
- $error['message'] .= '<br />' . $row['message'];
+ $row = @mssql_fetch_assoc($result_id);
+ if (!empty($row['message']))
+ {
+ $error['message'] .= '<br />' . $row['message'];
+ }
+ @mssql_free_result($result_id);
}
- @mssql_free_result($result_id);
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
}
return $error;
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 2ecc42cadf..04501cce8b 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -32,6 +32,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
class dbal_mssql_odbc extends dbal
{
var $last_query_text = '';
+ var $connect_error = '';
/**
* Connect to server
@@ -68,7 +69,24 @@ class dbal_mssql_odbc extends dbal
@ini_set('odbc.defaultlrl', $max_size);
}
- $this->db_connect_id = ($this->persistency) ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword);
+ if ($this->persistency)
+ {
+ if (!function_exists('odbc_pconnect'))
+ {
+ $this->connect_error = 'odbc_pconnect function does not exist, is odbc extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @odbc_pconnect($this->server, $this->user, $sqlpassword);
+ }
+ else
+ {
+ if (!function_exists('odbc_connect'))
+ {
+ $this->connect_error = 'odbc_connect function does not exist, is odbc extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @odbc_connect($this->server, $this->user, $sqlpassword);
+ }
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
}
@@ -342,10 +360,22 @@ class dbal_mssql_odbc extends dbal
*/
function _sql_error()
{
- return array(
- 'message' => @odbc_errormsg(),
- 'code' => @odbc_error()
- );
+ if (function_exists('odbc_errormsg'))
+ {
+ $error = array(
+ 'message' => @odbc_errormsg(),
+ 'code' => @odbc_error(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
}
/**
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index c91cc188b0..b91372ac61 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -199,16 +199,18 @@ class dbal_mssqlnative extends dbal
var $m_insert_id = NULL;
var $last_query_text = '';
var $query_options = array();
+ var $connect_error = '';
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
{
- # Test for driver support, to avoid suppressed fatal error
+ // Test for driver support, to avoid suppressed fatal error
if (!function_exists('sqlsrv_connect'))
{
- trigger_error('Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx\n', E_USER_ERROR);
+ $this->connect_error = 'Native MS SQL Server driver for PHP is missing or needs to be updated. Version 1.1 or later is required to install phpBB3. You can download the driver from: http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx';
+ return $this->sql_error('');
}
//set up connection variables
@@ -219,7 +221,6 @@ class dbal_mssqlnative extends dbal
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
//connect to database
- error_reporting(E_ALL);
$this->db_connect_id = sqlsrv_connect($this->server, array(
'Database' => $this->dbname,
'UID' => $this->user,
@@ -436,7 +437,7 @@ class dbal_mssqlnative extends dbal
unset($row['line2'], $row['line3']);
}
}
- return $row;
+ return (sizeof($row)) ? $row : false;
}
/**
@@ -515,31 +516,43 @@ class dbal_mssqlnative extends dbal
*/
function _sql_error()
{
- $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
- $error_message = '';
- $code = 0;
-
- if ($errors != null)
+ if (function_exists('sqlsrv_errors'))
{
- foreach ($errors as $error)
+ $errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
+ $error_message = '';
+ $code = 0;
+
+ if ($errors != null)
+ {
+ foreach ($errors as $error)
+ {
+ $error_message .= "SQLSTATE: " . $error[ 'SQLSTATE'] . "\n";
+ $error_message .= "code: " . $error[ 'code'] . "\n";
+ $code = $error['code'];
+ $error_message .= "message: " . $error[ 'message'] . "\n";
+ }
+ $this->last_error_result = $error_message;
+ $error = $this->last_error_result;
+ }
+ else
{
- $error_message .= "SQLSTATE: ".$error[ 'SQLSTATE']."\n";
- $error_message .= "code: ".$error[ 'code']."\n";
- $code = $error['code'];
- $error_message .= "message: ".$error[ 'message']."\n";
+ $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
}
- $this->last_error_result = $error_message;
- $error = $this->last_error_result;
+
+ $error = array(
+ 'message' => $error,
+ 'code' => $code,
+ );
}
else
{
- $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
}
- return array(
- 'message' => $error,
- 'code' => $code,
- );
+ return $error;
}
/**
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 1ccb785150..252cb20bd4 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -30,6 +30,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
class dbal_mysql extends dbal
{
var $multi_insert = true;
+ var $connect_error = '';
/**
* Connect to server
@@ -44,7 +45,24 @@ class dbal_mysql extends dbal
$this->sql_layer = 'mysql4';
- $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
+ if ($this->persistency)
+ {
+ if (!function_exists('mysql_pconnect'))
+ {
+ $this->connect_error = 'mysql_pconnect function does not exist, is mysql extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $sqlpassword);
+ }
+ else
+ {
+ if (!function_exists('mysql_connect'))
+ {
+ $this->connect_error = 'mysql_connect function does not exist, is mysql extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
+ }
if ($this->db_connect_id && $this->dbname != '')
{
@@ -419,18 +437,29 @@ class dbal_mysql extends dbal
*/
function _sql_error()
{
- if (!$this->db_connect_id)
+ if ($this->db_connect_id)
+ {
+ $error = array(
+ 'message' => @mysql_error($this->db_connect_id),
+ 'code' => @mysql_errno($this->db_connect_id),
+ );
+ }
+ else if (function_exists('mysql_error'))
{
- return array(
+ $error = array(
'message' => @mysql_error(),
- 'code' => @mysql_errno()
+ 'code' => @mysql_errno(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
);
}
- return array(
- 'message' => @mysql_error($this->db_connect_id),
- 'code' => @mysql_errno($this->db_connect_id)
- );
+ return $error;
}
/**
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index a311b8cda6..69f1d26a40 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -27,12 +27,19 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
class dbal_mysqli extends dbal
{
var $multi_insert = true;
+ var $connect_error = '';
/**
* Connect to server
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false)
{
+ if (!function_exists('mysqli_connect'))
+ {
+ $this->connect_error = 'mysqli_connect function does not exist, is mysqli extension installed?';
+ 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->user = $sqluser;
@@ -416,18 +423,29 @@ class dbal_mysqli extends dbal
*/
function _sql_error()
{
- if (!$this->db_connect_id)
+ if ($this->db_connect_id)
+ {
+ $error = array(
+ 'message' => @mysqli_error($this->db_connect_id),
+ 'code' => @mysqli_errno($this->db_connect_id)
+ );
+ }
+ else if (function_exists('mysqli_connect_error'))
{
- return array(
+ $error = array(
'message' => @mysqli_connect_error(),
- 'code' => @mysqli_connect_errno()
+ 'code' => @mysqli_connect_errno(),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
);
}
- return array(
- 'message' => @mysqli_error($this->db_connect_id),
- 'code' => @mysqli_errno($this->db_connect_id)
- );
+ return $error;
}
/**
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 62b36aa8bf..4a7a4ecc8c 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -25,6 +25,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
class dbal_oracle extends dbal
{
var $last_query_text = '';
+ var $connect_error = '';
/**
* Connect to server
@@ -48,7 +49,33 @@ class dbal_oracle extends dbal
$connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database;
}
- $this->db_connect_id = ($new_link) ? @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8') : (($this->persistency) ? @ociplogon($this->user, $sqlpassword, $connect, 'UTF8') : @ocilogon($this->user, $sqlpassword, $connect, 'UTF8'));
+ if ($new_link)
+ {
+ if (!function_exists('ocinlogon'))
+ {
+ $this->connect_error = 'ocinlogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
+ else if ($this->persistency)
+ {
+ if (!function_exists('ociplogon'))
+ {
+ $this->connect_error = 'ociplogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
+ else
+ {
+ if (!function_exists('ocilogon'))
+ {
+ $this->connect_error = 'ocilogon function does not exist, is oci extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8');
+ }
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
}
@@ -647,17 +674,27 @@ class dbal_oracle extends dbal
*/
function _sql_error()
{
- $error = @ocierror();
- $error = (!$error) ? @ocierror($this->query_result) : $error;
- $error = (!$error) ? @ocierror($this->db_connect_id) : $error;
-
- if ($error)
+ if (function_exists('ocierror'))
{
- $this->last_error_result = $error;
+ $error = @ocierror();
+ $error = (!$error) ? @ocierror($this->query_result) : $error;
+ $error = (!$error) ? @ocierror($this->db_connect_id) : $error;
+
+ if ($error)
+ {
+ $this->last_error_result = $error;
+ }
+ else
+ {
+ $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
+ }
}
else
{
- $error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
}
return $error;
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 8de72fd394..557b057cce 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -25,6 +25,8 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
*/
class dbal_sqlite extends dbal
{
+ var $connect_error = '';
+
/**
* Connect to server
*/
@@ -36,7 +38,24 @@ class dbal_sqlite extends dbal
$this->dbname = $database;
$error = '';
- $this->db_connect_id = ($this->persistency) ? @sqlite_popen($this->server, 0666, $error) : @sqlite_open($this->server, 0666, $error);
+ if ($this->persistency)
+ {
+ if (!function_exists('sqlite_popen'))
+ {
+ $this->connect_error = 'sqlite_popen function does not exist, is sqlite extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @sqlite_popen($this->server, 0666, $error);
+ }
+ else
+ {
+ if (!function_exists('sqlite_open'))
+ {
+ $this->connect_error = 'sqlite_open function does not exist, is sqlite extension installed?';
+ return $this->sql_error('');
+ }
+ $this->db_connect_id = @sqlite_open($this->server, 0666, $error);
+ }
if ($this->db_connect_id)
{
@@ -281,10 +300,22 @@ class dbal_sqlite extends dbal
*/
function _sql_error()
{
- return array(
- 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
- 'code' => @sqlite_last_error($this->db_connect_id)
- );
+ if (function_exists('sqlite_error_string'))
+ {
+ $error = array(
+ 'message' => @sqlite_error_string(@sqlite_last_error($this->db_connect_id)),
+ 'code' => @sqlite_last_error($this->db_connect_id),
+ );
+ }
+ else
+ {
+ $error = array(
+ 'message' => $this->connect_error,
+ 'code' => '',
+ );
+ }
+
+ return $error;
}
/**
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 5914831539..eef4ade4e7 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -137,7 +137,18 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
}
/**
-* Set config value. Creates missing config entry.
+* Sets a configuration option's value.
+*
+* Please note that this function does not update the is_dynamic value for
+* an already existing config option.
+*
+* @param string $config_name The configuration option's name
+* @param string $config_value New configuration value
+* @param bool $is_dynamic Whether this variable should be cached (false) or
+* if it changes too frequently (true) to be
+* efficiently cached.
+*
+* @return null
*/
function set_config($config_name, $config_value, $is_dynamic = false)
{
@@ -166,7 +177,15 @@ function set_config($config_name, $config_value, $is_dynamic = false)
}
/**
-* Set dynamic config value with arithmetic operation.
+* Increments an integer config value directly in the database.
+*
+* @param string $config_name The configuration option's name
+* @param int $increment Amount to increment by
+* @param bool $is_dynamic Whether this variable should be cached (false) or
+* if it changes too frequently (true) to be
+* efficiently cached.
+*
+* @return null
*/
function set_config_count($config_name, $increment, $is_dynamic = false)
{
@@ -289,7 +308,8 @@ function phpbb_gmgetdate($time = false)
/**
* Return formatted string for filesizes
*
-* @param int $value filesize in bytes
+* @param mixed $value filesize in bytes
+* (non-negative number; int, float or string)
* @param bool $string_only true if language string should be returned
* @param array $allowed_units only allow these units (data array indexes)
*
@@ -301,6 +321,12 @@ function get_formatted_filesize($value, $string_only = true, $allowed_units = fa
global $user;
$available_units = array(
+ 'tb' => array(
+ 'min' => 1099511627776, // pow(2, 40)
+ 'index' => 4,
+ 'si_unit' => 'TB',
+ 'iec_unit' => 'TIB',
+ ),
'gb' => array(
'min' => 1073741824, // pow(2, 30)
'index' => 3,
@@ -476,6 +502,13 @@ function phpbb_hash($password)
*/
function phpbb_check_hash($password, $hash)
{
+ if (strlen($password) > 4096)
+ {
+ // If the password is too huge, we will simply reject it
+ // and not let the server try to hash it.
+ return false;
+ }
+
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
if (strlen($hash) == 34)
{
@@ -979,7 +1012,7 @@ if (!function_exists('stripos'))
*/
function is_absolute($path)
{
- return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false;
+ return (isset($path[0]) && $path[0] == '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
}
/**
@@ -1176,6 +1209,36 @@ else
}
}
+/**
+* Eliminates useless . and .. components from specified path.
+*
+* @param string $path Path to clean
+* @return string Cleaned path
+*/
+function phpbb_clean_path($path)
+{
+ $exploded = explode('/', $path);
+ $filtered = array();
+ foreach ($exploded as $part)
+ {
+ if ($part === '.' && !empty($filtered))
+ {
+ continue;
+ }
+
+ if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '..')
+ {
+ array_pop($filtered);
+ }
+ else
+ {
+ $filtered[] = $part;
+ }
+ }
+ $path = implode('/', $filtered);
+ return $path;
+}
+
if (!function_exists('htmlspecialchars_decode'))
{
/**
@@ -2684,7 +2747,7 @@ function meta_refresh($time, $url, $disable_cd_check = false)
// For XHTML compatibility we change back & to &amp;
$template->assign_vars(array(
- 'META' => '<meta http-equiv="refresh" content="' . $time . ';url=' . $url . '" />')
+ 'META' => '<meta http-equiv="refresh" content="' . $time . '; url=' . $url . '" />')
);
return $url;
@@ -2708,7 +2771,7 @@ function meta_refresh($time, $url, $disable_cd_check = false)
*
* @param int $code HTTP status code
* @param string $message Message for the status code
-* @return void
+* @return null
*/
function send_status_line($code, $message)
{
@@ -2811,7 +2874,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
$diff = time() - $creation_time;
// If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)...
- if ($diff && ($diff <= $timespan || $timespan === -1))
+ if (defined('DEBUG_TEST') || $diff && ($diff <= $timespan || $timespan === -1))
{
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
$key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid);
@@ -3216,6 +3279,7 @@ function login_forum_box($forum_data)
page_header($user->lang['LOGIN'], false);
$template->assign_vars(array(
+ 'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',
'S_LOGIN_ACTION' => build_url(array('f')),
'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id'])))
);
@@ -3921,7 +3985,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo ' </div>';
echo ' </div>';
echo ' <div id="page-footer">';
- echo ' Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
+ echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
echo ' </div>';
echo '</div>';
echo '</body>';
@@ -4295,7 +4359,7 @@ function phpbb_optionset($bit, $set, $data)
*
* @param array $param Parameter array, see $param_defaults array.
*
-* @return void
+* @return null
*/
function phpbb_http_login($param)
{
@@ -4741,7 +4805,7 @@ function page_footer($run_cron = true)
$template->assign_vars(array(
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
- 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
+ 'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 204fa9a43d..2f73858ea2 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2294,6 +2294,21 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
}
/**
+* remove_comments will strip the sql comment lines out of an uploaded sql file
+* specifically for mssql and postgres type files in the install....
+*
+* @deprecated Use phpbb_remove_comments() instead.
+*/
+function remove_comments(&$output)
+{
+ // Remove /* */ comments (http://ostermiller.org/findcomment.html)
+ $output = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $output);
+
+ // Return by reference and value.
+ return $output;
+}
+
+/**
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
* and group names must be carried through for the moderators table
*/
@@ -3106,7 +3121,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
if ($fsock = @fsockopen($host, $port, $errno, $errstr, $timeout))
{
- @fputs($fsock, "GET $directory/$filename HTTP/1.1\r\n");
+ @fputs($fsock, "GET $directory/$filename HTTP/1.0\r\n");
@fputs($fsock, "HOST: $host\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");
@@ -3304,7 +3319,7 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $
$info = get_remote_file('version.phpbb.com', '/phpbb',
((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
- if ($info === false)
+ if (empty($info))
{
$cache->destroy('versioncheck');
if ($warn_fail)
@@ -3328,7 +3343,7 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $
* @param int $flag The binary flag which is OR-ed with the current column value
* @param string $sql_more This string is attached to the sql query generated to update the table.
*
- * @return void
+ * @return null
*/
function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '')
{
diff --git a/phpBB/includes/functions_database_helper.php b/phpBB/includes/functions_database_helper.php
new file mode 100644
index 0000000000..664c246888
--- /dev/null
+++ b/phpBB/includes/functions_database_helper.php
@@ -0,0 +1,206 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Updates rows in given table from a set of values to a new value.
+* If this results in rows violating uniqueness constraints, the duplicate
+* rows are eliminated.
+*
+* The only supported table is bookmarks.
+*
+* @param dbal $db Database object
+* @param string $table Table on which to perform the update
+* @param string $column Column whose values to change
+* @param array $from_values An array of values that should be changed
+* @param int $to_value The new value
+* @return null
+*/
+function phpbb_update_rows_avoiding_duplicates($db, $table, $column, $from_values, $to_value)
+{
+ $sql = "SELECT $column, user_id
+ FROM $table
+ WHERE " . $db->sql_in_set($column, $from_values);
+ $result = $db->sql_query($sql);
+
+ $old_user_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $old_user_ids[$row[$column]][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql = "SELECT $column, user_id
+ FROM $table
+ WHERE $column = " . (int) $to_value;
+ $result = $db->sql_query($sql);
+
+ $new_user_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $new_user_ids[$row[$column]][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $queries = array();
+ foreach ($from_values as $from_value)
+ {
+ if (!isset($old_user_ids[$from_value]))
+ {
+ continue;
+ }
+ if (empty($new_user_ids))
+ {
+ $sql = "UPDATE $table
+ SET $column = " . (int) $to_value . "
+ WHERE $column = '" . $db->sql_escape($from_value) . "'";
+ $queries[] = $sql;
+ }
+ else
+ {
+ $different_user_ids = array_diff($old_user_ids[$from_value], $new_user_ids[$to_value]);
+ if (!empty($different_user_ids))
+ {
+ $sql = "UPDATE $table
+ SET $column = " . (int) $to_value . "
+ WHERE $column = '" . $db->sql_escape($from_value) . "'
+ AND " . $db->sql_in_set('user_id', $different_user_ids);
+ $queries[] = $sql;
+ }
+ }
+ }
+
+ if (!empty($queries))
+ {
+ $db->sql_transaction('begin');
+
+ foreach ($queries as $sql)
+ {
+ $db->sql_query($sql);
+ }
+
+ $sql = "DELETE FROM $table
+ WHERE " . $db->sql_in_set($column, $from_values);
+ $db->sql_query($sql);
+
+ $db->sql_transaction('commit');
+ }
+}
+
+/**
+* Updates rows in given table from a set of values to a new value.
+* If this results in rows violating uniqueness constraints, the duplicate
+* rows are merged respecting notify_status (0 takes precedence over 1).
+*
+* The only supported table is topics_watch.
+*
+* @param dbal $db Database object
+* @param string $table Table on which to perform the update
+* @param string $column Column whose values to change
+* @param array $from_values An array of values that should be changed
+* @param int $to_value The new value
+* @return null
+*/
+function phpbb_update_rows_avoiding_duplicates_notify_status($db, $table, $column, $from_values, $to_value)
+{
+ $sql = "SELECT $column, user_id, notify_status
+ FROM $table
+ WHERE " . $db->sql_in_set($column, $from_values);
+ $result = $db->sql_query($sql);
+
+ $old_user_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $old_user_ids[(int) $row['notify_status']][$row[$column]][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql = "SELECT $column, user_id
+ FROM $table
+ WHERE $column = " . (int) $to_value;
+ $result = $db->sql_query($sql);
+
+ $new_user_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $new_user_ids[$row[$column]][] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $queries = array();
+ $extra_updates = array(
+ 0 => 'notify_status = 0',
+ 1 => '',
+ );
+ foreach ($from_values as $from_value)
+ {
+ foreach ($extra_updates as $notify_status => $extra_update)
+ {
+ if (!isset($old_user_ids[$notify_status][$from_value]))
+ {
+ continue;
+ }
+ if (empty($new_user_ids))
+ {
+ $sql = "UPDATE $table
+ SET $column = " . (int) $to_value . "
+ WHERE $column = '" . $db->sql_escape($from_value) . "'";
+ $queries[] = $sql;
+ }
+ else
+ {
+ $different_user_ids = array_diff($old_user_ids[$notify_status][$from_value], $new_user_ids[$to_value]);
+ if (!empty($different_user_ids))
+ {
+ $sql = "UPDATE $table
+ SET $column = " . (int) $to_value . "
+ WHERE $column = '" . $db->sql_escape($from_value) . "'
+ AND " . $db->sql_in_set('user_id', $different_user_ids);
+ $queries[] = $sql;
+ }
+
+ if ($extra_update)
+ {
+ $same_user_ids = array_diff($old_user_ids[$notify_status][$from_value], $different_user_ids);
+ if (!empty($same_user_ids))
+ {
+ $sql = "UPDATE $table
+ SET $extra_update
+ WHERE $column = '" . (int) $to_value . "'
+ AND " . $db->sql_in_set('user_id', $same_user_ids);
+ $queries[] = $sql;
+ }
+ }
+ }
+ }
+ }
+
+ if (!empty($queries))
+ {
+ $db->sql_transaction('begin');
+
+ foreach ($queries as $sql)
+ {
+ $db->sql_query($sql);
+ }
+
+ $sql = "DELETE FROM $table
+ WHERE " . $db->sql_in_set($column, $from_values);
+ $db->sql_query($sql);
+
+ $db->sql_transaction('commit');
+ }
+}
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 9e9c48ff58..47f4eac627 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -50,15 +50,19 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'firebird',
'MODULE' => 'interbase',
'DELIM' => ';;',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'firebird',
'AVAILABLE' => true,
'2.0.x' => false,
),
+ // Note: php 5.5 alpha 2 deprecated mysql.
+ // Keep mysqli before mysql in this list.
'mysqli' => array(
'LABEL' => 'MySQL with MySQLi Extension',
'SCHEMA' => 'mysql_41',
'MODULE' => 'mysqli',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'mysqli',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -68,6 +72,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'mysql',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -77,6 +82,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssql',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -86,6 +92,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssql_odbc',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -95,6 +102,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'mssql',
'MODULE' => 'sqlsrv',
'DELIM' => 'GO',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'mssqlnative',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -104,6 +112,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'oracle',
'MODULE' => 'oci8',
'DELIM' => '/',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'oracle',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -113,6 +122,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_comments',
'DRIVER' => 'postgres',
'AVAILABLE' => true,
'2.0.x' => true,
@@ -122,6 +132,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite',
'DELIM' => ';',
+ 'COMMENTS' => 'remove_remarks',
'DRIVER' => 'sqlite',
'AVAILABLE' => true,
'2.0.x' => false,
@@ -465,16 +476,39 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
/**
* Removes comments from schema files
+*
+* @deprecated Use phpbb_remove_comments() instead.
*/
-function remove_comments($sql)
+function remove_remarks(&$sql)
{
- // Remove /* */ comments (http://ostermiller.org/findcomment.html)
- $sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql);
-
// Remove # style comments
$sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
- return $sql;
+ // Return by reference
+}
+
+/**
+* Removes "/* style" as well as "# style" comments from $input.
+*
+* @param string $input Input string
+*
+* @return string Input string with comments removed
+*/
+function phpbb_remove_comments($input)
+{
+ if (!function_exists('remove_comments'))
+ {
+ global $phpbb_root_path, $phpEx;
+ require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
+
+ // Remove /* */ comments
+ remove_comments($input);
+
+ // Remove # style comments
+ remove_remarks($input);
+
+ return $input;
}
/**
@@ -519,10 +553,12 @@ function adjust_language_keys_callback($matches)
* @param string $dbms The name of the DBAL class to use
* @param array $load_extensions Array of additional extensions that should be loaded
* @param bool $debug If the debug constants should be enabled by default or not
+* @param bool $debug_test If the DEBUG_TEST constant should be added
+* NOTE: Only for use within the testing framework
*
* @return string The output to write to the file
*/
-function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false)
+function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug = false, $debug_test = false)
{
$load_extensions = implode(',', $load_extensions);
@@ -559,6 +595,11 @@ function phpbb_create_config_file_data($data, $dbms, $load_extensions, $debug =
$config_data .= "// @define('DEBUG_EXTRA', true);\n";
}
+ if ($debug_test)
+ {
+ $config_data .= "@define('DEBUG_TEST', true);\n";
+ }
+
return $config_data;
}
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 16dce16a72..2054124a4e 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -250,7 +250,7 @@ class jabber
return true;
}
- // Apparently an error occured...
+ // Apparently an error occurred...
$this->add_to_log('Error: open_socket() - ' . $errorstr);
return false;
}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 6549693333..db2dea33e8 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -390,6 +390,28 @@ class messenger
}
/**
+ * Generates a valid message id to be used in emails
+ *
+ * @return string message id
+ */
+ function generate_message_id()
+ {
+ global $config;
+
+ $domain = 'phpbb.generated';
+ if ($config['server_name'])
+ {
+ $domain = $config['server_name'];
+ }
+ else if (!empty($_SERVER['SERVER_NAME']))
+ {
+ $domain = $_SERVER['SERVER_NAME'];
+ }
+
+ return md5(unique_id(time())) . '@' . $domain;
+ }
+
+ /**
* Return email header
*/
function build_header($to, $cc, $bcc)
@@ -415,7 +437,7 @@ class messenger
$headers[] = 'Return-Path: <' . $config['board_email'] . '>';
$headers[] = 'Sender: <' . $config['board_email'] . '>';
$headers[] = 'MIME-Version: 1.0';
- $headers[] = 'Message-ID: <' . md5(unique_id(time())) . '@' . $config['server_name'] . '>';
+ $headers[] = 'Message-ID: <' . $this->generate_message_id() . '>';
$headers[] = 'Date: ' . date('r', time());
$headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed
$headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit
@@ -715,14 +737,21 @@ class queue
$lock_fp = $this->lock();
- set_config('last_queue_run', time(), true);
-
- if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval'])
+ // avoid races, check file existence once
+ $have_cache_file = file_exists($this->cache_file);
+ if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval'])
{
+ if (!$have_cache_file)
+ {
+ set_config('last_queue_run', time(), true);
+ }
+
$this->unlock($lock_fp);
return;
}
+ set_config('last_queue_run', time(), true);
+
include($this->cache_file);
foreach ($this->queue_data as $object => $data_ary)
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 68b6199cf5..11a5067ef9 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -288,13 +288,15 @@ function posting_gen_topic_icons($mode, $icon_id)
if (sizeof($icons))
{
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+
foreach ($icons as $id => $data)
{
if ($data['display'])
{
$template->assign_block_vars('topic_icon', array(
'ICON_ID' => $id,
- 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'],
+ 'ICON_IMG' => $root_path . $config['icons_path'] . '/' . $data['img'],
'ICON_WIDTH' => $data['width'],
'ICON_HEIGHT' => $data['height'],
@@ -421,16 +423,6 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
$cat_id = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] : ATTACHMENT_CATEGORY_NONE;
- // Make sure the image category only holds valid images...
- if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image())
- {
- $file->remove();
-
- // If this error occurs a user tried to exploit an IE Bug by renaming extensions
- // Since the image category is displaying content inline we need to catch this.
- trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']);
- }
-
// Do we have to create a thumbnail?
$filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0;
@@ -471,6 +463,16 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
return $filedata;
}
+ // Make sure the image category only holds valid images...
+ if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image())
+ {
+ $file->remove();
+
+ // If this error occurs a user tried to exploit an IE Bug by renaming extensions
+ // Since the image category is displaying content inline we need to catch this.
+ trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']);
+ }
+
$filedata['filesize'] = $file->get('filesize');
$filedata['mimetype'] = $file->get('mimetype');
$filedata['extension'] = $file->get('extension');
@@ -1167,7 +1169,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
/**
* User Notification
*/
-function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id)
+function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id, $topic_id, $post_id, $author_name = '')
{
global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
@@ -1338,6 +1340,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
'USERNAME' => htmlspecialchars_decode($addr['name']),
'TOPIC_TITLE' => htmlspecialchars_decode($topic_title),
'FORUM_NAME' => htmlspecialchars_decode($forum_name),
+ 'AUTHOR_NAME' => htmlspecialchars_decode($author_name),
'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
@@ -1695,8 +1698,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// The variable name should be $post_approved, because it indicates if the post is approved or not
$post_approval = 1;
- // Check the permissions for post approval. Moderators are not affected.
- if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']))
+ // Check the permissions for post approval.
+ // Moderators must go through post approval like ordinary users.
+ if (!$auth->acl_get('f_noapprove', $data['forum_id']))
{
// Post not approved, but in queue
$post_approval = 0;
@@ -2600,7 +2604,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Send Notifications
if (($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_approval)
{
- user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);
+ // If a username was supplied or the poster is a guest, we will use the supplied username.
+ // Doing it this way we can use "...post by guest-username..." in notifications when
+ // "guest-username" is supplied or ommit the username if it is not.
+ $username = ($username !== '' || !$user->data['is_registered']) ? $username : $user->data['username'];
+ user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id'], $username);
}
$params = $add_anchor = '';
@@ -2637,7 +2645,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
* - 'topic_last_post_subject'
* - 'topic_last_poster_name'
* - 'topic_last_poster_colour'
-* @param int $bump_time The time at which topic was bumped, usually it is a current time as obtained via time().
+* @param int $bump_time The time at which topic was bumped, usually it is a current time as obtained via time().
* @return string An URL to the bumped topic, example: ./viewtopic.php?forum_id=1&amptopic_id=2&ampp=3#p3
*/
function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false)
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 261ed45727..b08d6e7f5c 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1103,127 +1103,166 @@ function phpbb_delete_user_pms($user_id)
// Get PM Information for later deleting
// The two queries where split, so we can use our indexes
+ $undelivered_msg = $delete_ids = array();
+
// Part 1: get PMs the user received
- $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ $sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user_id;
$result = $db->sql_query($sql);
- $undelivered_msg = $undelivered_user = $delete_ids = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
- {
- // Undelivered messages
- $undelivered_msg[] = $row['msg_id'];
-
- if (isset($undelivered_user[$row['user_id']]))
- {
- ++$undelivered_user[$row['user_id']];
- }
- else
- {
- $undelivered_user[$row['user_id']] = 1;
- }
- }
-
- $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ $msg_id = (int) $row['msg_id'];
+ $delete_ids[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
- // Part 2: get PMs the user sent
- $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new
+ // Part 2: get PMs the user sent, but have yet to be received
+ // We cannot simply delete them. First we have to check,
+ // whether another user already received and read the message.
+ $sql = 'SELECT msg_id
FROM ' . PRIVMSGS_TO_TABLE . '
WHERE author_id = ' . $user_id . '
- AND folder_id = ' . PRIVMSGS_NO_BOX;
+ AND folder_id = ' . PRIVMSGS_NO_BOX;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
- if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX)
- {
- // Undelivered messages
- $undelivered_msg[] = $row['msg_id'];
-
- if (isset($undelivered_user[$row['user_id']]))
- {
- ++$undelivered_user[$row['user_id']];
- }
- else
- {
- $undelivered_user[$row['user_id']] = 1;
- }
- }
-
- $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id'];
+ $msg_id = (int) $row['msg_id'];
+ $undelivered_msg[$msg_id] = $msg_id;
}
$db->sql_freeresult($result);
- if (empty($delete_ids))
+ if (empty($delete_ids) && empty($undelivered_msg))
{
return false;
}
$db->sql_transaction('begin');
- if (sizeof($undelivered_msg))
- {
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
- $db->sql_query($sql);
- }
+ if (!empty($undelivered_msg))
+ {
+ // A pm is delivered, if for any recipient the message was moved
+ // from their NO_BOX to another folder. We do not delete such
+ // messages, but only delete them for users, who have not yet
+ // received them.
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE author_id = ' . $user_id . '
+ AND folder_id <> ' . PRIVMSGS_NO_BOX . '
+ AND folder_id <> ' . PRIVMSGS_OUTBOX . '
+ AND folder_id <> ' . PRIVMSGS_SENTBOX;
+ $result = $db->sql_query($sql);
- // Reset the user´s pm count to 0
- if (isset($undelivered_user[$user_id]))
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_new_privmsg = 0,
- user_unread_privmsg = 0
- WHERE user_id = ' . $user_id;
- $db->sql_query($sql);
- unset($undelivered_user[$user_id]);
- }
+ $delivered_msg = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $msg_id = (int) $row['msg_id'];
+ $delivered_msg[$msg_id] = $msg_id;
+ unset($undelivered_msg[$msg_id]);
+ }
+ $db->sql_freeresult($result);
- foreach ($undelivered_user as $_user_id => $count)
- {
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_new_privmsg = user_new_privmsg - ' . $count . ',
- user_unread_privmsg = user_unread_privmsg - ' . $count . '
- WHERE user_id = ' . $_user_id;
- $db->sql_query($sql);
- }
+ $undelivered_user = array();
- // Delete private message data
- $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
- WHERE user_id = $user_id
- AND " . $db->sql_in_set('msg_id', $delete_ids);
- $db->sql_query($sql);
+ // Count the messages we delete, so we can correct the user pm data
+ $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE author_id = ' . $user_id . '
+ AND folder_id = ' . PRIVMSGS_NO_BOX . '
+ AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . '
+ GROUP BY user_id';
+ $result = $db->sql_query($sql);
- // Now we have to check which messages we can delete completely
- $sql = 'SELECT msg_id
- FROM ' . PRIVMSGS_TO_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
- $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $num_pms = (int) $row['num_undelivered_privmsgs'];
+ $undelivered_user[$num_pms][] = (int) $row['user_id'];
- while ($row = $db->sql_fetchrow($result))
- {
- unset($delete_ids[$row['msg_id']]);
+ if (sizeof($undelivered_user[$num_pms]) > 50)
+ {
+ // If there are too many users affected the query might get
+ // too long, so we update the value for the first bunch here.
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
+ user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
+ WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]);
+ $db->sql_query($sql);
+ unset($undelivered_user[$num_pms]);
+ }
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($undelivered_user as $num_pms => $undelivered_user_set)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ',
+ user_unread_privmsg = user_unread_privmsg - ' . $num_pms . '
+ WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set);
+ $db->sql_query($sql);
+ }
+
+ if (!empty($delivered_msg))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE folder_id = ' . PRIVMSGS_NO_BOX . '
+ AND ' . $db->sql_in_set('msg_id', $delivered_msg);
+ $db->sql_query($sql);
+ }
+
+ if (!empty($undelivered_msg))
+ {
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
+ $db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
+ $db->sql_query($sql);
+ }
}
- $db->sql_freeresult($result);
+
+ // Reset the user's pm count to 0
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_new_privmsg = 0,
+ user_unread_privmsg = 0
+ WHERE user_id = ' . $user_id;
+ $db->sql_query($sql);
+
+ // Delete private message data of the user
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE user_id = ' . (int) $user_id;
+ $db->sql_query($sql);
if (!empty($delete_ids))
{
- // Check if there are any attachments we need to remove
- if (!function_exists('delete_attachments'))
+ // Now we have to check which messages we can delete completely
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ unset($delete_ids[$row['msg_id']]);
}
+ $db->sql_freeresult($result);
- delete_attachments('message', $delete_ids, false);
+ if (!empty($delete_ids))
+ {
+ // Check if there are any attachments we need to remove
+ if (!function_exists('delete_attachments'))
+ {
+ include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+ }
- $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
- WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
- $db->sql_query($sql);
+ delete_attachments('message', $delete_ids, false);
+
+ $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+ WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
+ $db->sql_query($sql);
+ }
}
// Set the remaining author id to anonymous
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 16c193c15a..8573533c2c 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -122,7 +122,7 @@ class custom_profile
case FIELD_BOOL:
$field_value = (bool) $field_value;
-
+
if (!$field_value && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
@@ -134,7 +134,7 @@ class custom_profile
{
return false;
}
-
+
$field_value = (int) $field_value;
if ($field_value < $field_data['field_minlen'])
@@ -456,6 +456,8 @@ class custom_profile
$user_fields = array();
+ $user_ids = $user_id;
+
// Go through the fields in correct order
foreach (array_keys($this->profile_cache) as $used_ident)
{
@@ -464,6 +466,15 @@ class custom_profile
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
+
+ foreach ($user_ids as $user_id)
+ {
+ if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue'])
+ {
+ $user_fields[$user_id][$used_ident]['value'] = '';
+ $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
+ }
+ }
}
return $user_fields;
@@ -521,7 +532,7 @@ class custom_profile
switch ($this->profile_types[$field_type])
{
case 'int':
- if ($value === '')
+ if ($value === '' && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -530,7 +541,7 @@ class custom_profile
case 'string':
case 'text':
- if (!$value)
+ if (!$value && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -548,7 +559,7 @@ class custom_profile
$month = (isset($date[1])) ? (int) $date[1] : 0;
$year = (isset($date[2])) ? (int) $date[2] : 0;
- if (!$day && !$month && !$year)
+ if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -571,12 +582,7 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false);
}
- // If a dropdown field is required, users
- // cannot choose the "no value" option.
- // They must choose one of the other options.
- // Therefore, here we treat a value equal to
- // the "no value" as a lack of value, i.e. NULL.
- if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required'])
+ if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue'])
{
return NULL;
}
@@ -586,7 +592,14 @@ class custom_profile
// User not having a value assigned
if (!isset($this->options_lang[$field_id][$lang_id][$value]))
{
- return NULL;
+ if ($ident_ary['data']['field_show_novalue'])
+ {
+ $value = $ident_ary['data']['field_novalue'];
+ }
+ else
+ {
+ return NULL;
+ }
}
return $this->options_lang[$field_id][$lang_id][$value];
@@ -600,6 +613,11 @@ class custom_profile
$this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
}
+ if (!$value && $ident_ary['data']['field_show_novalue'])
+ {
+ $value = $ident_ary['data']['field_default_value'];
+ }
+
if ($ident_ary['data']['field_length'] == 1)
{
return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL;
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 7a79e6276f..cd8339d58a 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1250,8 +1250,9 @@ function validate_data($data, $val_ary)
{
$function = array_shift($validate);
array_unshift($validate, $data[$var]);
+ $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
- if ($result = call_user_func_array('validate_' . $function, $validate))
+ if ($result = call_user_func_array($function_prefix . $function, $validate))
{
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
@@ -1556,7 +1557,7 @@ function validate_username($username, $allowed_username = false)
*/
function validate_password($password)
{
- global $config, $db, $user;
+ global $config;
if ($password === '' || $config['pass_complex'] === 'PASS_TYPE_ANY')
{
@@ -1902,6 +1903,30 @@ function validate_jabber($jid)
}
/**
+* Validate hex colour value
+*
+* @param string $colour The hex colour value
+* @param bool $optional Whether the colour value is optional. True if an empty
+* string will be accepted as correct input, false if not.
+* @return bool|string Error message if colour value is incorrect, false if it
+* fits the hex colour code
+*/
+function phpbb_validate_hex_colour($colour, $optional = false)
+{
+ if ($colour === '')
+ {
+ return (($optional) ? false : 'WRONG_DATA');
+ }
+
+ if (!preg_match('/^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/', $colour))
+ {
+ return 'WRONG_DATA';
+ }
+
+ return false;
+}
+
+/**
* Verifies whether a style ID corresponds to an active style.
*
* @param int $style_id The style_id of a style which should be checked if activated or not.
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index b70601b479..04e0e70f1d 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -414,13 +414,16 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
- // If the topic no longer exist, we will update the topic watch table.
- // To not let it error out on users watching both topics, we just return on an error...
- $db->sql_return_on_error(true);
- $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
- $db->sql_return_on_error(false);
+ if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status'))
+ {
+ include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
+ }
+
+ // Update the topic watch table.
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $topic_ids, $to_topic_id);
- $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
+ // Update the bookmarks table.
+ phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $topic_ids, $to_topic_id);
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index ffede11d37..0cef8933fc 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -1231,6 +1231,7 @@ function mcp_fork_topic($topic_ids)
}
}
+ // Copy topic subscriptions to new topic
$sql = 'SELECT user_id, notify_status
FROM ' . TOPICS_WATCH_TABLE . '
WHERE topic_id = ' . $topic_id;
@@ -1251,6 +1252,27 @@ function mcp_fork_topic($topic_ids)
{
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
}
+
+ // Copy bookmarks to new topic
+ $sql = 'SELECT user_id
+ FROM ' . BOOKMARKS_TABLE . '
+ WHERE topic_id = ' . $topic_id;
+ $result = $db->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary[] = array(
+ 'topic_id' => (int) $new_topic_id,
+ 'user_id' => (int) $row['user_id'],
+ );
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($sql_ary))
+ {
+ $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
+ }
}
// Sync new topics, parent forums and board stats
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 72f77fae7c..77bc7680e6 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -123,6 +123,7 @@ class mcp_pm_reports
$message = bbcode_nl2br($message);
$message = smiley_text($message);
+ $report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($pm_info['message_attachment'] && $auth->acl_get('u_pm_download'))
{
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 7d4edaf362..8e0e89e3da 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -517,6 +517,49 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
WHERE post_id = {$post_id_list[0]}";
$db->sql_query($sql);
+ // Copy topic subscriptions to new topic
+ $sql = 'SELECT user_id, notify_status
+ FROM ' . TOPICS_WATCH_TABLE . '
+ WHERE topic_id = ' . $topic_id;
+ $result = $db->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary[] = array(
+ 'topic_id' => (int) $to_topic_id,
+ 'user_id' => (int) $row['user_id'],
+ 'notify_status' => (int) $row['notify_status'],
+ );
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($sql_ary))
+ {
+ $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
+ }
+
+ // Copy bookmarks to new topic
+ $sql = 'SELECT user_id
+ FROM ' . BOOKMARKS_TABLE . '
+ WHERE topic_id = ' . $topic_id;
+ $result = $db->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary[] = array(
+ 'topic_id' => (int) $to_topic_id,
+ 'user_id' => (int) $row['user_id'],
+ );
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($sql_ary))
+ {
+ $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
+ }
+
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Update forum statistics
@@ -619,13 +662,16 @@ function merge_posts($topic_id, $to_topic_id)
}
else
{
+ if (!function_exists('phpbb_update_rows_avoiding_duplicates_notify_status'))
+ {
+ include($phpbb_root_path . 'includes/functions_database_helper.' . $phpEx);
+ }
+
// If the topic no longer exist, we will update the topic watch table.
- // To not let it error out on users watching both topics, we just return on an error...
- $db->sql_return_on_error(true);
- $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id);
- $db->sql_return_on_error(false);
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', array($topic_id), $to_topic_id);
- $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id);
+ // If the topic no longer exist, we will update the bookmarks table.
+ phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', array($topic_id), $to_topic_id);
}
// Link to the new topic
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index cbd7638809..3268775cb6 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -71,7 +71,7 @@ class phpbb_questionnaire_data_collector
/**
* Collect info into the data property.
*
- * @return void
+ * @return null
*/
function collect()
{
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 779ec1d216..f28b8885e7 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -86,9 +86,16 @@ class fulltext_mysql extends search_backend
$engine = $info['Type'];
}
- if ($engine != 'MyISAM')
+ $fulltext_supported =
+ $engine === 'MyISAM' ||
+ // FULLTEXT is supported on InnoDB since MySQL 5.6.4 according to
+ // http://dev.mysql.com/doc/refman/5.6/en/innodb-storage-engine.html
+ $engine === 'InnoDB' &&
+ phpbb_version_compare($db->sql_server_info(true), '5.6.4', '>=');
+
+ if (!$fulltext_supported)
{
- return $user->lang['FULLTEXT_MYSQL_NOT_MYISAM'];
+ return $user->lang['FULLTEXT_MYSQL_NOT_SUPPORTED'];
}
$sql = 'SHOW VARIABLES
@@ -747,7 +754,7 @@ class fulltext_mysql extends search_backend
{
if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
{
- //$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
+ $alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
}
else
{
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 496c12a0d1..fe5357f32e 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -325,7 +325,7 @@ class session
// if no session id is set, redirect to index.php
if (defined('NEED_SID') && (!isset($_GET['sid']) || $this->session_id !== $_GET['sid']))
{
- send_status_line(401, 'Not authorized');
+ send_status_line(401, 'Unauthorized');
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
@@ -1661,7 +1661,7 @@ class user extends session
if (!$this->theme)
{
- trigger_error('Could not get style data', E_USER_ERROR);
+ trigger_error('NO_STYLE_DATA', E_USER_ERROR);
}
// Now parse the cfg file and cache it
@@ -2156,7 +2156,8 @@ class user extends session
'is_short' => strpos($format, '|'),
'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
'format_long' => str_replace('|', '', $format),
- 'lang' => $this->lang['datetime'],
+ // Filter out values that are not strings (e.g. arrays) for strtr().
+ 'lang' => array_filter($this->lang['datetime'], 'is_string'),
);
// Short representation of month in format? Some languages use different terms for the long and short format of May
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index d19b80f4c0..4591776768 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -21,7 +21,7 @@ class ucp_profile_info
'version' => '1.0.0',
'modes' => array(
'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')),
- 'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
+ 'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')),
'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
),
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 82c1937919..b262dc5c1c 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -51,7 +51,7 @@ class ucp_activate
trigger_error('ALREADY_ACTIVATED');
}
- if (($user_row['user_inactive_reason'] == INACTIVE_MANUAL) || $user_row['user_actkey'] != $key)
+ if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] !== $key)
{
trigger_error('WRONG_ACTIVATION');
}
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index d62dbb1866..663b5bc931 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -595,6 +595,13 @@ class ucp_groups
$error[] = $user->lang['FORM_INVALID'];
}
+ // Validate submitted colour value
+ if ($colour_error = validate_data($submit_ary, array('colour' => array('hex_colour', true))))
+ {
+ // Replace "error" string with its real, localised form
+ $error = array_merge($error, $colour_error);
+ }
+
if (!sizeof($error))
{
// Only set the rank, colour, etc. if it's changed or if we're adding a new
@@ -635,6 +642,7 @@ class ucp_groups
if (sizeof($error))
{
+ $error = array_map(array(&$user, 'lang'), $error);
$group_rank = $submit_ary['rank'];
$group_desc_data = array(
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 05243e3d7a..d7509a1072 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -271,19 +271,16 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Passworded forum?
if ($post['forum_id'])
{
- $sql = 'SELECT forum_password
+ $sql = 'SELECT forum_id, forum_name, forum_password
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . (int) $post['forum_id'];
$result = $db->sql_query($sql);
- $forum_password = (string) $db->sql_fetchfield('forum_password');
+ $forum_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if ($forum_password)
+ if (!empty($forum_data['forum_password']))
{
- login_forum_box(array(
- 'forum_id' => $post['forum_id'],
- 'forum_password' => $forum_password,
- ));
+ login_forum_box($forum_data);
}
}
}
@@ -359,7 +356,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$message_attachment = 0;
$message_text = $message_subject = '';
- if ($to_user_id && $action == 'post')
+ if ($to_user_id && $to_user_id != ANONYMOUS && $action == 'post')
{
$address_list['u'][$to_user_id] = 'to';
}
@@ -755,7 +752,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
- $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
+ $save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED'];
+ $message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');
$last_click_type = 'CLICK_RETURN_FOLDER';
if ($folder_url)
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 58c2d087c8..efa390ed87 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -328,10 +328,23 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error('RULE_ALREADY_DEFINED');
}
+ // Prevent users from flooding the rules table
+ $sql = 'SELECT COUNT(rule_id) AS num_rules
+ FROM ' . PRIVMSGS_RULES_TABLE . '
+ WHERE user_id = ' . (int) $user->data['user_id'];
+ $result = $db->sql_query($sql);
+ $num_rules = (int) $db->sql_fetchfield('num_rules');
+ $db->sql_freeresult($result);
+
+ if ($num_rules >= 5000)
+ {
+ trigger_error('RULE_LIMIT_REACHED');
+ }
+
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
$db->sql_query($sql);
- // Update users message rules
+ // Set the user_message_rules bit
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_message_rules = 1
WHERE user_id = ' . $user->data['user_id'];
@@ -378,7 +391,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- // Update users message rules
+ // Unset the user_message_rules bit
if (!$row)
{
$sql = 'UPDATE ' . USERS_TABLE . '
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 17d7d23f02..c6e43b831c 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -134,6 +134,35 @@ class ucp_prefs
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
+ // check if there are any user-selectable languages
+ $sql = 'SELECT COUNT(lang_id) as languages_count
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+ if ($db->sql_fetchfield('languages_count') > 1)
+ {
+ $s_more_languages = true;
+ }
+ else
+ {
+ $s_more_languages = false;
+ }
+ $db->sql_freeresult($result);
+
+ // check if there are any user-selectable styles
+ $sql = 'SELECT COUNT(style_id) as styles_count
+ FROM ' . STYLES_TABLE . '
+ WHERE style_active = 1';
+ $result = $db->sql_query($sql);
+ if ($db->sql_fetchfield('styles_count') > 1)
+ {
+ $s_more_styles = true;
+ }
+ else
+ {
+ $s_more_styles = false;
+ }
+ $db->sql_freeresult($result);
+
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
@@ -155,6 +184,9 @@ class ucp_prefs
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
+ 'S_MORE_LANGUAGES' => $s_more_languages,
+ 'S_MORE_STYLES' => $s_more_styles,
+
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 7d6fed6164..f1127da8aa 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -32,8 +32,8 @@ unset($dbpasswd);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
- 'phpbb_version' => '3.0.11',
- 'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
+ 'phpbb_version' => '3.0.12',
+ 'author' => '<a href="https://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
'dbport' => $dbport,
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index c1fe144c62..90d4010d5f 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-define('UPDATES_TO_VERSION', '3.0.11-RC1');
+define('UPDATES_TO_VERSION', '3.0.12');
// Enter any version to update from to test updates. The version within the db will not be updated.
define('DEBUG_FROM_VERSION', false);
@@ -60,8 +60,6 @@ $updates_to_version = UPDATES_TO_VERSION;
$debug_from_version = DEBUG_FROM_VERSION;
$oldest_from_version = OLDEST_FROM_VERSION;
-error_reporting(E_ALL);
-
@set_time_limit(0);
// Include essential scripts
@@ -527,7 +525,7 @@ function _print_footer()
</div>
<div id="page-footer">
- Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group
</div>
</div>
@@ -951,7 +949,7 @@ function database_update_info()
// this column was removed from the database updater
// after 3.0.9-RC3 was released. It might still exist
// in 3.0.9-RCX installations and has to be dropped in
- // 3.0.12 after the db_tools class is capable of properly
+ // 3.0.13 after the db_tools class is capable of properly
// removing a primary key.
// 'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
@@ -995,8 +993,26 @@ function database_update_info()
'3.0.10-RC3' => array(),
// No changes from 3.0.10 to 3.0.11-RC1
'3.0.10' => array(),
-
- /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */
+ // Changes from 3.0.11-RC1 to 3.0.11-RC2
+ '3.0.11-RC1' => array(
+ 'add_columns' => array(
+ PROFILE_FIELDS_TABLE => array(
+ 'field_show_novalue' => array('BOOL', 0),
+ ),
+ ),
+ ),
+ // No changes from 3.0.11-RC2 to 3.0.11
+ '3.0.11-RC2' => array(),
+ // No changes from 3.0.11 to 3.0.12-RC1
+ '3.0.11' => array(),
+ // No changes from 3.0.12-RC1 to 3.0.12-RC2
+ '3.0.12-RC1' => array(),
+ // No changes from 3.0.12-RC2 to 3.0.12-RC3
+ '3.0.12-RC2' => array(),
+ // No changes from 3.0.12-RC3 to 3.0.12
+ '3.0.12-RC3' => array(),
+
+ /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.13-RC1 */
);
}
@@ -1007,7 +1023,7 @@ function database_update_info()
*****************************************************************************/
function change_database_data(&$no_updates, $version)
{
- global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx;
+ global $db, $db_tools, $errored, $error_ary, $config, $table_prefix, $phpbb_root_path, $phpEx;
switch ($version)
{
@@ -1322,8 +1338,6 @@ function change_database_data(&$no_updates, $version)
),
);
- global $db_tools;
-
$statements = $db_tools->perform_schema_changes($changes);
foreach ($statements as $sql)
@@ -1965,26 +1979,41 @@ function change_database_data(&$no_updates, $version)
}
$db->sql_freeresult($result);
- global $db_tools, $table_prefix;
-
- // Recover from potentially broken Q&A CAPTCHA table on firebird
- // Q&A CAPTCHA was uninstallable, so it's safe to remove these
- // without data loss
+ /*
+ * Due to a bug, vanilla phpbb could not create captcha tables
+ * in 3.0.8 on firebird. It was possible for board administrators
+ * to adjust the code to work. If code was manually adjusted by
+ * board administrators, index names would not be the same as
+ * what 3.0.9 and newer expect. This code fragment drops captcha
+ * tables, destroying all entered Q&A captcha configuration, such
+ * that when Q&A is configured next the respective tables will be
+ * created with correct index names.
+ *
+ * If you wish to preserve your Q&A captcha configuration, you can
+ * manually rename indexes to the currently expected name:
+ * phpbb_captcha_questions_lang_iso => phpbb_captcha_questions_lang
+ * phpbb_captcha_answers_question_id => phpbb_captcha_answers_qid
+ *
+ * Again, this needs to be done only if a board was manually modified
+ * to fix broken captcha code.
+ *
if ($db_tools->sql_layer == 'firebird')
{
- $tables = array(
- $table_prefix . 'captcha_questions',
- $table_prefix . 'captcha_answers',
- $table_prefix . 'qa_confirm',
+ $changes = array(
+ 'drop_tables' => array(
+ $table_prefix . 'captcha_questions',
+ $table_prefix . 'captcha_answers',
+ $table_prefix . 'qa_confirm',
+ ),
);
- foreach ($tables as $table)
+ $statements = $db_tools->perform_schema_changes($changes);
+
+ foreach ($statements as $sql)
{
- if ($db_tools->sql_table_exists($table))
- {
- $db_tools->sql_table_drop($table);
- }
+ _sql($sql, $errored, $error_ary);
}
}
+ */
$no_updates = false;
break;
@@ -2090,6 +2119,141 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // No changes from 3.0.11-RC1 to 3.0.11-RC2
+ case '3.0.11-RC1':
+ break;
+
+ // No changes from 3.0.11-RC2 to 3.0.11
+ case '3.0.11-RC2':
+ break;
+
+ // Changes from 3.0.11 to 3.0.12-RC1
+ case '3.0.11':
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_auth = \'acl_u_sig\'
+ WHERE module_class = \'ucp\'
+ AND module_basename = \'profile\'
+ AND module_mode = \'signature\'';
+ _sql($sql, $errored, $error_ary);
+
+ // Update bots
+ if (!function_exists('user_delete'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ $bots_updates = array(
+ // Bot Deletions
+ 'NG-Search [Bot]' => false,
+ 'Nutch/CVS [Bot]' => false,
+ 'OmniExplorer [Bot]' => false,
+ 'Seekport [Bot]' => false,
+ 'Synoo [Bot]' => false,
+ 'WiseNut [Bot]' => false,
+
+ // Bot Updates
+ // Bot name to bot user agent map
+ 'Baidu [Spider]' => 'Baiduspider',
+ 'Exabot [Bot]' => 'Exabot',
+ 'Voyager [Bot]' => 'voyager/',
+ 'W3C [Validator]' => 'W3C_Validator',
+ );
+
+ foreach ($bots_updates as $bot_name => $bot_agent)
+ {
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE user_type = ' . USER_IGNORE . "
+ AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'";
+ $result = $db->sql_query($sql);
+ $bot_user_id = (int) $db->sql_fetchfield('user_id');
+ $db->sql_freeresult($result);
+
+ if ($bot_user_id)
+ {
+ if ($bot_agent === false)
+ {
+ $sql = 'DELETE FROM ' . BOTS_TABLE . "
+ WHERE user_id = $bot_user_id";
+ _sql($sql, $errored, $error_ary);
+
+ user_delete('remove', $bot_user_id);
+ }
+ else
+ {
+ $sql = 'UPDATE ' . BOTS_TABLE . "
+ SET bot_agent = '" . $db->sql_escape($bot_agent) . "'
+ WHERE user_id = $bot_user_id";
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+ }
+
+ // Disable receiving pms for bots
+ $sql = 'SELECT user_id
+ FROM ' . BOTS_TABLE;
+ $result = $db->sql_query($sql);
+
+ $bot_user_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $bot_user_ids[] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($bot_user_ids))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_allow_pm = 0
+ WHERE ' . $db->sql_in_set('user_id', $bot_user_ids);
+ _sql($sql, $errored, $error_ary);
+ }
+
+ /**
+ * Update BBCodes that currently use the LOCAL_URL tag
+ *
+ * To fix http://tracker.phpbb.com/browse/PHPBB3-8319 we changed
+ * the second_pass_replace value, so that needs updating for existing ones
+ */
+ $sql = 'SELECT *
+ FROM ' . BBCODES_TABLE . '
+ WHERE bbcode_match ' . $db->sql_like_expression($db->any_char . 'LOCAL_URL' . $db->any_char);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (!class_exists('acp_bbcodes'))
+ {
+ phpbb_require_updated('includes/acp/acp_bbcodes.' . $phpEx);
+ }
+ $bbcode_match = $row['bbcode_match'];
+ $bbcode_tpl = $row['bbcode_tpl'];
+
+ $acp_bbcodes = new acp_bbcodes();
+ $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl);
+
+ $sql = 'UPDATE ' . BBCODES_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE bbcode_id = ' . (int) $row['bbcode_id'];
+ $db->sql_query($sql);
+ }
+ $db->sql_freeresult($result);
+
+ $no_updates = false;
+ break;
+
+ // No changes from 3.0.12-RC1 to 3.0.12-RC2
+ case '3.0.12-RC1':
+ break;
+
+ // No changes from 3.0.12-RC2 to 3.0.12-RC3
+ case '3.0.12-RC2':
+ break;
+
+ // No changes from 3.0.12-RC3 to 3.0.12
+ case '3.0.12-RC3':
+ break;
}
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 5135e2dbd8..ad46e273c2 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -569,7 +569,7 @@ class module
echo ' </div>';
echo ' </div>';
echo ' <div id="page-footer">';
- echo ' Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
+ echo ' Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
echo ' </div>';
echo '</div>';
echo '</body>';
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 62efc3e46b..fb97255981 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -2087,7 +2087,7 @@ class install_convert extends module
// Because we should not rely on correct settings, we simply use the relative path here directly.
$template->assign_vars(array(
'S_REFRESH' => true,
- 'META' => '<meta http-equiv="refresh" content="5;url=' . $url . '" />')
+ 'META' => '<meta http-equiv="refresh" content="5; url=' . $url . '" />')
);
}
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 8e3fe0387c..4618cff855 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1025,8 +1025,8 @@ class install_install extends module
}
// Replace backslashes and doubled slashes (could happen on some proxy setups)
- $name = str_replace(array('\\', '//', '/install'), '/', $name);
- $data['script_path'] = trim(dirname($name));
+ $name = str_replace(array('\\', '//'), '/', $name);
+ $data['script_path'] = trim(dirname(dirname($name)));
}
foreach ($this->advanced_config_options as $config_key => $vars)
@@ -1164,7 +1164,7 @@ class install_install extends module
$sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query);
- $sql_query = remove_comments($sql_query);
+ $sql_query = phpbb_remove_comments($sql_query);
$sql_query = split_sql_file($sql_query, $delimiter);
@@ -1202,7 +1202,7 @@ class install_install extends module
// Change language strings...
$sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query);
- $sql_query = remove_comments($sql_query);
+ $sql_query = phpbb_remove_comments($sql_query);
$sql_query = split_sql_file($sql_query, ';');
foreach ($sql_query as $sql)
@@ -1859,6 +1859,7 @@ class install_install extends module
'user_timezone' => 0,
'user_dateformat' => $lang['default_dateformat'],
'user_allow_massemail' => 0,
+ 'user_allow_pm' => 0,
);
$user_id = user_add($user_row);
@@ -2103,9 +2104,9 @@ class install_install extends module
'Alexa [Bot]' => array('ia_archiver', ''),
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
- 'Baidu [Spider]' => array('Baiduspider+(', ''),
- 'Bing [Bot]' => array('bingbot/', ''),
- 'Exabot [Bot]' => array('Exabot/', ''),
+ 'Baidu [Spider]' => array('Baiduspider', ''),
+ 'Bing [Bot]' => array('bingbot/', ''),
+ 'Exabot [Bot]' => array('Exabot', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
'Francis [Bot]' => array('http://www.neomo.de/', ''),
@@ -2124,27 +2125,21 @@ class install_install extends module
'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
'MSN [Bot]' => array('msnbot/', ''),
'MSNbot Media' => array('msnbot-media/', ''),
- 'NG-Search [Bot]' => array('NG-Search/', ''),
'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
- 'Nutch/CVS [Bot]' => array('NutchCVS/', ''),
- 'OmniExplorer [Bot]' => array('OmniExplorer_Bot/', ''),
'Online link [Validator]' => array('online link validator', ''),
'psbot [Picsearch]' => array('psbot/0', ''),
- 'Seekport [Bot]' => array('Seekbot/', ''),
'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
'SEO Crawler' => array('SEO search Crawler/', ''),
'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
'SEOSearch [Crawler]' => array('SEOsearch/', ''),
'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
- 'Synoo [Bot]' => array('SynooBot/', ''),
'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
- 'Voyager [Bot]' => array('voyager/1.0', ''),
+ 'Voyager [Bot]' => array('voyager/', ''),
'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
'W3C [Linkcheck]' => array('W3C-checklink/', ''),
- 'W3C [Validator]' => array('W3C_*Validator', ''),
- 'WiseNut [Bot]' => array('http://www.WISEnutbot.com', ''),
+ 'W3C [Validator]' => array('W3C_Validator', ''),
'YaCy [Bot]' => array('yacybot', ''),
'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index ec76f2a407..c18a0fb4ec 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -1656,7 +1656,9 @@ class install_update extends module
{
case 'version_info':
global $phpbb_root_path, $phpEx;
- $info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
+
+ $info = get_remote_file('version.phpbb.com', '/phpbb',
+ ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
if ($info !== false)
{
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 73052f0a22..eae692f529 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -807,6 +807,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_required INTEGER DEFAULT 0 NOT NULL,
+ field_show_novalue INTEGER DEFAULT 0 NOT NULL,
field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
field_show_on_vt INTEGER DEFAULT 0 NOT NULL,
field_show_profile INTEGER DEFAULT 0 NOT NULL,
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 8ed3ba7e12..0b2f8368de 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -974,6 +974,7 @@ CREATE TABLE [phpbb_profile_fields] (
[field_default_value] [varchar] (255) DEFAULT ('') NOT NULL ,
[field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
[field_required] [int] DEFAULT (0) NOT NULL ,
+ [field_show_novalue] [int] DEFAULT (0) NOT NULL ,
[field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
[field_show_on_vt] [int] DEFAULT (0) NOT NULL ,
[field_show_profile] [int] DEFAULT (0) NOT NULL ,
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 42b7291d9d..969cbe0472 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -571,6 +571,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value blob NOT NULL,
field_validation varbinary(60) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 7a6d0ae188..15d34894d8 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -571,6 +571,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) DEFAULT '' NOT NULL,
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 6e7ec31efc..af7b2b60ec 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1085,6 +1085,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar2(765) DEFAULT '' ,
field_validation varchar2(60) DEFAULT '' ,
field_required number(1) DEFAULT '0' NOT NULL,
+ field_show_novalue number(1) DEFAULT '0' NOT NULL,
field_show_on_reg number(1) DEFAULT '0' NOT NULL,
field_show_on_vt number(1) DEFAULT '0' NOT NULL,
field_show_profile number(1) DEFAULT '0' NOT NULL,
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 38f167bc7b..0a05a7cd75 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -761,6 +761,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) DEFAULT '' NOT NULL,
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
+ field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0),
field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),
field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 99b8f7f96d..6eae984cb7 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -246,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
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 ('version', '3.0.11-RC1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.12');
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/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index c0574244ca..be7faa4688 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -554,6 +554,7 @@ CREATE TABLE phpbb_profile_fields (
field_default_value varchar(255) NOT NULL DEFAULT '',
field_validation varchar(20) NOT NULL DEFAULT '',
field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index f24376f8aa..ccd12fcb6a 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
'SYSTEM_TIMEZONE' => 'Guest timezone',
'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.',
'WARNINGS_EXPIRE' => 'Warning duration',
- 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record. Set this value to 0 to make warnings permanent.',
+ 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before a warning will automatically expire from a user’s record. Set this value to 0 to make warnings permanent.',
));
// Board Features
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index e64ba3c371..04d614c80d 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -292,7 +292,7 @@ $lang = array_merge($lang, array(
// PHP info
$lang = array_merge($lang, array(
- 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by <a href="http://www.phpbb.com/about/team/">official team members</a> on the support forums.',
+ 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by <a href="https://www.phpbb.com/about/team/">official team members</a> on the support forums.',
'NO_PHPINFO_AVAILABLE' => 'Information about your PHP configuration is unable to be determined. Phpinfo() has been disabled for security reasons.',
));
@@ -572,7 +572,7 @@ $lang = array_merge($lang, array(
'LOG_FORUM_MOVE_UP' => '<strong>Moved forum</strong> %1$s <strong>above</strong> %2$s',
'LOG_FORUM_SYNC' => '<strong>Re-synchronised forum</strong><br />» %s',
- 'LOG_GENERAL_ERROR' => '<strong>A general error occured</strong>: %1$s <br />» %2$s',
+ 'LOG_GENERAL_ERROR' => '<strong>A general error occurred</strong>: %1$s <br />» %2$s',
'LOG_GROUP_CREATED' => '<strong>New usergroup created</strong><br />» %s',
'LOG_GROUP_DEFAULTS' => '<strong>Group “%1$s†made default for members</strong><br />» %2$s',
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index c0396cc247..6f0e7144e8 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
<br />
- <p>For further information on setting up and managing permissions on your phpBB3 board, please see <a href="http://www.phpbb.com/support/documentation/3.0/quickstart/quick_permissions.html">Chapter 1.5 of our Quick Start Guide</a>.</p>
+ <p>For further information on setting up and managing permissions on your phpBB3 board, please see <a href="https://www.phpbb.com/support/documentation/3.0/quickstart/quick_permissions.html">Chapter 1.5 of our Quick Start Guide</a>.</p>
',
'ACL_NEVER' => 'Never',
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index 9719287c2a..9232be661b 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -83,7 +83,8 @@ $lang = array_merge($lang, array(
'NUMBER' => 'Any series of digits',
'EMAIL' => 'A valid e-mail address',
'URL' => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://†is prefixed to the string.',
- 'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol.',
+ 'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “%sâ€',
+ 'RELATIVE_URL' => 'A relative URL. You can use this to match parts of a URL, but be careful: a full URL is a valid relative URL. When you want to use relative URLs of your board, use the LOCAL_URL token.',
'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
)
));
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php
index a25dcd174b..e193d9303c 100644
--- a/phpBB/language/en/acp/profile.php
+++ b/phpBB/language/en/acp/profile.php
@@ -131,6 +131,8 @@ $lang = array_merge($lang, array(
'SAVE' => 'Save',
'SECOND_OPTION' => 'Second option',
+ 'SHOW_NOVALUE_FIELD' => 'Show field if no value was selected',
+ 'SHOW_NOVALUE_FIELD_EXPLAIN' => 'Determines if the profile field should be displayed if no value was selected for optional fields or if no value has been selected yet for required fields.',
'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. This information is needed for the second step where you’ll be able to set remaining options and tweak your profile field further.',
'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step.',
'STEP_1_TITLE_CREATE' => 'Add profile field',
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index a7d687d7c2..79ac75c833 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
'DELETING_INDEX_IN_PROGRESS_EXPLAIN' => 'The search backend is currently cleaning its index. This can take a few minutes.',
'FULLTEXT_MYSQL_INCOMPATIBLE_VERSION' => 'The MySQL fulltext backend can only be used with MySQL4 and above.',
- 'FULLTEXT_MYSQL_NOT_MYISAM' => 'MySQL fulltext indexes can only be used with MyISAM tables.',
+ 'FULLTEXT_MYSQL_NOT_SUPPORTED' => 'MySQL fulltext indexes can only be used with MyISAM or InnoDB tables. MySQL 5.6.4 or later is required for fulltext indexes on InnoDB tables.',
'FULLTEXT_MYSQL_TOTAL_POSTS' => 'Total number of indexed posts',
'FULLTEXT_MYSQL_MBSTRING' => 'Support for non-latin UTF-8 characters using mbstring:',
'FULLTEXT_MYSQL_PCRE' => 'Support for non-latin UTF-8 characters using PCRE:',
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index 785283faea..3b82a7022d 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -59,7 +59,7 @@ $lang = array_merge($lang, array(
'DELETE_POSTS' => 'Delete posts',
'DELETE_USER' => 'Delete user',
- 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered.',
+ 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered. Unread private messages sent by this user will be deleted and will not be available to their recipients.',
'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced reactivation.',
'FOUNDER' => 'Founder',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 0184dd083b..f37f6d3b30 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -160,6 +160,7 @@ $lang = array_merge($lang, array(
'EDIT_POST' => 'Edit post',
'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS
'EMAIL_ADDRESS' => 'E-mail address',
+ 'EMAIL_INVALID_EMAIL' => 'The e-mail address you entered is invalid.',
'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at <strong>Line %1$s</strong>. Response: %2$s.',
'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.',
'EMPTY_MESSAGE_SUBJECT' => 'You must specify a subject when composing a new message.',
@@ -171,8 +172,8 @@ $lang = array_merge($lang, array(
'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.',
'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.',
'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.',
- 'ERR_UNWATCHING' => 'An error occured while trying to unsubscribe.',
- 'ERR_WATCHING' => 'An error occured while trying to subscribe.',
+ 'ERR_UNWATCHING' => 'An error occurred while trying to unsubscribe.',
+ 'ERR_WATCHING' => 'An error occurred while trying to subscribe.',
'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path specified appears to be invalid.',
'EXPAND_VIEW' => 'Expand view',
'EXTENSION' => 'Extension',
@@ -297,7 +298,7 @@ $lang = array_merge($lang, array(
'LAST_VISIT' => 'Last visit',
'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not available.',
'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server.',
- 'LDAP_SEARCH_FAILED' => 'An error occured while searching the LDAP directory.',
+ 'LDAP_SEARCH_FAILED' => 'An error occurred while searching the LDAP directory.',
'LEGEND' => 'Legend',
'LOCATION' => 'Location',
'LOCK_POST' => 'Lock post',
@@ -390,6 +391,7 @@ $lang = array_merge($lang, array(
'NO_POSTS_TIME_FRAME' => 'No posts exist inside this topic for the selected time frame.',
'NO_FEED_ENABLED' => 'Feeds are not available on this board.',
'NO_FEED' => 'The requested feed is not available.',
+ 'NO_STYLE_DATA' => 'Could not get style data',
'NO_SUBJECT' => 'No subject specified', // Used for posts having no subject defined but displayed within management pages.
'NO_SUCH_SEARCH_MODULE' => 'The specified search backend doesn’t exist.',
'NO_SUPPORTED_AUTH_METHODS' => 'No supported authentication methods.',
@@ -568,9 +570,11 @@ $lang = array_merge($lang, array(
'SUBJECT' => 'Subject',
'SUBMIT' => 'Submit',
+ 'TB' => 'TB',
'TERMS_USE' => 'Terms of use',
'TEST_CONNECTION' => 'Test connection',
'THE_TEAM' => 'The team',
+ 'TIB' => 'TiB',
'TIME' => 'Time',
'TOO_LARGE' => 'The value you entered is too large.',
@@ -718,6 +722,7 @@ $lang = array_merge($lang, array(
'WHO_IS_ONLINE' => 'Who is online',
'WRONG_PASSWORD' => 'You entered an incorrect password.',
+ 'WRONG_DATA_COLOUR' => 'The colour value you entered is invalid.',
'WRONG_DATA_ICQ' => 'The number you entered is not a valid ICQ number.',
'WRONG_DATA_JABBER' => 'The name you entered is not a valid Jabber account name.',
'WRONG_DATA_LANG' => 'The language you specified is not valid.',
diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt
index fae5a83885..6a2eb90190 100644
--- a/phpBB/language/en/email/forum_notify.txt
+++ b/phpBB/language/en/email/forum_notify.txt
@@ -2,7 +2,7 @@ Subject: Forum post 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 reply to the topic "{TOPIC_TITLE}" since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
+You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new reply to the topic "{TOPIC_TITLE}"<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the last unread reply, no more notifications will be sent until you visit the topic.
{U_NEWEST_POST}
diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt
index 2aa03a7f33..60e52e37c4 100644
--- a/phpBB/language/en/email/installed.txt
+++ b/phpBB/language/en/email/installed.txt
@@ -12,7 +12,7 @@ Username: {USERNAME}
Board URL: {U_BOARD}
----------------------------
-Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
+Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - https://www.phpbb.com/support/
In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt
index 529bbf0f8f..2da7ee8766 100644
--- a/phpBB/language/en/email/newtopic_notify.txt
+++ b/phpBB/language/en/email/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 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/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt
index 99587b28e0..f48eb5d40a 100644
--- a/phpBB/language/en/email/topic_notify.txt
+++ b/phpBB/language/en/email/topic_notify.txt
@@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}"
Hello {USERNAME},
-You are receiving this notification because you are watching the topic, "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply 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/help_faq.php b/phpBB/language/en/help_faq.php
index c500917d58..b68336e0f7 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -329,11 +329,11 @@ $help = array(
),
array(
0 => 'Who wrote this bulletin board?',
- 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="http://www.phpbb.com/">phpBB Group</a>. It is made available under the GNU General Public License and may be freely distributed. See the link for more details.'
+ 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="https://www.phpbb.com/">phpBB Group</a>. It is made available under the GNU General Public License and may be freely distributed. See the link for more details.'
),
array(
0 => 'Why isn’t X feature available?',
- 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added, or you want to report a bug, please visit the phpBB <a href="http://area51.phpbb.com/">Area51</a> website, where you will find resources to do so.'
+ 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.'
),
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index bbf407f1dc..5055ac6a20 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -80,7 +80,7 @@ $lang = array_merge($lang, array(
'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion',
'CONVERT' => 'Convert',
'CONVERT_COMPLETE' => 'Conversion completed',
- 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
+ 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework',
'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.',
'CONVERT_NEW_CONVERSION' => 'New conversion',
@@ -194,7 +194,7 @@ $lang = array_merge($lang, array(
<h2>Convert an existing board to phpBB3</h2>
<p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed to the convertor</a>.</p>
<h2>Go live with your phpBB3!</h2>
- <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
+ <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="https://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
'INSTALL_INTRO' => 'Welcome to Installation',
'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB3 onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
@@ -277,7 +277,7 @@ $lang = array_merge($lang, array(
'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.',
'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>.',
- 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="http://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="http://www.phpbb.com/community/viewforum.php?f=46">our support forums</a>.',
+ 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="https://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="https://www.phpbb.com/community/viewforum.php?f=46">our support forums</a>.',
'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases<br /><br />%s',
'NEXT_STEP' => 'Proceed to next step',
@@ -288,7 +288,7 @@ $lang = array_merge($lang, array(
'NO_LOCATION' => 'Cannot determine location. If you know Imagemagick is installed, you may specify the location later within your administration control panel',
'NO_TABLES_FOUND' => 'No tables found.',
- 'OVERVIEW_BODY' => 'Welcome to phpBB3!<br /><br />phpBBâ„¢ is the most widely used open source bulletin board solution in the world. phpBB3 is the latest installment in a package line started in 2000. Like its predecessors, phpBB3 is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB3 greatly improves on what made phpBB2 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB3, updating to the latest version of phpBB3 from past releases, as well as converting to phpBB3 from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="../docs/INSTALL.html">the installation guide</a>.<br /><br />To read the phpBB3 license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
+ 'OVERVIEW_BODY' => 'Welcome to phpBB3!<br /><br />phpBB® is the most widely used open source bulletin board solution in the world. phpBB3 is the latest installment in a package line started in 2000. Like its predecessors, phpBB3 is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB3 greatly improves on what made phpBB2 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB3, updating to the latest version of phpBB3 from past releases, as well as converting to phpBB3 from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="../docs/INSTALL.html">the installation guide</a>.<br /><br />To read the phpBB3 license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 support',
'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will <strong>not</strong> run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.',
@@ -345,7 +345,7 @@ $lang = array_merge($lang, array(
'SUB_LICENSE' => 'License',
'SUB_SUPPORT' => 'Support',
'SUCCESSFUL_CONNECT' => 'Successful connection',
- 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="http://www.phpbb.com/community/viewforum.php?f=65">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>MODs / Styles</h2><p>For issues relating to MODs, please post in the appropriate <a href="http://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and imagesets, please post in the appropriate <a href="http://www.phpbb.com/community/viewforum.php?f=80">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="http://www.phpbb.com/support/">Support Section</a><br /><a href="http://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="http://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
+ 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=65">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>MODs / Styles</h2><p>For issues relating to MODs, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and imagesets, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=80">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
'SYNC_FORUMS' => 'Starting to synchronise forums',
'SYNC_POST_COUNT' => 'Synchronising post_counts',
'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from <var>entry</var> %1$s to %2$s.',
@@ -363,7 +363,7 @@ $lang = array_merge($lang, array(
'UNAVAILABLE' => 'Unavailable',
'UNWRITABLE' => 'Unwritable',
'UPDATE_TOPICS_POSTED' => 'Generating topics posted information',
- 'UPDATE_TOPICS_POSTED_ERR' => 'An error occured while generating topics posted information. You can retry this step in the ACP after the conversion process is completed.',
+ 'UPDATE_TOPICS_POSTED_ERR' => 'An error occurred while generating topics posted information. You can retry this step in the ACP after the conversion process is completed.',
'VERIFY_OPTIONS' => 'Verifying conversion options',
'VERSION' => 'Version',
@@ -468,7 +468,7 @@ $lang = array_merge($lang, array(
'NO_ERRORS' => 'No errors',
'NO_UPDATE_FILES' => 'Not updating the following files',
'NO_UPDATE_FILES_EXPLAIN' => 'The following files are new or modified but the directory they normally reside in could not be found on your installation. If this list contains files to other directories than language/ or styles/ than you may have modified your directory structure and the update may be incomplete.',
- 'NO_UPDATE_FILES_OUTDATED' => 'No valid update directory was found, please make sure you uploaded the relevant files.<br /><br />Your installation does <strong>not</strong> seem to be up to date. Updates are available for your version of phpBB %1$s, please visit <a href="http://www.phpbb.com/downloads/" rel="external">http://www.phpbb.com/downloads/</a> to obtain the correct package to update from Version %2$s to Version %3$s.',
+ 'NO_UPDATE_FILES_OUTDATED' => 'No valid update directory was found, please make sure you uploaded the relevant files.<br /><br />Your installation does <strong>not</strong> seem to be up to date. Updates are available for your version of phpBB %1$s, please visit <a href="https://www.phpbb.com/downloads/" rel="external">https://www.phpbb.com/downloads/</a> to obtain the correct package to update from Version %2$s to Version %3$s.',
'NO_UPDATE_FILES_UP_TO_DATE' => 'Your version is up to date. There is no need to run the update tool. If you want to make an integrity check on your files make sure you uploaded the correct update files.',
'NO_UPDATE_INFO' => 'Update file information could not be found.',
'NO_UPDATES_REQUIRED' => 'No updates required',
@@ -536,7 +536,7 @@ $lang = array_merge($lang, array(
<p>The recommended way of updating your installation listed here is only valid for the automatic update package. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB3 automatically are:</p>
<ul style="margin-left: 20px; font-size: 1.1em;">
- <li>Go to the <a href="http://www.phpbb.com/downloads/" title="http://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Automatic Update Package" archive.<br /><br /></li>
+ <li>Go to the <a href="https://www.phpbb.com/downloads/" title="https://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Automatic Update Package" archive.<br /><br /></li>
<li>Unpack the archive.<br /><br /></li>
<li>Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).<br /><br /></li>
</ul>
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 24f3204c57..dfc5065a05 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -54,9 +54,9 @@ $lang = array_merge($lang, array(
'BBCODE_IS_OFF' => '%sBBCode%s is <em>OFF</em>',
'BBCODE_IS_ON' => '%sBBCode%s is <em>ON</em>',
'BBCODE_I_HELP' => 'Italic text: [i]text[/i]',
- 'BBCODE_L_HELP' => 'List: [list]text[/list]',
- 'BBCODE_LISTITEM_HELP' => 'List item: [*]text[/*]',
- 'BBCODE_O_HELP' => 'Ordered list: [list=]text[/list]',
+ 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
+ 'BBCODE_LISTITEM_HELP' => 'List item: [*]text',
+ 'BBCODE_O_HELP' => 'Ordered list: e.g. [list=1][*]First point[/list] or [list=a][*]Point a[/list]',
'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]',
'BBCODE_Q_HELP' => 'Quote text: [quote]text[/quote]',
'BBCODE_S_HELP' => 'Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000',
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index cd38cd615f..97bc1f9bac 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -77,6 +77,7 @@ $lang = array_merge($lang, array(
'SEARCHED_FOR' => 'Search term used',
'SEARCHED_TOPIC' => 'Searched topic',
+ 'SEARCHED_QUERY' => 'Searched query',
'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered',
'SEARCH_ANY_TERMS' => 'Search for any terms',
'SEARCH_AUTHOR' => 'Search for author',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 7df26e040f..ad11213052 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -39,7 +39,7 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'TERMS_OF_USE_CONTENT' => 'By accessing “%1$s†(hereinafter “weâ€, “usâ€, “ourâ€, “%1$sâ€, “%2$sâ€), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use “%1$sâ€. We may change these at any time and we’ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of “%1$s†after changes mean you agree to be legally bound by these terms as they are updated and/or amended.<br />
<br />
- Our forums are powered by phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Groupâ€, “phpBB Teamsâ€) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-license.php">General Public License</a>†(hereinafter “GPLâ€) and can be downloaded from <a href="http://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions, the phpBB Group are not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="http://www.phpbb.com/">http://www.phpbb.com/</a>.<br />
+ Our forums are powered by phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Groupâ€, “phpBB Teamsâ€) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-license.php">General Public License</a>†(hereinafter “GPLâ€) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions, the phpBB Group are not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.<br />
<br />
You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s†is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s†have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s†nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised.
',
@@ -176,7 +176,6 @@ $lang = array_merge($lang, array(
'EDIT_DRAFT_EXPLAIN' => 'Here you are able to edit your draft. Drafts do not contain attachment and poll information.',
'EMAIL_BANNED_EMAIL' => 'The e-mail address you entered is not allowed to be used.',
- 'EMAIL_INVALID_EMAIL' => 'The e-mail address you entered is invalid.',
'EMAIL_REMIND' => 'This must be the e-mail address associated with your account. If you have not changed this via your user control panel then it is the e-mail address you registered your account with.',
'EMAIL_TAKEN_EMAIL' => 'The entered e-mail address is already in use.',
'EMPTY_DRAFT' => 'You must enter a message to submit your changes.',
@@ -257,8 +256,9 @@ $lang = array_merge($lang, array(
'MESSAGE_BY_AUTHOR' => 'by',
'MESSAGE_COLOURS' => 'Message colours',
'MESSAGE_DELETED' => 'Message successfully deleted.',
+ 'MESSAGE_EDITED' => 'Message successfully edited.',
'MESSAGE_HISTORY' => 'Message history',
- 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by its author before it was delivered.',
+ 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message was deleted by its author.',
'MESSAGE_SENT_ON' => 'on',
'MESSAGE_STORED' => 'This message has been sent successfully.',
'MESSAGE_TO' => 'To',
@@ -388,6 +388,7 @@ $lang = array_merge($lang, array(
'RULE_ADDED' => 'Rule successfully added.',
'RULE_ALREADY_DEFINED' => 'This rule was defined previously.',
'RULE_DELETED' => 'Rule successfully removed.',
+ 'RULE_LIMIT_REACHED' => 'You cannot add more PM rules. You have reached the maximum number of rules.',
'RULE_NOT_DEFINED' => 'Rule not correctly specified.',
'RULE_REMOVED_MESSAGE' => 'One private message had been removed due to private message filters.',
'RULE_REMOVED_MESSAGES' => '%d private messages were removed due to private message filters.',
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 76c8100c78..61df10b125 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -196,6 +196,7 @@ if ($post_data['forum_password'])
{
login_forum_box(array(
'forum_id' => $forum_id,
+ 'forum_name' => $post_data['forum_name'],
'forum_password' => $post_data['forum_password'])
);
}
@@ -1018,7 +1019,7 @@ if ($submit || $preview || $refresh)
$forum_type = (int) $db->sql_fetchfield('forum_type');
$db->sql_freeresult($result);
- if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
+ if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || !$auth->acl_get('f_noapprove', $to_forum_id))
{
$to_forum_id = 0;
}
@@ -1130,16 +1131,23 @@ if ($submit || $preview || $refresh)
$data['topic_replies'] = $post_data['topic_replies'];
}
+ // Only return the username when it is either a guest posting or we are editing a post and
+ // the username was supplied; otherwise post_data might hold the data of the post that is
+ // being quoted (which could result in the username being returned being that of the quoted
+ // post's poster, not the poster of the current post). See: PHPBB3-11769 for more information.
+ $post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username'] !== '') ? $post_data['username'] : '';
+
// The last parameter tells submit_post if search indexer has to be run
- $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+ $redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{
$captcha->reset();
}
- // Check the permissions for post approval. Moderators are not affected.
- if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
+ // Check the permissions for post approval.
+ // Moderators must go through post approval like ordinary users.
+ if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
{
meta_refresh(10, $redirect_url);
$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
diff --git a/phpBB/report.php b/phpBB/report.php
index c1172ec1d5..c909b4fcf3 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -133,9 +133,28 @@ else
}
}
+if ($config['enable_post_confirm'] && !$user->data['is_registered'])
+{
+ include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
+ $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $captcha->init(CONFIRM_REPORT);
+}
+
+$error = array();
+$s_hidden_fields = '';
+
// Submit report?
if ($submit && $reason_id)
{
+ if (isset($captcha))
+ {
+ $visual_confirmation_response = $captcha->validate();
+ if ($visual_confirmation_response)
+ {
+ $error[] = $visual_confirmation_response;
+ }
+ }
+
$sql = 'SELECT *
FROM ' . REPORTS_REASONS_TABLE . "
WHERE reason_id = $reason_id";
@@ -145,78 +164,90 @@ if ($submit && $reason_id)
if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other'))
{
- trigger_error('EMPTY_REPORT');
+ $error[] = $user->lang('EMPTY_REPORT');
}
- $sql_ary = array(
- 'reason_id' => (int) $reason_id,
- 'post_id' => $post_id,
- 'pm_id' => $pm_id,
- 'user_id' => (int) $user->data['user_id'],
- 'user_notify' => (int) $user_notify,
- 'report_closed' => 0,
- 'report_time' => (int) time(),
- 'report_text' => (string) $report_text
- );
-
- $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
- $report_id = $db->sql_nextid();
-
- if ($post_id)
+ if (!sizeof($error))
{
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_reported = 1
- WHERE post_id = ' . $post_id;
- $db->sql_query($sql);
-
- if (!$report_data['topic_reported'])
+ if (isset($captcha))
{
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_reported = 1
- WHERE topic_id = ' . $report_data['topic_id'] . '
- OR topic_moved_id = ' . $report_data['topic_id'];
- $db->sql_query($sql);
+ $captcha->reset();
}
- $lang_return = $user->lang['RETURN_TOPIC'];
- $lang_success = $user->lang['POST_REPORTED_SUCCESS'];
- }
- else
- {
- $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
- SET message_reported = 1
- WHERE msg_id = ' . $pm_id;
- $db->sql_query($sql);
-
$sql_ary = array(
- 'msg_id' => $pm_id,
- 'user_id' => ANONYMOUS,
- 'author_id' => (int) $report_data['author_id'],
- 'pm_deleted' => 0,
- 'pm_new' => 0,
- 'pm_unread' => 0,
- 'pm_replied' => 0,
- 'pm_marked' => 0,
- 'pm_forwarded' => 0,
- 'folder_id' => PRIVMSGS_INBOX,
+ 'reason_id' => (int) $reason_id,
+ 'post_id' => $post_id,
+ 'pm_id' => $pm_id,
+ 'user_id' => (int) $user->data['user_id'],
+ 'user_notify' => (int) $user_notify,
+ 'report_closed' => 0,
+ 'report_time' => (int) time(),
+ 'report_text' => (string) $report_text
);
- $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
+ $report_id = $db->sql_nextid();
- $lang_return = $user->lang['RETURN_PM'];
- $lang_success = $user->lang['PM_REPORTED_SUCCESS'];
- }
+ if ($post_id)
+ {
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_reported = 1
+ WHERE post_id = ' . $post_id;
+ $db->sql_query($sql);
+
+ if (!$report_data['topic_reported'])
+ {
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_reported = 1
+ WHERE topic_id = ' . $report_data['topic_id'] . '
+ OR topic_moved_id = ' . $report_data['topic_id'];
+ $db->sql_query($sql);
+ }
+
+ $lang_return = $user->lang['RETURN_TOPIC'];
+ $lang_success = $user->lang['POST_REPORTED_SUCCESS'];
+ }
+ else
+ {
+ $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+ SET message_reported = 1
+ WHERE msg_id = ' . $pm_id;
+ $db->sql_query($sql);
+
+ $sql_ary = array(
+ 'msg_id' => $pm_id,
+ 'user_id' => ANONYMOUS,
+ 'author_id' => (int) $report_data['author_id'],
+ 'pm_deleted' => 0,
+ 'pm_new' => 0,
+ 'pm_unread' => 0,
+ 'pm_replied' => 0,
+ 'pm_marked' => 0,
+ 'pm_forwarded' => 0,
+ 'folder_id' => PRIVMSGS_INBOX,
+ );
+
+ $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+
+ $lang_return = $user->lang['RETURN_PM'];
+ $lang_success = $user->lang['PM_REPORTED_SUCCESS'];
+ }
- meta_refresh(3, $redirect_url);
+ meta_refresh(3, $redirect_url);
- $message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
- if ($return_forum_url)
+ $message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
+ if ($return_forum_url)
+ {
+ $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
+ }
+ trigger_error($message);
+ }
+ else if (isset($captcha) && $captcha->is_solved() !== false)
{
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
+ $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
}
- trigger_error($message);
}
// Generate the reasons
@@ -224,10 +255,20 @@ display_reasons($reason_id);
$page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST'];
+if (isset($captcha) && $captcha->is_solved() === false)
+{
+ $template->assign_vars(array(
+ 'S_CONFIRM_CODE' => true,
+ 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
+ ));
+}
+
$template->assign_vars(array(
+ 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_REPORT_POST' => ($pm_id) ? false : true,
'REPORT_TEXT' => $report_text,
'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id . '&amp;pm=' . $pm_id),
+ 'S_HIDDEN_FIELDS' => (sizeof($s_hidden_fields)) ? $s_hidden_fields : null,
'S_NOTIFY' => $user_notify,
'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false)
diff --git a/phpBB/search.php b/phpBB/search.php
index 1422420b03..1a92f50a70 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -611,7 +611,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$template->assign_vars(array(
'SEARCH_TITLE' => $l_search_title,
'SEARCH_MATCHES' => $l_search_matches,
- 'SEARCH_WORDS' => $search->search_query,
+ 'SEARCH_WORDS' => $keywords,
+ 'SEARCHED_QUERY' => $search->search_query,
'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg
index d7ba7690f6..22178d8a9d 100644
--- a/phpBB/styles/prosilver/imageset/imageset.cfg
+++ b/phpBB/styles/prosilver/imageset/imageset.cfg
@@ -19,7 +19,7 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
-version = 3.0.11
+version = 3.0.12
# Images
img_site_logo = site_logo.gif*52*139
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index 97e8aced01..811e5f4376 100644
--- a/phpBB/styles/prosilver/style.cfg
+++ b/phpBB/styles/prosilver/style.cfg
@@ -19,4 +19,4 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
-version = 3.0.11 \ No newline at end of file
+version = 3.0.12 \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html
index a342a9aa24..81a83b6340 100644
--- a/phpBB/styles/prosilver/template/login_forum.html
+++ b/phpBB/styles/prosilver/template/login_forum.html
@@ -1,31 +1,36 @@
<!-- INCLUDE overall_header.html -->
-<h2 class="solo">{L_LOGIN} {FORUM_NAME}</h2>
+<!-- IF FORUM_NAME --><h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
<form id="login_forum" method="post" action="{S_LOGIN_ACTION}">
{S_FORM_TOKEN}
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
- <p>{L_LOGIN_FORUM}</p>
-
- <fieldset class="fields2">
- <!-- IF LOGIN_ERROR -->
- <dl>
- <dt>&nbsp;</dt>
- <dd class="error">{LOGIN_ERROR}</dd>
- </dl>
- <!-- ENDIF -->
- <dl>
- <dt><label for="password">{L_PASSWORD}:</label></dt>
- <dd><input class="inputbox narrow" type="password" name="password" id="password" size="25" tabindex="1" /></dd>
- </dl>
- <dl class="fields2">
- <dt>&nbsp;</dt>
- <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
- </dl>
- {S_LOGIN_REDIRECT}
- </fieldset>
+ <div class="content">
+ <h2>{L_LOGIN}</h2>
+
+ <p>{L_LOGIN_FORUM}</p>
+
+ <fieldset class="fields1">
+ <!-- IF LOGIN_ERROR -->
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd class="error">{LOGIN_ERROR}</dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <dl>
+ <dt><label for="password">{L_PASSWORD}:</label></dt>
+ <dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" /></dd>
+ </dl>
+ {S_LOGIN_REDIRECT}
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
+ </dl>
+ </fieldset>
+ </div>
<span class="corners-bottom"><span></span></span></div>
</div>
diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html
index b71d120ed6..89ab753f12 100644
--- a/phpBB/styles/prosilver/template/mcp_front.html
+++ b/phpBB/styles/prosilver/template/mcp_front.html
@@ -119,7 +119,7 @@
<ul class="topiclist cplist">
<!-- BEGIN pm_report -->
- <li class="row<!-- IF report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
+ <li class="row<!-- IF pm_report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
<dt>
<a href="{pm_report.U_PM_DETAILS}" class="topictitle">{pm_report.PM_SUBJECT}</a> {pm_report.ATTACH_ICON_IMG}<br />
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 9df648f644..e6a4bfba97 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -75,6 +75,10 @@ function insert_single(user)
<dt><label for="msn">{L_MSNM}:</label></dt>
<dd><input type="text" name="msn" id="msn" value="{MSNM}" class="inputbox" /></dd>
</dl>
+ <dl>
+ <dt><label for="jabber">{L_JABBER}:</label></dt>
+ <dd><input type="text" name="jabber" id="jabber" value="{JABBER}" class="inputbox" /></dd>
+ </dl>
</fieldset>
<fieldset class="fields1 column2">
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 67ba74a690..5acdb3a08c 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -17,7 +17,7 @@
<dd>
<!-- BEGIN to_recipient -->
<!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a>&nbsp;<!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
+ <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
<!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
<!-- END to_recipient -->
</dd>
@@ -29,7 +29,7 @@
<dd>
<!-- BEGIN bcc_recipient -->
<!-- IF not bcc_recipient.S_FIRST_ROW and bcc_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
+ <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><strong>{bcc_recipient.NAME}</strong></a><!-- ELSE -->{bcc_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
<!-- IF not S_EDIT_POST --><input type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
<!-- END bcc_recipient -->
</dd>
@@ -50,7 +50,7 @@
<dd>
<!-- BEGIN to_recipient -->
<!-- IF not to_recipient.S_FIRST_ROW and to_recipient.S_ROW_COUNT mod 2 eq 0 --></dd><dd><!-- ENDIF -->
- <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
+ <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><strong>{to_recipient.NAME}</strong></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF -->&nbsp;
<!-- IF not S_EDIT_POST --><input type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="x" class="button2" />&nbsp;<!-- ENDIF -->
<!-- END to_recipient -->
</dd>
@@ -165,7 +165,7 @@
<dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}:</label></dt>
<dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list_{attach_row.ASSOC_INDEX}" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd>
- <dd><a href="{attach_row.U_VIEW_ATTACHMENT}" class="{S_CONTENT_FLOW_END}">{attach_row.FILENAME}</a></dd>
+ <dd><a href="{attach_row.U_VIEW_ATTACHMENT}">{attach_row.FILENAME}</a></dd>
<dd style="margin-top: 5px;">
<!-- IF S_INLINE_ATTACHMENT_OPTIONS --><input type="button" value="{L_PLACE_INLINE}" onclick="attach_inline({attach_row.ASSOC_INDEX}, '{attach_row.A_FILENAME}');" class="button2" />&nbsp; <!-- ENDIF -->
<input type="submit" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" class="button2" />
diff --git a/phpBB/styles/prosilver/template/report_body.html b/phpBB/styles/prosilver/template/report_body.html
index b0c6e08049..2d6a857afb 100644
--- a/phpBB/styles/prosilver/template/report_body.html
+++ b/phpBB/styles/prosilver/template/report_body.html
@@ -10,6 +10,7 @@
<p><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></p>
<fieldset>
+ <!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><!-- ENDIF -->
<dl class="fields2">
<dt><label for="reason_id">{L_REASON}:</label></dt>
<dd><select name="reason_id" id="reason_id" class="full"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></dd>
@@ -27,6 +28,9 @@
<dt><label for="report_text">{L_MORE_INFO}:</label><br /><span>{L_CAN_LEAVE_BLANK}</span></dt>
<dd><textarea name="report_text" id="report_text" rows="10" cols="76" class="inputbox">{REPORT_TEXT}</textarea></dd>
</dl>
+ <!-- IF CAPTCHA_TEMPLATE -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+ <!-- ENDIF -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index f2a4435103..0ea9d8a047 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -1,6 +1,7 @@
<!-- INCLUDE overall_header.html -->
<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
+<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}: <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
<!-- IF SEARCH_TOPIC -->
diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg
index eb3df8bfd3..af84a0a66c 100644
--- a/phpBB/styles/prosilver/template/template.cfg
+++ b/phpBB/styles/prosilver/template/template.cfg
@@ -19,7 +19,7 @@
# General Information about this template
name = prosilver
copyright = &copy; phpBB Group, 2007
-version = 3.0.11
+version = 3.0.12
# Defining a different template bitfield
template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html
index 87b548c23b..c90461312e 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_manage.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html
@@ -6,19 +6,18 @@
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
-
+
+ <!-- IF S_ERROR -->
+ <fieldset>
+ <p class="error">{ERROR_MSG}</p>
+ </fieldset>
+ <!-- ENDIF -->
+
<p>{L_GROUPS_EXPLAIN}</p>
<!-- IF S_EDIT -->
<h3>{L_GROUP_DETAILS}</h3>
-
- <!-- IF S_ERROR -->
- <div class="errorbox">
- <h3>{L_WARNING}</h3>
- <p>{ERROR_MSG}</p>
- </div>
- <!-- ENDIF -->
-
+
<fieldset>
<dl>
<dt><label for="group_name">{L_GROUP_NAME}:</label></dt>
@@ -55,7 +54,7 @@
<fieldset>
<dl>
<dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
- <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="7" maxlength="7" class="inputbox narrow" /> <span style="background-color: {GROUP_COLOUR};">&nbsp;&nbsp;&nbsp;</span> [ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</dd>
+ <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" class="inputbox narrow" /> <span style="background-color: {GROUP_COLOUR};">&nbsp;&nbsp;&nbsp;</span> [ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false;">{L_COLOUR_SWATCH}</a> ]</dd>
</dl>
<dl>
<dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
diff --git a/phpBB/styles/prosilver/template/ucp_groups_membership.html b/phpBB/styles/prosilver/template/ucp_groups_membership.html
index a147dbf89f..ef595dd62d 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_membership.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_membership.html
@@ -93,7 +93,7 @@
<!-- IF pending.GROUP_DESC --><br />{pending.GROUP_DESC}<!-- ENDIF -->
<!-- IF not pending.GROUP_SPECIAL --><br /><i>{pending.GROUP_STATUS}</i><!-- ENDIF -->
</dt>
- <dd class="mark"><input type="radio" name="selected" value="{pending.GROUP_ID}" <!-- IF pending.GROUP_SPECIAL -->disabled="diabled"<!-- ENDIF --> /></dd>
+ <dd class="mark"><input type="radio" name="selected" value="{pending.GROUP_ID}" <!-- IF pending.GROUP_SPECIAL -->disabled="disabled"<!-- ENDIF --> /></dd>
</dl>
</li>
<!-- END pending -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index 9051eb2ee0..0767920c1b 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -24,7 +24,7 @@
<h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
<p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
{L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}</p>
- <div class="content">{history_row.MESSAGE}</div>
+ <div class="content"><!-- IF history_row.MESSAGE -->{history_row.MESSAGE}<!-- ELSE --><span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span><!-- ENDIF --></div>
<div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index ce2a376768..67e14defc3 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -23,10 +23,9 @@
<div id="page-header">
<h1>{SITENAME}</h1>
- <p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p>
+ <p>{SITE_DESCRIPTION}</p>
- <h2>{TOPIC_TITLE}</h2>
- <p><a href="{U_TOPIC}">{U_TOPIC}</a></p>
+ <h2>{L_PRIVATE_MESSAGING}</h2>
</div>
<div id="page-body">
@@ -49,7 +48,7 @@
<div id="page-footer">
<div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div>
- <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</div>
+ <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</div>
</div>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index 9022346627..600319fc72 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -63,11 +63,13 @@
<label for="popuppm0"><input type="radio" name="popuppm" id="popuppm0" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
- <dl>
- <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt>
- <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd>
- </dl>
- <!-- IF S_STYLE_OPTIONS -->
+ <!-- IF S_MORE_LANGUAGES -->
+ <dl>
+ <dt><label for="lang">{L_BOARD_LANGUAGE}:</label></dt>
+ <dd><select name="lang" id="lang">{S_LANG_OPTIONS}</select></dd>
+ </dl>
+ <!-- ENDIF -->
+ <!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<dl>
<dt><label for="style">{L_BOARD_STYLE}:</label></dt>
<dd><select name="style" id="style">{S_STYLE_OPTIONS}</select></dd>
diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html
index 0fd0e6dfa6..39d2d76394 100644
--- a/phpBB/styles/prosilver/template/viewtopic_print.html
+++ b/phpBB/styles/prosilver/template/viewtopic_print.html
@@ -44,7 +44,7 @@
<div id="page-footer">
<div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div>
- <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</div>
+ <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</div>
</div>
</div>
diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css
index 4a7356fbaa..40620179a1 100644
--- a/phpBB/styles/prosilver/theme/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/stylesheet.css
@@ -3,7 +3,7 @@
Style name: prosilver (the default phpBB 3.0.x style)
Based on style:
Original author: Tom Beddard ( http://www.subblue.com/ )
- Modified by: phpBB Group ( http://www.phpbb.com/ )
+ Modified by: phpBB Group ( https://www.phpbb.com/ )
--------------------------------------------------------------
*/
diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg
index ec489d0b3d..03d82ed5f6 100644
--- a/phpBB/styles/prosilver/theme/theme.cfg
+++ b/phpBB/styles/prosilver/theme/theme.cfg
@@ -21,7 +21,7 @@
# General Information about this theme
name = prosilver
copyright = &copy; phpBB Group, 2007
-version = 3.0.11
+version = 3.0.12
# Some configuration options
diff --git a/phpBB/styles/subsilver2/imageset/imageset.cfg b/phpBB/styles/subsilver2/imageset/imageset.cfg
index c943db6735..cb48b0fd9f 100644
--- a/phpBB/styles/subsilver2/imageset/imageset.cfg
+++ b/phpBB/styles/subsilver2/imageset/imageset.cfg
@@ -19,7 +19,7 @@
# General Information about this style
name = subsilver2
copyright = &copy; phpBB Group, 2003
-version = 3.0.11
+version = 3.0.12
# Images
img_site_logo = site_logo.gif*94*170
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 4c40ee4438..b99c433ff1 100644
--- a/phpBB/styles/subsilver2/style.cfg
+++ b/phpBB/styles/subsilver2/style.cfg
@@ -19,4 +19,4 @@
# General Information about this style
name = subsilver2
copyright = &copy; 2005 phpBB Group
-version = 3.0.11
+version = 3.0.12
diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html
index acc9cdcdfb..3a5778b33e 100644
--- a/phpBB/styles/subsilver2/template/captcha_qa.html
+++ b/phpBB/styles/subsilver2/template/captcha_qa.html
@@ -3,6 +3,6 @@
</tr>
<tr>
<td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}:</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> /></td>
+ <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
<input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html
index 96b025a2f9..e91a406611 100644
--- a/phpBB/styles/subsilver2/template/login_forum.html
+++ b/phpBB/styles/subsilver2/template/login_forum.html
@@ -1,5 +1,13 @@
<!-- INCLUDE overall_header.html -->
+<!-- IF FORUM_NAME -->
+ <div id="pageheader">
+ <h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
+ </div>
+
+ <br clear="all" /><br />
+<!-- ENDIF -->
+
<div id="pagecontent">
<form name="login_forum" method="post" action="{S_LOGIN_ACTION}">
diff --git a/phpBB/styles/subsilver2/template/report_body.html b/phpBB/styles/subsilver2/template/report_body.html
index 7cd7d1040f..57747ffac0 100644
--- a/phpBB/styles/subsilver2/template/report_body.html
+++ b/phpBB/styles/subsilver2/template/report_body.html
@@ -6,6 +6,11 @@
<tr>
<th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th>
</tr>
+<!-- IF ERROR -->
+ <tr>
+ <td class="row3" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
+ </tr>
+<!-- ENDIF -->
<tr>
<td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td>
</tr>
@@ -25,6 +30,9 @@
<td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}:</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
<td class="row2"><textarea class="post" name="report_text" rows="10" cols="50">{REPORT_TEXT}</textarea></td>
</tr>
+<!-- IF CAPTCHA_TEMPLATE -->
+ <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
+<!-- ENDIF -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" class="btnmain" value="{L_SUBMIT}" />&nbsp;<input type="submit" name="cancel" class="btnlite" value="{L_CANCEL}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html
index db95c7952a..6cb4f401da 100644
--- a/phpBB/styles/subsilver2/template/simple_footer.html
+++ b/phpBB/styles/subsilver2/template/simple_footer.html
@@ -2,7 +2,7 @@
</div>
<div id="wrapfooter">
- <span class="copyright">{CREDIT_LINE}
+ <span class="copyright">{CREDIT_LINE}</span>
</div>
</body>
diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg
index 6568aeca08..0c50275208 100644
--- a/phpBB/styles/subsilver2/template/template.cfg
+++ b/phpBB/styles/subsilver2/template/template.cfg
@@ -19,7 +19,7 @@
# General Information about this template
name = subsilver2
copyright = &copy; phpBB Group, 2003
-version = 3.0.11
+version = 3.0.12
# Template inheritance
# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
index 8754acaaa2..bf20108f7b 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html
@@ -37,7 +37,7 @@
<td valign="top">
<table width="100%" cellspacing="0" cellpadding="2">
<tr>
- <td><div class="postbody">{history_row.MESSAGE}</div><div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div></td>
+ <td><div class="postbody"><!-- IF history_row.MESSAGE -->{history_row.MESSAGE}<!-- ELSE --><span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span><!-- ENDIF --></div><div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div></td>
</tr>
</table>
</td>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
index 24194e4c26..cd55c16a50 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
@@ -114,7 +114,7 @@ hr.sep {
<td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</span></td>
+ <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</span></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index e2266b7d38..4cd0f37a80 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -61,11 +61,13 @@
<td class="row1" width="50%"><b class="genmed">{L_POPUP_ON_PM}:</b></td>
<td class="row2"><input type="radio" class="radio" name="popuppm" value="1"<!-- IF S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="popuppm" value="0"<!-- IF not S_POPUP_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
</tr>
+<!-- IF S_MORE_LANGUAGES -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td>
<td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
</tr>
-<!-- IF S_STYLE_OPTIONS -->
+<!-- ENDIF -->
+<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
<tr>
<td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td>
<td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index 6511fa5349..ee6ec26ab2 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -155,7 +155,7 @@
<table width="100%" cellspacing="0">
<tr class="nav">
<td valign="middle">&nbsp;<!-- IF S_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{S_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF -->&nbsp;</td>
+ <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF -->&nbsp;</td>
</tr>
</table>
</td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_print.html b/phpBB/styles/subsilver2/template/viewtopic_print.html
index 964c95f677..1ca1eccc99 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_print.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_print.html
@@ -128,7 +128,7 @@ hr.sep {
<td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</span></td>
+ <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />https://www.phpbb.com/</span></td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index 444104ae3c..177a988e93 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -3,7 +3,7 @@
Style name: subsilver2
Based on style: subSilver (the default phpBB 2.0.x style)
Original author: Tom Beddard ( http://www.subblue.com/ )
- Modified by: phpBB Group ( http://www.phpbb.com/ )
+ Modified by: phpBB Group ( https://www.phpbb.com/ )
--------------------------------------------------------------
*/
diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg
index 5bd4480eef..5c58dc65d9 100644
--- a/phpBB/styles/subsilver2/theme/theme.cfg
+++ b/phpBB/styles/subsilver2/theme/theme.cfg
@@ -21,7 +21,7 @@
# General Information about this theme
name = subsilver2
copyright = &copy; phpBB Group, 2003
-version = 3.0.11
+version = 3.0.12
# Some configuration options
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 45caeb12ea..520ab3caad 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -320,12 +320,6 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
$module->set_display('main', 'subscribed', false);
}
-// Do not display signature panel if not authed to do so
-if (!$auth->acl_get('u_sig'))
-{
- $module->set_display('profile', 'signature', false);
-}
-
// Select the active module
$module->set_active($id, $mode);
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 74420a25c7..fb12dd925a 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -146,7 +146,14 @@ if ($view && !$post_id)
if (!$row)
{
- $user->setup('viewtopic');
+ $sql = 'SELECT forum_style
+ FROM ' . FORUMS_TABLE . "
+ WHERE forum_id = $forum_id";
+ $result = $db->sql_query($sql);
+ $forum_style = (int) $db->sql_fetchfield('forum_style');
+ $db->sql_freeresult($result);
+
+ $user->setup('viewtopic', $forum_style);
trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS');
}
else
diff --git a/phpunit.xml.all b/phpunit.xml.all
index 9e220ff559..d91a614c97 100644
--- a/phpunit.xml.all
+++ b/phpunit.xml.all
@@ -15,6 +15,10 @@
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
<exclude>./tests/functional</exclude>
+ <exclude>tests/lint_test.php</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.0" phpVersionOperator=">=">./tests/functional</directory>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index f8bf063d9a..4c91f8e373 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -15,6 +15,10 @@
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
<exclude>./tests/functional</exclude>
+ <exclude>tests/lint_test.php</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.0" phpVersionOperator=">=">./tests/functional</directory>
diff --git a/phpunit.xml.functional b/phpunit.xml.functional
index 376d52e6d8..919de74dec 100644
--- a/phpunit.xml.functional
+++ b/phpunit.xml.functional
@@ -15,6 +15,10 @@
<testsuite name="phpBB Test Suite">
<directory suffix="_test.php">./tests/</directory>
<exclude>./tests/functional</exclude>
+ <exclude>tests/lint_test.php</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.0" phpVersionOperator=">=">./tests/functional</directory>
diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md
new file mode 100644
index 0000000000..23c74f4411
--- /dev/null
+++ b/tests/RUNNING_TESTS.md
@@ -0,0 +1,151 @@
+Running Tests
+=============
+
+Prerequisites
+=============
+
+PHPUnit
+-------
+
+phpBB unit tests use the PHPUnit framework (see http://www.phpunit.de for more
+information). Version 3.5 or higher is required to run the tests. PHPUnit can
+be installed via Composer together with other development dependencies as
+follows.
+
+ $ cd phpBB
+ $ php ../composer.phar install --dev
+ $ cd ..
+
+PHP extensions
+--------------
+
+Unit tests use several PHP extensions that board code does not use. Currently
+the following PHP extensions must be installed and enabled to run unit tests:
+
+- ctype (also a PHPUnit dependency)
+- dom (PHPUnit dependency)
+
+Some of the functionality in phpBB and/or the test suite uses additional
+PHP extensions. If these extensions are not loaded, respective tests
+will be skipped:
+
+- apc (APC cache driver)
+- bz2 (compress tests)
+- interbase, pdo_firebird (Firebird database driver)
+- mysql, pdo_mysql (MySQL database driver)
+- mysqli, pdo_mysql (MySQLi database driver)
+- pdo (any database tests)
+- pgsql, pdo_pgsql (PostgreSQL database driver)
+- simplexml (any database tests)
+- sqlite, pdo_sqlite (SQLite database driver, requires SQLite 2.x support
+ in pdo_sqlite)
+- zlib (compress tests)
+
+Database Tests
+--------------
+
+By default all tests requiring a database connection will use sqlite. If you
+do not have sqlite installed the tests will be skipped. If you wish to run the
+tests on a different database you have to create a test_config.php file within
+your tests directory following the same format as phpBB's config.php. Testing
+makes use of a seperate database defined in this config file and before running
+the tests each time this database is deleted. An example for mysqli can be
+found below. More information on configuration options can be found on the
+wiki (see below).
+
+ <?php
+ $dbms = 'mysqli';
+ $dbhost = 'localhost';
+ $dbport = '';
+ $dbname = 'database';
+ $dbuser = 'user';
+ $dbpasswd = 'password';
+
+It is possible to have multiple test_config.php files, for example if you
+are testing on multiple databases. You can specify which test_config.php file
+to use in the environment as follows:
+
+ $ PHPBB_TEST_CONFIG=tests/test_config.php phpunit
+
+Alternatively you can specify parameters in the environment, so e.g. the
+following will run PHPUnit with the same parameters as in the shown
+test_config.php file:
+
+ $ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \
+ PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \
+ PHPBB_TEST_DBPASSWD='password' phpunit
+
+Special Database Cases
+----------------------
+In order to run tests on some of the databases that we support, it will be
+necessary to provide a custom DSN string in test_config.php. This is only
+needed for MSSQL 2000+ (PHP module), MSSQL via ODBC, and Firebird when
+PDO_Firebird does not work on your system
+(https://bugs.php.net/bug.php?id=61183). The variable must be named `$custom_dsn`.
+
+Examples:
+Firebird using http://www.firebirdsql.org/en/odbc-driver/
+
+ $custom_dsn = "Driver={Firebird/InterBase(r) driver};dbname=$dbhost:$dbname";
+
+MSSQL
+
+ $custom_dsn = "Driver={SQL Server Native Client 10.0};Server=$dbhost;Database=$dbname";
+
+The other fields in test_config.php should be filled out as you would normally
+to connect to that database in phpBB.
+
+Additionally, you will need to be running the DbUnit fork from
+https://github.com/phpbb/dbunit/tree/phpbb.
+
+Running
+=======
+
+Once the prerequisites are installed, run the tests from the project root
+directory (above phpBB):
+
+ $ phpBB/vendor/bin/phpunit
+
+Slow tests
+--------------
+
+Certain tests, such as the UTF-8 normalizer or the DNS tests tend to be slow.
+Thus these tests are in the `slow` group, which is excluded by default. You can
+enable slow tests by copying the phpunit.xml.all file to phpunit.xml. If you
+only want the slow tests, run:
+
+ $ phpBB/vendor/bin/phpunit --group slow
+
+Functional tests
+-----------------
+
+Functional tests test software the way a user would. They simulate a user
+browsing the website, but they do these steps in an automated way.
+phpBB allows you to write such tests.
+
+Running
+=======
+
+Running the tests requires your phpBB3 repository to be accessible through a
+local web server. You will need to supply the URL to the webserver in
+the 'tests/test_config.php' file. This is as simple as defining the
+'$phpbb_functional_url' variable, which contains the URL for the directory containing
+the board. Make sure you include the trailing slash. Note that without extensive
+changes to the test framework, you cannot use a board outside of the repository
+on which to run tests.
+
+ $phpbb_functional_url = 'http://localhost/phpBB3/';
+
+To then run the tests, you run PHPUnit, but use the phpunit.xml.functional
+config file instead of the default one. Specify this through the "-c" option:
+
+ $ phpBB/vendor/bin/phpunit -c phpunit.xml.functional
+
+This will change your board's config.php file, but it makes a backup at
+config_dev.php, so you can restore it after the test run is complete.
+
+More Information
+================
+
+Further information is available on phpbb wiki:
+http://wiki.phpbb.com/Automated_Tests
diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt
deleted file mode 100644
index b976545c22..0000000000
--- a/tests/RUNNING_TESTS.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-Running Tests
-=============
-
-Prerequisites
-=============
-
-PHPUnit
--------
-
-phpBB unit tests use PHPUnit framework. Version 3.5 or better is required
-to run the tests. PHPUnit prefers to be installed via PEAR; refer to
-http://www.phpunit.de/ for more information.
-
-PHP extensions
---------------
-
-Unit tests use several PHP extensions that board code does not use. Currently
-the following PHP extensions must be installed and enabled to run unit tests:
-
-- ctype
-
-Database Tests
---------------
-
-By default all tests requiring a database connection will use sqlite. If you
-do not have sqlite installed the tests will be skipped. If you wish to run the
-tests on a different database you have to create a test_config.php file within
-your tests directory following the same format as phpBB's config.php. An
-example for mysqli can be found below. More information on configuration
-options can be found on the wiki (see below).
-
- <?php
- $dbms = 'mysqli';
- $dbhost = 'localhost';
- $dbport = '';
- $dbname = 'database';
- $dbuser = 'user';
- $dbpasswd = 'password';
-
-It is possible to have multiple test_config.php files, for example if you
-are testing on multiple databases. You can specify which test_config.php file
-to use in the environment as follows:
-
- $ PHPBB_TEST_CONFIG=tests/test_config.php phpunit
-
-Alternatively you can specify parameters in the environment, so e.g. the
-following will run phpunit with the same parameters as in the shown
-test_config.php file:
-
- $ PHPBB_TEST_DBMS='mysqli' PHPBB_TEST_DBHOST='localhost' \
- PHPBB_TEST_DBNAME='database' PHPBB_TEST_DBUSER='user' \
- PHPBB_TEST_DBPASSWD='password' phpunit
-
-Running
-=======
-
-Once the prerequisites are installed, run the tests from the project root
-directory (above phpBB):
-
- $ phpunit
-
-Slow tests
---------------
-
-Certain tests, such as the UTF-8 normalizer or the DNS tests tend to be slow.
-Thus these tests are in the `slow` group, which is excluded by default. You can
-enable slow tests by copying the phpunit.xml.all file to phpunit.xml. If you
-only want the slow tests, run:
-
- $ phpunit --group slow
-
-More Information
-================
-
-Further information is available on phpbb wiki:
-http://wiki.phpbb.com/Unit_Tests
diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php
index 15bdfc434f..6b5afe5808 100644
--- a/tests/bbcode/url_bbcode_test.php
+++ b/tests/bbcode/url_bbcode_test.php
@@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
-require_once dirname(__FILE__) . '/../mock_user.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
class phpbb_url_bbcode_test extends phpbb_test_case
{
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index d6c5d25bc8..d687db622a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -22,5 +22,20 @@ require_once 'test_framework/phpbb_database_test_connection_manager.php';
if (version_compare(PHP_VERSION, '5.3.0-dev', '>='))
{
+ if (getenv('PHPBB_NO_COMPOSER_AUTOLOAD'))
+ {
+ if (getenv('PHPBB_AUTOLOAD'))
+ {
+ require(getenv('PHPBB_AUTOLOAD'));
+ }
+ }
+ else
+ {
+ if (!file_exists($phpbb_root_path . 'vendor/autoload.php'))
+ {
+ trigger_error('You have not set up composer dependencies. See http://getcomposer.org/.', E_USER_ERROR);
+ }
+ require($phpbb_root_path . 'vendor/autoload.php');
+ }
require_once 'test_framework/phpbb_functional_test_case.php';
}
diff --git a/tests/compress/archive/.gitkeep b/tests/compress/archive/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/compress/archive/.gitkeep
diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php
new file mode 100644
index 0000000000..ce193cf3ba
--- /dev/null
+++ b/tests/compress/compress_test.php
@@ -0,0 +1,173 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2012 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compress.php';
+
+class phpbb_compress_test extends phpbb_test_case
+{
+ const EXTRACT_DIR = '/extract/';
+ const ARCHIVE_DIR = '/archive/';
+
+ private $path;
+
+ protected $filelist = array(
+ '1.txt',
+ 'dir/2.txt',
+ 'dir/3.txt',
+ 'dir/subdir/4.txt',
+ );
+
+ protected function setUp()
+ {
+ // Required for compress::add_file
+ global $phpbb_root_path;
+ $phpbb_root_path = '';
+
+ $this->path = dirname(__FILE__) . '/fixtures/';
+ }
+
+ protected function check_extensions($extensions)
+ {
+ foreach ($extensions as $extension)
+ {
+ if (!@extension_loaded($extension))
+ {
+ $this->markTestSkipped("$extension extension is not loaded");
+ }
+ }
+ }
+
+ protected function tearDown()
+ {
+ foreach (array(dirname(__FILE__) . self::EXTRACT_DIR, dirname(__FILE__) . self::ARCHIVE_DIR) as $dir)
+ {
+ $this->clear_dir($dir);
+ }
+ }
+
+ protected function clear_dir($dir)
+ {
+ $iterator = new DirectoryIterator($dir);
+ foreach ($iterator as $fileinfo)
+ {
+ $name = $fileinfo->getFilename();
+ $path = $fileinfo->getPathname();
+
+ if ($name[0] !== '.')
+ {
+ if ($fileinfo->isDir())
+ {
+ $this->clear_dir($path);
+ rmdir($path);
+ }
+ else
+ {
+ unlink($path);
+ }
+ }
+ }
+ }
+
+ protected function archive_files($compress)
+ {
+ $compress->add_file($this->path . '1.txt', $this->path);
+ $compress->add_file(
+ 'tests/compress/fixtures/dir/',
+ 'tests/compress/fixtures/',
+ '',
+ // The comma here is not an error, this is a comma-separated list
+ 'subdir/4.txt,3.txt'
+ );
+ $compress->add_custom_file($this->path . 'dir/3.txt', 'dir/3.txt');
+ $compress->add_data(file_get_contents($this->path . 'dir/subdir/4.txt'), 'dir/subdir/4.txt');
+ }
+
+ protected function valid_extraction($extra = array())
+ {
+ $filelist = array_merge($this->filelist, $extra);
+
+ foreach ($filelist as $filename)
+ {
+ $path = dirname(__FILE__) . self::EXTRACT_DIR . $filename;
+ $this->assertTrue(file_exists($path));
+
+ // Check the file's contents is correct
+ $contents = explode('_', basename($filename, '.txt'));
+ $contents = $contents[0];
+ $this->assertEquals($contents . "\n", file_get_contents($path));
+ }
+ }
+
+ public function tar_archive_list()
+ {
+ return array(
+ array('archive.tar', '.tar', array()),
+ array('archive.tar.gz', '.tar.gz', array('zlib')),
+ array('archive.tar.bz2', '.tar.bz2', array('bz2')),
+ );
+ }
+
+ /**
+ * @dataProvider tar_archive_list
+ */
+ public function test_extract_tar($filename, $type, $extensions)
+ {
+ $this->check_extensions($extensions);
+ $compress = new compress_tar('r', $this->path . $filename);
+ $compress->extract('tests/compress/' . self::EXTRACT_DIR);
+ $this->valid_extraction();
+ }
+
+ public function test_extract_zip()
+ {
+ $compress = new compress_zip('r', $this->path . 'archive.zip');
+ $compress->extract('tests/compress/' . self::EXTRACT_DIR);
+ $this->valid_extraction();
+ }
+
+ /**
+ * @depends test_extract_tar
+ * @dataProvider tar_archive_list
+ */
+ public function test_compress_tar($filename, $type, $extensions)
+ {
+ $this->check_extensions($extensions);
+
+ $tar = dirname(__FILE__) . self::ARCHIVE_DIR . $filename;
+ $compress = new compress_tar('w', $tar);
+ $this->archive_files($compress);
+ $compress->close();
+ $this->assertTrue(file_exists($tar));
+
+ $compress->mode = 'r';
+ $compress->open();
+ $compress->extract('tests/compress/' . self::EXTRACT_DIR);
+ $this->valid_extraction();
+ }
+
+ /**
+ * @depends test_extract_zip
+ */
+ public function test_compress_zip()
+ {
+ $this->check_extensions(array('zlib'));
+
+ $zip = dirname(__FILE__) . self::ARCHIVE_DIR . 'archive.zip';
+ $compress = new compress_zip('w', $zip);
+ $this->archive_files($compress);
+ $compress->close();
+ $this->assertTrue(file_exists($zip));
+
+ $compress = new compress_zip('r', $zip);
+ $compress->extract('tests/compress/' . self::EXTRACT_DIR);
+ $this->valid_extraction();
+ }
+}
diff --git a/tests/compress/extract/.gitkeep b/tests/compress/extract/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/compress/extract/.gitkeep
diff --git a/tests/compress/fixtures/1.txt b/tests/compress/fixtures/1.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/tests/compress/fixtures/1.txt
@@ -0,0 +1 @@
+1
diff --git a/tests/compress/fixtures/archive.tar b/tests/compress/fixtures/archive.tar
new file mode 100644
index 0000000000..54ed56084e
--- /dev/null
+++ b/tests/compress/fixtures/archive.tar
Binary files differ
diff --git a/tests/compress/fixtures/archive.tar.bz2 b/tests/compress/fixtures/archive.tar.bz2
new file mode 100644
index 0000000000..04c0eccd74
--- /dev/null
+++ b/tests/compress/fixtures/archive.tar.bz2
Binary files differ
diff --git a/tests/compress/fixtures/archive.tar.gz b/tests/compress/fixtures/archive.tar.gz
new file mode 100644
index 0000000000..195e7a060a
--- /dev/null
+++ b/tests/compress/fixtures/archive.tar.gz
Binary files differ
diff --git a/tests/compress/fixtures/archive.zip b/tests/compress/fixtures/archive.zip
new file mode 100644
index 0000000000..bdb618fc26
--- /dev/null
+++ b/tests/compress/fixtures/archive.zip
Binary files differ
diff --git a/tests/compress/fixtures/dir/2.txt b/tests/compress/fixtures/dir/2.txt
new file mode 100644
index 0000000000..0cfbf08886
--- /dev/null
+++ b/tests/compress/fixtures/dir/2.txt
@@ -0,0 +1 @@
+2
diff --git a/tests/compress/fixtures/dir/3.txt b/tests/compress/fixtures/dir/3.txt
new file mode 100644
index 0000000000..00750edc07
--- /dev/null
+++ b/tests/compress/fixtures/dir/3.txt
@@ -0,0 +1 @@
+3
diff --git a/tests/compress/fixtures/dir/subdir/4.txt b/tests/compress/fixtures/dir/subdir/4.txt
new file mode 100644
index 0000000000..b8626c4cff
--- /dev/null
+++ b/tests/compress/fixtures/dir/subdir/4.txt
@@ -0,0 +1 @@
+4
diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php
new file mode 100644
index 0000000000..505ce28fa1
--- /dev/null
+++ b/tests/dbal/connect_test.php
@@ -0,0 +1,43 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_dbal_connect_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml');
+ }
+
+ public function test_failing_connect()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ $config = $this->get_database_config();
+
+ require_once dirname(__FILE__) . '/../../phpBB/includes/db/' . $config['dbms'] . '.php';
+ $dbal = 'dbal_' . $config['dbms'];
+ $db = new $dbal();
+
+ // Failure to connect results in a trigger_error call in dbal.
+ // phpunit converts triggered errors to exceptions.
+ // In particular there should be no fatals here.
+ try
+ {
+ $db->sql_connect($config['dbhost'], 'phpbbogus', 'phpbbogus', 'phpbbogus', $config['dbport']);
+ $this->assertFalse(true);
+ }
+ catch (Exception $e)
+ {
+ // should have a legitimate message
+ $this->assertNotEmpty($e->getMessage());
+ }
+ }
+}
diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php
index b50494d506..e17295a4ea 100644
--- a/tests/dbal/order_lower_test.php
+++ b/tests/dbal/order_lower_test.php
@@ -14,10 +14,15 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/styles.xml');
}
- public function test_cross_join()
+ public function test_order_lower()
{
$db = $this->new_dbal();
+ if (strpos($db->sql_layer, 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>='))
+ {
+ $this->markTestSkipped('MySQL 5.6 fails to order things correctly. See also: http://tracker.phpbb.com/browse/PHPBB3-11571 http://bugs.mysql.com/bug.php?id=69005');
+ }
+
// http://tracker.phpbb.com/browse/PHPBB3-10507
// Test ORDER BY LOWER(style_name)
$db->sql_return_on_error(true);
@@ -55,7 +60,7 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
'theme_id' => 2,
'imageset_id' => 2
)
- ),
+ ),
$db->sql_fetchrowset($result)
);
}
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 81cd13b006..6dbab05a41 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -17,7 +17,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/three_users.xml');
}
- public static function return_on_error_select_data()
+ static public function return_on_error_select_data()
{
return array(
array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))),
@@ -44,7 +44,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $db->sql_fetchrowset($result));
}
- public static function fetchrow_data()
+ static public function fetchrow_data()
{
return array(
array('', array(array('username_clean' => 'barfoo'),
@@ -95,7 +95,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- public static function fetchfield_data()
+ static public function fetchfield_data()
{
return array(
array('', array('barfoo', 'foobar', 'bertie')),
@@ -125,7 +125,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary);
}
- public static function fetchfield_seek_data()
+ static public function fetchfield_seek_data()
{
return array(
array(1, 'foobar'),
@@ -151,7 +151,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $field);
}
- public static function query_limit_data()
+ static public function query_limit_data()
{
return array(
array(0, 0, array(array('username_clean' => 'barfoo'),
@@ -192,7 +192,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals($expected, $ary);
}
- public static function like_expression_data()
+ static public function like_expression_data()
{
// * = any_char; # = one_char
return array(
@@ -229,7 +229,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- public static function in_set_data()
+ static public function in_set_data()
{
return array(
array('user_id', 3, false, false, array(array('username_clean' => 'bertie'))),
@@ -303,7 +303,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- public static function build_array_data()
+ static public function build_array_data()
{
return array(
array(array('username_clean' => 'barfoo'), array(array('username_clean' => 'barfoo'))),
diff --git a/tests/dbal/write_sequence_test.php b/tests/dbal/write_sequence_test.php
new file mode 100644
index 0000000000..8975cfbfb1
--- /dev/null
+++ b/tests/dbal/write_sequence_test.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_dbal_write_sequence_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/three_users.xml');
+ }
+
+ static public function write_sequence_data()
+ {
+ return array(
+ array(
+ 'ticket/11219',
+ 4,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider write_sequence_data
+ */
+ public function test_write_sequence($username, $expected)
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'INSERT INTO phpbb_users ' . $db->sql_build_array('INSERT', array(
+ 'username' => $username,
+ 'username_clean' => $username,
+ 'user_permissions' => '',
+ 'user_sig' => '',
+ 'user_occ' => '',
+ 'user_interests' => '',
+ ));
+ $db->sql_query($sql);
+
+ $this->assertEquals($expected, $db->sql_nextid());
+
+ $sql = "SELECT user_id
+ FROM phpbb_users
+ WHERE username_clean = '" . $db->sql_escape($username) . "'";
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals($expected, $db->sql_fetchfield('user_id'));
+ }
+}
diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php
index 596c50a220..ecfd774896 100644
--- a/tests/dbal/write_test.php
+++ b/tests/dbal/write_test.php
@@ -16,7 +16,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
}
- public static function build_array_insert_data()
+ static public function build_array_insert_data()
{
return array(
array(array(
@@ -104,7 +104,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- public static function update_data()
+ static public function update_data()
{
return array(
array(
diff --git a/tests/fixtures/empty.xml b/tests/fixtures/empty.xml
new file mode 100644
index 0000000000..195e30e38d
--- /dev/null
+++ b/tests/fixtures/empty.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_ip</column>
+ <column>session_browser</column>
+ </table>
+</dataset>
diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php
new file mode 100644
index 0000000000..3d8cabb086
--- /dev/null
+++ b/tests/functional/acp_groups_test.php
@@ -0,0 +1,21 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/common_groups_test.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test
+{
+ protected function get_url()
+ {
+ return 'adm/index.php?i=groups&mode=manage&action=edit';
+ }
+}
diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php
index e955dcb4df..afb4f15fc2 100644
--- a/tests/functional/auth_test.php
+++ b/tests/functional/auth_test.php
@@ -17,10 +17,18 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
$this->login();
// check for logout link
- $crawler = $this->request('GET', 'index.php');
+ $crawler = self::request('GET', 'index.php');
$this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text());
}
+ public function test_login_other()
+ {
+ $this->create_user('anothertestuser');
+ $this->login('anothertestuser');
+ $crawler = self::request('GET', 'index.php');
+ $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text());
+ }
+
/**
* @depends test_login
*/
@@ -30,11 +38,11 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
$this->add_lang('ucp');
// logout
- $crawler = $this->request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
+ $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
$this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text());
// look for a register link, which should be visible only when logged out
- $crawler = $this->request('GET', 'index.php');
+ $crawler = self::request('GET', 'index.php');
$this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
}
}
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php
index 26c18c4c1f..18a2ad9464 100644
--- a/tests/functional/browse_test.php
+++ b/tests/functional/browse_test.php
@@ -14,19 +14,19 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case
{
public function test_index()
{
- $crawler = $this->request('GET', 'index.php');
+ $crawler = self::request('GET', 'index.php');
$this->assertGreaterThan(0, $crawler->filter('.topiclist')->count());
}
public function test_viewforum()
{
- $crawler = $this->request('GET', 'viewforum.php?f=2');
+ $crawler = self::request('GET', 'viewforum.php?f=2');
$this->assertGreaterThan(0, $crawler->filter('.topiclist')->count());
}
public function test_viewtopic()
{
- $crawler = $this->request('GET', 'viewtopic.php?t=1');
+ $crawler = self::request('GET', 'viewtopic.php?t=1');
$this->assertGreaterThan(0, $crawler->filter('.postbody')->count());
}
}
diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test.php
new file mode 100644
index 0000000000..427a930cb9
--- /dev/null
+++ b/tests/functional/common_groups_test.php
@@ -0,0 +1,93 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+abstract class phpbb_functional_common_groups_test extends phpbb_functional_test_case
+{
+ abstract protected function get_url();
+
+ // Enable all avatars in the ACP
+ protected function enable_all_avatars()
+ {
+ $this->add_lang('acp/board');
+
+ $crawler = self::request('GET', 'adm/index.php?i=board&mode=avatar&sid=' . $this->sid);
+ // Check the default entries we should have
+ $this->assertContains($this->lang('ALLOW_REMOTE'), $crawler->text());
+ $this->assertContains($this->lang('ALLOW_AVATARS'), $crawler->text());
+ $this->assertContains($this->lang('ALLOW_LOCAL'), $crawler->text());
+
+ // Now start setting the needed settings
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[allow_avatar_local]']->select(1);
+ $form['config[allow_avatar_remote]']->select(1);
+ $form['config[allow_avatar_remote_upload]']->select(1);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('CONFIG_UPDATED'), $crawler->text());
+ }
+
+ public function groups_manage_test_data()
+ {
+ return array(
+ array('', 'GROUP_UPDATED'),
+ array('aa0000', 'GROUP_UPDATED'),
+
+ array('AAG000','WRONG_DATA_COLOUR'),
+ array('#AA0000', 'WRONG_DATA_COLOUR'),
+ );
+ }
+
+ /**
+ * @dataProvider groups_manage_test_data
+ */
+ public function test_groups_manage($input, $expected)
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('ucp', 'acp/groups'));
+
+ // Manage Administrators group
+ $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['group_colour']->setValue($input);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang($expected), $crawler->text());
+ }
+
+ public function group_avatar_min_max_data()
+ {
+ return array(
+ array('uploadurl', 'foo', 'TOO_SHORT'),
+ array('uploadurl', 'foobar', 'AVATAR_URL_INVALID'),
+ array('uploadurl', str_repeat('f', 256), 'TOO_LONG'),
+ array('remotelink', 'foo', 'TOO_SHORT'),
+ array('remotelink', 'foobar', 'AVATAR_URL_INVALID'),
+ array('remotelink', str_repeat('f', 256), 'TOO_LONG'),
+ );
+ }
+
+ /**
+ * @dataProvider group_avatar_min_max_data
+ */
+ public function test_group_avatar_min_max($form_name, $input, $expected)
+ {
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('ucp', 'acp/groups'));
+ $this->enable_all_avatars();
+
+ $crawler = self::request('GET', $this->get_url() . '&g=5&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form[$form_name]->setValue($input);
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang($expected), $crawler->text());
+ }
+}
diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php
new file mode 100644
index 0000000000..59f7341eb6
--- /dev/null
+++ b/tests/functional/forum_style_test.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_forum_style_test extends phpbb_functional_test_case
+{
+ public function test_default_forum_style()
+ {
+ $crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
+ $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+
+ $crawler = self::request('GET', 'viewtopic.php?t=1');
+ $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+
+ $crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
+ $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+ }
+
+ public function test_custom_forum_style()
+ {
+ $db = $this->get_db();
+ $this->add_style(2, 'test_style');
+ $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2');
+
+ $crawler = self::request('GET', 'viewtopic.php?t=1&f=2');
+ $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+
+ $crawler = self::request('GET', 'viewtopic.php?t=1');
+ $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+
+ $crawler = self::request('GET', 'viewtopic.php?t=1&view=next');
+ $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->attr('href'));
+
+ $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2');
+ $this->delete_style(2, 'test_style');
+ }
+}
diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php
new file mode 100644
index 0000000000..f65a7d0784
--- /dev/null
+++ b/tests/functional/mcp_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_mcp_test extends phpbb_functional_test_case
+{
+ public function test_post_new_topic()
+ {
+ $this->login();
+
+ // Test creating topic
+ $post = $this->create_topic(2, 'Test Topic 2', 'Testing move post with "Move posts" option from Quick-Moderator Tools.');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+ $this->assertContains('Testing move post with "Move posts" option from Quick-Moderator Tools.', $crawler->filter('html')->text());
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_post_new_topic
+ */
+ public function test_handle_quickmod($crawler)
+ {
+ // Test moving a post
+ $form = $crawler->selectButton('Go')->eq(1)->form();
+ $form['action']->select('merge');
+ $crawler = self::submit($form);
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_handle_quickmod
+ */
+ public function test_move_post_to_topic($crawler)
+ {
+ // Select the post in MCP
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form(array(
+ 'to_topic_id' => 1,
+ ));
+ $form['post_id_list'][0]->tick();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('MERGE_POSTS'), $crawler->filter('html')->text());
+
+ return $crawler;
+ }
+
+ /**
+ * @depends test_move_post_to_topic
+ */
+ public function test_confirm_result($crawler)
+ {
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
+ }
+}
diff --git a/tests/functional/posting_test.php b/tests/functional/posting_test.php
new file mode 100644
index 0000000000..7fd1e4fdcf
--- /dev/null
+++ b/tests/functional/posting_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_posting_test extends phpbb_functional_test_case
+{
+ public function test_post_new_topic()
+ {
+ $this->login();
+
+ // Test creating topic
+ $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+ $this->assertContains('This is a test topic posted by the testing framework.', $crawler->filter('html')->text());
+
+ // Test creating a reply
+ $post2 = $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post posted by the testing framework.');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
+ $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
+
+ // Test quoting a message
+ $crawler = self::request('GET', "posting.php?mode=quote&f=2&t={$post2['topic_id']}&p={$post2['post_id']}&sid={$this->sid}");
+ $this->assertContains('This is a test post posted by the testing framework.', $crawler->filter('html')->text());
+ }
+}
diff --git a/tests/functional/report_post_captcha_test.php b/tests/functional/report_post_captcha_test.php
new file mode 100644
index 0000000000..8283465041
--- /dev/null
+++ b/tests/functional/report_post_captcha_test.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+/**
+ * @group functional
+ */
+class phpbb_functional_report_post_captcha_test extends phpbb_functional_test_case
+{
+ public function test_guest_report_post()
+ {
+ $crawler = self::request('GET', 'report.php?f=2&p=1');
+ $this->add_lang('mcp');
+ $this->assertContains($this->lang('USER_CANNOT_REPORT'), $crawler->filter('html')->text());
+
+ $this->set_reporting_guest(1);
+ $crawler = self::request('GET', 'report.php?f=2&p=1');
+ $this->assertContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
+ $this->set_reporting_guest(-1);
+ }
+
+ public function test_user_report_post()
+ {
+ $this->login();
+ $crawler = self::request('GET', 'report.php?f=2&p=1');
+ $this->assertNotContains($this->lang('CONFIRM_CODE'), $crawler->filter('html')->text());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $crawler = self::submit($form);
+ $this->assertContains($this->lang('POST_REPORTED_SUCCESS'), $crawler->text());
+ }
+
+ protected function set_reporting_guest($report_post_allowed)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=permissions&icat=12&mode=setting_group_local&sid=' . $this->sid);
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+ $values["group_id[0]"] = 1;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+ $values["forum_id"] = 2;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $this->add_lang('acp/permissions');
+ $form = $crawler->selectButton($this->lang('APPLY_ALL_PERMISSIONS'))->form();
+ $values = $form->getValues();
+ $values["setting[1][2][f_report]"] = $report_post_allowed;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $crawler = self::request('GET', 'ucp.php?mode=logout&sid=' . $this->sid);
+ }
+}
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
new file mode 100644
index 0000000000..9c6b1edc5e
--- /dev/null
+++ b/tests/functional/ucp_groups_test.php
@@ -0,0 +1,21 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/common_groups_test.php';
+
+/**
+* @group functional
+*/
+class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test
+{
+ protected function get_url()
+ {
+ return 'ucp.php?i=groups&mode=manage&action=edit';
+ }
+}
diff --git a/tests/functions/clean_path_test.php b/tests/functions/clean_path_test.php
new file mode 100644
index 0000000000..bcbe9838d9
--- /dev/null
+++ b/tests/functions/clean_path_test.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_clean_path_test extends phpbb_test_case
+{
+ public function clean_path_test_data()
+ {
+ return array(
+ array('foo', 'foo'),
+ array('foo/bar', 'foo/bar'),
+ array('foo/bar/', 'foo/bar/'),
+ array('foo/./bar', 'foo/bar'),
+ array('foo/./././bar', 'foo/bar'),
+ array('foo/bar/.', 'foo/bar'),
+ array('./foo/bar', './foo/bar'),
+ array('../foo/bar', '../foo/bar'),
+ array('one/two/three', 'one/two/three'),
+ array('one/two/../three', 'one/three'),
+ array('one/../two/three', 'two/three'),
+ array('one/two/..', 'one'),
+ array('one/two/../', 'one/'),
+ array('one/two/../three/../four', 'one/four'),
+ array('one/two/three/../../four', 'one/four'),
+ );
+ }
+
+ /**
+ * @dataProvider clean_path_test_data
+ */
+ public function test_clean_path($input, $expected)
+ {
+ $output = phpbb_clean_path($input);
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/functions/fixtures/language_select.xml b/tests/functions/fixtures/language_select.xml
new file mode 100644
index 0000000000..d7232a3d28
--- /dev/null
+++ b/tests/functions/fixtures/language_select.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_lang">
+ <column>lang_id</column>
+ <column>lang_iso</column>
+ <column>lang_local_name</column>
+ <column>lang_english_name</column>
+ <row>
+ <value>1</value>
+ <value>en</value>
+ <value>English</value>
+ <value>English</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>cs</value>
+ <value>Čeština</value>
+ <value>Czech</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/obtain_online.xml b/tests/functions/fixtures/obtain_online.xml
new file mode 100644
index 0000000000..05bbe6a05e
--- /dev/null
+++ b/tests/functions/fixtures/obtain_online.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_sessions">
+ <column>session_id</column>
+ <column>session_user_id</column>
+ <column>session_forum_id</column>
+ <column>session_time</column>
+ <column>session_ip</column>
+ <column>session_viewonline</column>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username_clean</column>
+ <column>username</column>
+ <column>user_allow_viewonline</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>1</value>
+ <value>anonymous</value>
+ <value>anonymous</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>4</value>
+ <value>4</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>5</value>
+ <value>5</value>
+ <value>1</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>6</value>
+ <value>6</value>
+ <value>6</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>7</value>
+ <value>7</value>
+ <value>7</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>8</value>
+ <value>8</value>
+ <value>8</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>9</value>
+ <value>9</value>
+ <value>9</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>10</value>
+ <value>10</value>
+ <value>10</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/style_select.xml b/tests/functions/fixtures/style_select.xml
new file mode 100644
index 0000000000..12d6392ab5
--- /dev/null
+++ b/tests/functions/fixtures/style_select.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_styles">
+ <column>style_id</column>
+ <column>style_name</column>
+ <column>style_active</column>
+ <row>
+ <value>1</value>
+ <value>prosilver</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>subsilver2</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>zoo</value>
+ <value>0</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml
new file mode 100644
index 0000000000..de7fce8a08
--- /dev/null
+++ b/tests/functions/fixtures/validate_email.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <column>user_email_hash</column>
+ <row>
+ <value>1</value>
+ <value>admin</value>
+ <value>admin</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value>143317126117</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/fixtures/validate_username.xml b/tests/functions/fixtures/validate_username.xml
new file mode 100644
index 0000000000..fbe398469c
--- /dev/null
+++ b/tests/functions/fixtures/validate_username.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_groups">
+ <column>group_name</column>
+ <column>group_desc</column>
+ <row>
+ <value>foobar_group</value>
+ <value>test123</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>1</value>
+ <value>admin</value>
+ <value>admin</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>moderator</value>
+ <value>moderator</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php
new file mode 100644
index 0000000000..96ea2be132
--- /dev/null
+++ b/tests/functions/get_formatted_filesize_test.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_get_formatted_filesize_test extends phpbb_test_case
+{
+ public function get_formatted_filesize_test_data()
+ {
+ return array(
+ // exact powers of 2
+ array(1, '1 BYTES'),
+ array(1024, '1 KIB'),
+ array(1048576, '1 MIB'),
+ array(1073741824, '1 GIB'),
+ array(1099511627776, '1 TIB'),
+
+ // exact powers of 10
+ array(1000, '1000 BYTES'),
+ array(1000000, '976.56 KIB'),
+ array(1000000000, '953.67 MIB'),
+ array(1000000000000, '931.32 GIB'),
+ array(100000000000000, '90.95 TIB'),
+
+ array(0, '0 BYTES'),
+ array(2, '2 BYTES'),
+
+ array(1023, '1023 BYTES'),
+ array(1025, '1 KIB'),
+ array(1048575, '1024 KIB'),
+
+ // String values
+ // exact powers of 2
+ array('1', '1 BYTES'),
+ array('1024', '1 KIB'),
+ array('1048576', '1 MIB'),
+ array('1073741824', '1 GIB'),
+ array('1099511627776', '1 TIB'),
+
+ // exact powers of 10
+ array('1000', '1000 BYTES'),
+ array('1000000', '976.56 KIB'),
+ array('1000000000', '953.67 MIB'),
+ array('1000000000000', '931.32 GIB'),
+ array('100000000000000', '90.95 TIB'),
+
+ array('0', '0 BYTES'),
+ array('2', '2 BYTES'),
+
+ array('1023', '1023 BYTES'),
+ array('1025', '1 KIB'),
+ array('1048575', '1024 KIB'),
+ );
+ }
+
+ /**
+ * @dataProvider get_formatted_filesize_test_data
+ */
+ public function test_get_formatted_filesize($input, $expected)
+ {
+ $output = get_formatted_filesize($input);
+
+ $this->assertEquals($expected, $output);
+ }
+}
diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php
new file mode 100644
index 0000000000..4032ca5b58
--- /dev/null
+++ b/tests/functions/get_remote_file_test.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
+
+/**
+* @group slow
+*/
+class phpbb_functions_get_remote_file extends phpbb_test_case
+{
+ public function test_version_phpbb_com()
+ {
+ $hostname = 'version.phpbb.com';
+
+ if (!phpbb_checkdnsrr($hostname, 'A'))
+ {
+ $this->markTestSkipped(sprintf(
+ 'Could not find a DNS record for hostname %s. ' .
+ 'Assuming network is down.',
+ $hostname
+ ));
+ }
+
+ $errstr = $errno = null;
+ $file = get_remote_file($hostname, '/phpbb', '30x.txt', $errstr, $errno);
+
+ $this->assertNotEquals(
+ 0,
+ strlen($file),
+ 'Failed asserting that the response is not empty.'
+ );
+
+ $this->assertSame(
+ '',
+ $errstr,
+ 'Failed asserting that the error string is empty.'
+ );
+
+ $this->assertSame(
+ 0,
+ $errno,
+ 'Failed asserting that the error number is 0 (i.e. no error occurred).'
+ );
+
+ $lines = explode("\n", $file);
+
+ $this->assertGreaterThanOrEqual(
+ 2,
+ sizeof($lines),
+ 'Failed asserting that the version file has at least two lines.'
+ );
+
+ $this->assertStringStartsWith(
+ '3.',
+ $lines[0],
+ "Failed asserting that the first line of the version file starts with '3.'"
+ );
+
+ $this->assertNotSame(
+ false,
+ filter_var($lines[1], FILTER_VALIDATE_URL),
+ 'Failed asserting that the second line of the version file is a valid URL.'
+ );
+
+ $this->assertContains('http', $lines[1]);
+ $this->assertContains('phpbb.com', $lines[1], '', true);
+ }
+}
diff --git a/tests/functions/is_absolute_test.php b/tests/functions/is_absolute_test.php
new file mode 100644
index 0000000000..7630b7c58c
--- /dev/null
+++ b/tests/functions/is_absolute_test.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_functions_is_absolute_test extends phpbb_test_case
+{
+ static public function is_absolute_data()
+ {
+ return array(
+ // Empty
+ array('', false),
+
+ // Absolute unix style
+ array('/etc/phpbb', true),
+ // Unix does not support \ so that is not an absolute path
+ array('\etc\phpbb', false),
+
+ // Absolute windows style
+ array('c:\windows', true),
+ array('C:\Windows', true),
+ array('c:/windows', true),
+ array('C:/Windows', true),
+
+ // Executable
+ array('etc/phpbb', false),
+ array('explorer.exe', false),
+
+ // Relative subdir
+ array('Windows\System32', false),
+ array('Windows\System32\explorer.exe', false),
+ array('Windows/System32', false),
+ array('Windows/System32/explorer.exe', false),
+
+ // Relative updir
+ array('..\Windows\System32', false),
+ array('..\Windows\System32\explorer.exe', false),
+ array('../Windows/System32', false),
+ array('../Windows/System32/explorer.exe', false),
+ );
+ }
+
+ /**
+ * @dataProvider is_absolute_data
+ */
+ public function test_is_absolute($path, $expected)
+ {
+ $this->assertEquals($expected, is_absolute($path));
+ }
+}
diff --git a/tests/functions/language_select_test.php b/tests/functions/language_select_test.php
new file mode 100644
index 0000000000..3341e2a256
--- /dev/null
+++ b/tests/functions/language_select_test.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_functions_language_select_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/language_select.xml');
+ }
+
+ static public function language_select_data()
+ {
+ return array(
+ array('', '<option value="cs">Čeština</option><option value="en">English</option>'),
+ array('en', '<option value="cs">Čeština</option><option value="en" selected="selected">English</option>'),
+ array('cs', '<option value="cs" selected="selected">Čeština</option><option value="en">English</option>'),
+ array('de', '<option value="cs">Čeština</option><option value="en">English</option>'),
+ );
+ }
+
+ /**
+ * @dataProvider language_select_data
+ */
+ public function test_language_select($default, $expected)
+ {
+ global $db;
+ $db = $this->new_dbal();
+
+ $this->assertEquals($expected, language_select($default));
+ }
+}
diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php
new file mode 100644
index 0000000000..b3beb55a96
--- /dev/null
+++ b/tests/functions/obtain_online_test.php
@@ -0,0 +1,238 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/auth.php';
+
+class phpbb_functions_obtain_online_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/obtain_online.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $config, $db;
+
+ $db = $this->db = $this->new_dbal();
+ $config = array(
+ 'load_online_time' => 5,
+ );
+ }
+
+ static public function obtain_guest_count_data()
+ {
+ return array(
+ array(0, 2),
+ array(1, 1),
+ );
+ }
+
+ /**
+ * @dataProvider obtain_guest_count_data
+ */
+ public function test_obtain_guest_count($forum_id, $expected)
+ {
+ $this->db->sql_query('DELETE FROM phpbb_sessions');
+
+ $time = time();
+ $this->create_guest_sessions($time);
+ $this->assertEquals($expected, obtain_guest_count($forum_id));
+ }
+
+ static public function obtain_users_online_data()
+ {
+ return array(
+ array(0, false, array(
+ 'online_users' => array(2 => 2, 3 => 3, 6 => 6, 7 => 7, 10 => 10),
+ 'hidden_users' => array(6 => 6, 7 => 7, 10 => 10),
+ 'total_online' => 5,
+ 'visible_online' => 2,
+ 'hidden_online' => 3,
+ 'guests_online' => 0,
+ )),
+ array(0, true, array(
+ 'online_users' => array(2 => 2, 3 => 3, 6 => 6, 7 => 7, 10 => 10),
+ 'hidden_users' => array(6 => 6, 7 => 7, 10 => 10),
+ 'total_online' => 7,
+ 'visible_online' => 2,
+ 'hidden_online' => 3,
+ 'guests_online' => 2,
+ )),
+ array(1, false, array(
+ 'online_users' => array(3 => 3, 7 => 7),
+ 'hidden_users' => array(7 => 7),
+ 'total_online' => 2,
+ 'visible_online' => 1,
+ 'hidden_online' => 1,
+ 'guests_online' => 0,
+ )),
+ array(1, true, array(
+ 'online_users' => array(3 => 3, 7 => 7),
+ 'hidden_users' => array(7 => 7),
+ 'total_online' => 3,
+ 'visible_online' => 1,
+ 'hidden_online' => 1,
+ 'guests_online' => 1,
+ )),
+ array(2, false, array(
+ 'online_users' => array(),
+ 'hidden_users' => array(),
+ 'total_online' => 0,
+ 'visible_online' => 0,
+ 'hidden_online' => 0,
+ 'guests_online' => 0,
+ )),
+ array(2, true, array(
+ 'online_users' => array(),
+ 'hidden_users' => array(),
+ 'total_online' => 0,
+ 'visible_online' => 0,
+ 'hidden_online' => 0,
+ 'guests_online' => 0,
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider obtain_users_online_data
+ */
+ public function test_obtain_users_online($forum_id, $display_guests, $expected)
+ {
+ $this->db->sql_query('DELETE FROM phpbb_sessions');
+
+ global $config;
+ $config['load_online_guests'] = $display_guests;
+
+ $time = time();
+ $this->create_guest_sessions($time);
+ $this->create_user_sessions($time);
+ $this->assertEquals($expected, obtain_users_online($forum_id));
+ }
+
+ static public function obtain_users_online_string_data()
+ {
+ return array(
+ array(0, false, array(
+ 'online_userlist' => 'REGISTERED_USERS 2, 3',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 5REG_USERS_TOTAL_AND 2HIDDEN_USERS_TOTAL 3',
+ )),
+ array(0, true, array(
+ 'online_userlist' => 'REGISTERED_USERS 2, 3',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 7REG_USERS_TOTAL 2HIDDEN_USERS_TOTAL_AND 3GUEST_USERS_TOTAL 2',
+ )),
+ array(1, false, array(
+ 'online_userlist' => 'BROWSING_FORUM 3',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 2REG_USER_TOTAL_AND 1HIDDEN_USER_TOTAL 1',
+ )),
+ array(1, true, array(
+ 'online_userlist' => 'BROWSING_FORUM_GUEST 3 1',
+ 'l_online_users' => 'ONLINE_USERS_TOTAL 3REG_USER_TOTAL 1HIDDEN_USER_TOTAL_AND 1GUEST_USER_TOTAL 1',
+ )),
+ array(2, false, array(
+ 'online_userlist' => 'BROWSING_FORUM NO_ONLINE_USERS',
+ 'l_online_users' => 'ONLINE_USERS_ZERO_TOTAL 0REG_USERS_ZERO_TOTAL_AND 0HIDDEN_USERS_ZERO_TOTAL 0',
+ )),
+ array(2, true, array(
+ 'online_userlist' => 'BROWSING_FORUM_GUESTS NO_ONLINE_USERS 0',
+ 'l_online_users' => 'ONLINE_USERS_ZERO_TOTAL 0REG_USERS_ZERO_TOTAL 0HIDDEN_USERS_ZERO_TOTAL_AND 0GUEST_USERS_ZERO_TOTAL 0',
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider obtain_users_online_string_data
+ */
+ public function test_obtain_users_online_string($forum_id, $display_guests, $expected)
+ {
+ $this->db->sql_query('DELETE FROM phpbb_sessions');
+
+ global $config, $user, $auth;
+ $config['load_online_guests'] = $display_guests;
+ $user->lang = $this->load_language();
+ $auth = $this->getMock('auth');
+ $acl_get_map = array(
+ array('u_viewonline', true),
+ );
+ $auth->expects($this->any())
+ ->method('acl_get')
+ ->with($this->stringContains('_'),
+ $this->anything())
+ ->will($this->returnValueMap($acl_get_map));
+
+ $time = time();
+ $this->create_guest_sessions($time);
+ $this->create_user_sessions($time);
+
+ $online_users = obtain_users_online($forum_id);
+ $this->assertEquals($expected, obtain_users_online_string($online_users, $forum_id));
+ }
+
+ protected function create_guest_sessions($time)
+ {
+ $this->add_session(1, '0001', '192.168.0.1', 0, true, $time);
+ $this->add_session(1, '0002', '192.168.0.2', 1, true, $time);
+ $this->add_session(1, '0003', '192.168.0.3', 0, true, $time, 10);
+ $this->add_session(1, '0004', '192.168.0.4', 1, true, $time, 10);
+ }
+
+ protected function create_user_sessions($time)
+ {
+ $this->add_session(2, '0005', '192.168.0.5', 0, true, $time);
+ $this->add_session(3, '0006', '192.168.0.6', 1, true, $time);
+ $this->add_session(4, '0007', '192.168.0.7', 0, true, $time, 10);
+ $this->add_session(5, '0008', '192.168.0.8', 1, true, $time, 10);
+ $this->add_session(6, '0005', '192.168.0.9', 0, false, $time);
+ $this->add_session(7, '0006', '192.168.0.10', 1, false, $time);
+ $this->add_session(8, '0007', '192.168.0.11', 0, false, $time, 10);
+ $this->add_session(9, '0008', '192.168.0.12', 1, false, $time, 10);
+ $this->add_session(10, '009', '192.168.0.13', 0, false, $time);
+ }
+
+ protected function add_session($user_id, $session_id, $user_ip, $forum_id, $view_online, $time, $time_delta = 0)
+ {
+ $sql_ary = array(
+ 'session_id' => $user_id . '_' . $forum_id . '_session00000000000000000' . $session_id,
+ 'session_user_id' => $user_id,
+ 'session_ip' => $user_ip,
+ 'session_forum_id' => $forum_id,
+ 'session_time' => $time - $time_delta * 60,
+ 'session_viewonline' => $view_online,
+ );
+ $this->db->sql_query('INSERT INTO phpbb_sessions ' . $this->db->sql_build_array('INSERT', $sql_ary));
+ }
+
+ protected function load_language()
+ {
+ $lang = array(
+ 'NO_ONLINE_USERS' => 'NO_ONLINE_USERS',
+ 'REGISTERED_USERS' => 'REGISTERED_USERS',
+ 'BROWSING_FORUM' => 'BROWSING_FORUM %s',
+ 'BROWSING_FORUM_GUEST' => 'BROWSING_FORUM_GUEST %s %d',
+ 'BROWSING_FORUM_GUESTS' => 'BROWSING_FORUM_GUESTS %s %d',
+ );
+ $vars_online = array('ONLINE', 'REG', 'HIDDEN', 'GUEST');
+ foreach ($vars_online as $online)
+ {
+ $lang = array_merge($lang, array(
+ $online . '_USERS_ZERO_TOTAL' => $online . '_USERS_ZERO_TOTAL %d',
+ $online . '_USER_TOTAL' => $online . '_USER_TOTAL %d',
+ $online . '_USERS_TOTAL' => $online . '_USERS_TOTAL %d',
+ $online . '_USERS_ZERO_TOTAL_AND' => $online . '_USERS_ZERO_TOTAL_AND %d',
+ $online . '_USER_TOTAL_AND' => $online . '_USER_TOTAL_AND %d',
+ $online . '_USERS_TOTAL_AND' => $online . '_USERS_TOTAL_AND %d',
+ ));
+ }
+ return $lang;
+ }
+}
diff --git a/tests/functions/style_select_test.php b/tests/functions/style_select_test.php
new file mode 100644
index 0000000000..1e44f3c2cb
--- /dev/null
+++ b/tests/functions/style_select_test.php
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_functions_style_select_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/style_select.xml');
+ }
+
+ static public function style_select_data()
+ {
+ return array(
+ array('', false, '<option value="1">prosilver</option><option value="2">subsilver2</option>'),
+ array('', true, '<option value="1">prosilver</option><option value="2">subsilver2</option><option value="3">zoo</option>'),
+ array('1', false, '<option value="1" selected="selected">prosilver</option><option value="2">subsilver2</option>'),
+ array('1', true, '<option value="1" selected="selected">prosilver</option><option value="2">subsilver2</option><option value="3">zoo</option>'),
+ array('3', false, '<option value="1">prosilver</option><option value="2">subsilver2</option>'),
+ array('3', true, '<option value="1">prosilver</option><option value="2">subsilver2</option><option value="3" selected="selected">zoo</option>'),
+ );
+ }
+
+ /**
+ * @dataProvider style_select_data
+ */
+ public function test_style_select($default, $all, $expected)
+ {
+ global $db;
+ $db = $this->new_dbal();
+
+ $this->assertEquals($expected, style_select($default, $all));
+ }
+}
diff --git a/tests/functions/validate_data_helper.php b/tests/functions/validate_data_helper.php
new file mode 100644
index 0000000000..b92a3aa5eb
--- /dev/null
+++ b/tests/functions/validate_data_helper.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_functions_validate_data_helper
+{
+ protected $test_case;
+
+ public function __construct($test_case)
+ {
+ $this->test_case = $test_case;
+ }
+
+ /**
+ * Test provided input data with supplied checks and compare to expected
+ * results
+ *
+ * @param array $data Array containing one or more subarrays with the
+ * test data. The first element of a subarray is the
+ * expected result, the second one is the input, and the
+ * third is the data that should be passed to the function
+ * validate_data().
+ */
+ public function assert_valid_data($data)
+ {
+ foreach ($data as $key => $test)
+ {
+ $this->test_case->assertEquals($test[0], validate_data(array($test[1]), array($test[2])));
+ }
+ }
+}
diff --git a/tests/functions/validate_date_test.php b/tests/functions/validate_date_test.php
new file mode 100644
index 0000000000..1dcd1361a2
--- /dev/null
+++ b/tests/functions/validate_date_test.php
@@ -0,0 +1,82 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_date_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_date()
+ {
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ array('INVALID'),
+ '',
+ array('date'),
+ ),
+ 'empty_opt' => array(
+ array(),
+ '',
+ array('date', true),
+ ),
+ 'double_single' => array(
+ array(),
+ '17-06-1990',
+ array('date'),
+ ),
+ 'single_single' => array(
+ array(),
+ '05-05-2009',
+ array('date'),
+ ),
+ 'double_double' => array(
+ array(),
+ '17-12-1990',
+ array('date'),
+ ),
+ 'month_high' => array(
+ array('INVALID'),
+ '17-17-1990',
+ array('date'),
+ ),
+ 'month_low' => array(
+ array('INVALID'),
+ '01-00-1990',
+ array('date'),
+ ),
+ 'day_high' => array(
+ array('INVALID'),
+ '64-01-1990',
+ array('date'),
+ ),
+ 'day_low' => array(
+ array('INVALID'),
+ '00-12-1990',
+ array('date'),
+ ),
+ // Currently fails
+ /*
+ 'zero_year' => array(
+ array(),
+ '01-01-0000',
+ array('date'),
+ ),
+ */
+ ));
+ }
+}
diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php
new file mode 100644
index 0000000000..9a6ce39251
--- /dev/null
+++ b/tests/functions/validate_email_test.php
@@ -0,0 +1,108 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_email_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $user;
+ protected $helper;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_email.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->user = new phpbb_mock_user;
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ /**
+ * Get validation prerequesites
+ *
+ * @param bool $check_mx Whether mx records should be checked
+ */
+ protected function set_validation_prerequisites($check_mx)
+ {
+ global $config, $db, $user;
+
+ $config['email_check_mx'] = $check_mx;
+ $db = $this->db;
+ $user = $this->user;
+ $user->optionset('banned_users', array('banned@example.com'));
+ }
+
+ public function test_validate_email()
+ {
+ $this->set_validation_prerequisites(false);
+
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ array(),
+ '',
+ array('email'),
+ ),
+ 'allowed' => array(
+ array(),
+ 'foobar@example.com',
+ array('email', 'foobar@example.com'),
+ ),
+ 'invalid' => array(
+ array('EMAIL_INVALID'),
+ 'fööbar@example.com',
+ array('email'),
+ ),
+ 'valid_complex' => array(
+ array(),
+ "'%$~test@example.com",
+ array('email'),
+ ),
+ 'taken' => array(
+ array('EMAIL_TAKEN'),
+ 'admin@example.com',
+ array('email'),
+ ),
+ 'banned' => array(
+ array('EMAIL_BANNED'),
+ 'banned@example.com',
+ array('email'),
+ ),
+ ));
+ }
+
+ /**
+ * @group slow
+ */
+ public function test_validate_email_mx()
+ {
+ $this->set_validation_prerequisites(true);
+
+ $this->helper->assert_valid_data(array(
+ 'valid' => array(
+ array(),
+ 'foobar@phpbb.com',
+ array('email'),
+ ),
+ 'no_mx' => array(
+ array('DOMAIN_NO_MX_RECORD'),
+ 'test@does-not-exist.phpbb.com',
+ array('email'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_hex_colour_test.php b/tests/functions/validate_hex_colour_test.php
new file mode 100644
index 0000000000..812ebe5eeb
--- /dev/null
+++ b/tests/functions/validate_hex_colour_test.php
@@ -0,0 +1,121 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+
+class phpbb_functions_validate_hex_colour_test extends phpbb_test_case
+{
+ public function positive_match_data()
+ {
+ return array(
+ array('a00'),
+ array('AFF'),
+ array('AA0000'),
+ array('aa00FF'),
+ array('000'),
+ array('000000'),
+ );
+ }
+
+ public function negative_match_data()
+ {
+ return array(
+ // Invalid prefix
+ array('#aa0'),
+ array('#AA0000'),
+ array('vAA0000'),
+
+ // Invalid suffix
+ array('AA0000v'),
+
+ // Correct length, but out of hex range
+ array('ag0'),
+ array('AAG000'),
+
+ // Too long
+ array('AA00000'),
+ array('AA0000 '),
+ array('AA0000 abf'),
+ array('AA0000 AA0000'),
+
+ // empty()
+ array('0'),
+ );
+ }
+
+ public function optional_only_data()
+ {
+ return array(
+ // The empty colour, i.e. "no colour".
+ array(''),
+ );
+ }
+
+ public function strict_negative_match_data()
+ {
+ return array_merge(
+ $this->negative_match_data(),
+ $this->optional_only_data()
+ );
+ }
+
+ public function nonstrict_positive_match_data()
+ {
+ return array_merge(
+ $this->positive_match_data(),
+ $this->optional_only_data()
+ );
+ }
+
+ /**
+ * @dataProvider positive_match_data
+ */
+ public function test_strict_positive_match($input)
+ {
+ $this->assertFalse(
+ phpbb_validate_hex_colour($input, false),
+ "Failed asserting that $input passes as a valid hex colour."
+ );
+ }
+
+ /**
+ * @dataProvider strict_negative_match_data
+ */
+ public function test_strict_negative_match($input)
+ {
+ $this->assertSame(
+ 'WRONG_DATA',
+ phpbb_validate_hex_colour($input, false),
+ "Failed asserting that $input does not pass as a valid hex colour."
+ );
+ }
+
+ /**
+ * @dataProvider nonstrict_positive_match_data
+ */
+ public function test_nonstrict_positive_match($input)
+ {
+ $this->assertFalse(
+ phpbb_validate_hex_colour($input, true),
+ "Failed asserting that $input passes as a valid or optional hex colour."
+ );
+ }
+
+ /**
+ * @dataProvider negative_match_data
+ */
+ public function test_nonstrict_negative_match($input)
+ {
+ $this->assertSame(
+ 'WRONG_DATA',
+ phpbb_validate_hex_colour($input, true),
+ "Failed asserting that $input does not pass as a valid or optional hex colour."
+ );
+ }
+}
diff --git a/tests/functions/validate_jabber_test.php b/tests/functions/validate_jabber_test.php
new file mode 100644
index 0000000000..5a53c963bd
--- /dev/null
+++ b/tests/functions/validate_jabber_test.php
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_jabber_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_jabber()
+ {
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ array(),
+ '',
+ array('jabber'),
+ ),
+ 'no_seperator' => array(
+ array('WRONG_DATA'),
+ 'testjabber.ccc',
+ array('jabber'),
+ ),
+ 'no_user' => array(
+ array('WRONG_DATA'),
+ '@jabber.ccc',
+ array('jabber'),
+ ),
+ 'no_realm' => array(
+ array('WRONG_DATA'),
+ 'user@',
+ array('jabber'),
+ ),
+ 'dot_realm' => array(
+ array('WRONG_DATA'),
+ 'user@.....',
+ array('jabber'),
+ ),
+ '-realm' => array(
+ array('WRONG_DATA'),
+ 'user@-jabber.ccc',
+ array('jabber'),
+ ),
+ 'realm-' => array(
+ array('WRONG_DATA'),
+ 'user@jabber.ccc-',
+ array('jabber'),
+ ),
+ 'correct' => array(
+ array(),
+ 'user@jabber.09A-z.org',
+ array('jabber'),
+ ),
+ 'prohibited' => array(
+ array('WRONG_DATA'),
+ 'u@ser@jabber.ccc.org',
+ array('jabber'),
+ ),
+ 'prohibited_char' => array(
+ array('WRONG_DATA'),
+ 'u<s>er@jabber.ccc.org',
+ array('jabber'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_lang_iso_test.php b/tests/functions/validate_lang_iso_test.php
new file mode 100644
index 0000000000..c8a5b71021
--- /dev/null
+++ b/tests/functions/validate_lang_iso_test.php
@@ -0,0 +1,60 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_lang_iso_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $helper;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/language_select.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_lang_iso()
+ {
+ global $db;
+
+ $db = $this->db;
+
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ array('WRONG_DATA'),
+ '',
+ array('language_iso_name'),
+ ),
+ 'en' => array(
+ array(),
+ 'en',
+ array('language_iso_name'),
+ ),
+ 'cs' => array(
+ array(),
+ 'cs',
+ array('language_iso_name'),
+ ),
+ 'de' => array(
+ array('WRONG_DATA'),
+ 'de',
+ array('language_iso_name'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_match_test.php b/tests/functions/validate_match_test.php
new file mode 100644
index 0000000000..73a363e003
--- /dev/null
+++ b/tests/functions/validate_match_test.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_match_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_match()
+ {
+ $this->helper->assert_valid_data(array(
+ 'empty_opt' => array(
+ array(),
+ '',
+ array('match', true, '/[a-z]$/'),
+ ),
+ 'empty_empty_match' => array(
+ array(),
+ '',
+ array('match'),
+ ),
+ 'foobar' => array(
+ array(),
+ 'foobar',
+ array('match', false, '/[a-z]$/'),
+ ),
+ 'foobar_fail' => array(
+ array('WRONG_DATA'),
+ 'foobar123',
+ array('match', false, '/[a-z]$/'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_num_test.php b/tests/functions/validate_num_test.php
new file mode 100644
index 0000000000..4deac02ebc
--- /dev/null
+++ b/tests/functions/validate_num_test.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_num_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_num()
+ {
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ array(),
+ '',
+ array('num'),
+ ),
+ 'zero' => array(
+ array(),
+ '0',
+ array('num'),
+ ),
+ 'five_minmax_correct' => array(
+ array(),
+ '5',
+ array('num', false, 2, 6),
+ ),
+ 'five_minmax_short' => array(
+ array('TOO_SMALL'),
+ '5',
+ array('num', false, 7, 10),
+ ),
+ 'five_minmax_long' => array(
+ array('TOO_LARGE'),
+ '5',
+ array('num', false, 2, 3),
+ ),
+ 'string' => array(
+ array(),
+ 'foobar',
+ array('num'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php
new file mode 100644
index 0000000000..4639f6cc89
--- /dev/null
+++ b/tests/functions/validate_password_test.php
@@ -0,0 +1,96 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_password_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function validate_password_data()
+ {
+ return array(
+ array('PASS_TYPE_ANY', array(
+ 'empty' => array(),
+ 'foobar_any' => array(),
+ 'foobar_mixed' => array(),
+ 'foobar_alpha' => array(),
+ 'foobar_symbol' => array(),
+ )),
+ array('PASS_TYPE_CASE', array(
+ 'empty' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_mixed' => array(),
+ 'foobar_alpha' => array(),
+ 'foobar_symbol' => array(),
+ )),
+ array('PASS_TYPE_ALPHA', array(
+ 'empty' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_mixed' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array(),
+ 'foobar_symbol' => array(),
+ )),
+ array('PASS_TYPE_SYMBOL', array(
+ 'empty' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_mixed' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array('INVALID_CHARS'),
+ 'foobar_symbol' => array(),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider validate_password_data
+ */
+ public function test_validate_password($pass_complexity, $expected)
+ {
+ global $config;
+
+ // Set complexity to mixed case letters, numbers and symbols
+ $config['pass_complex'] = $pass_complexity;
+
+ $this->helper->assert_valid_data(array(
+ 'empty' => array(
+ $expected['empty'],
+ '',
+ array('password'),
+ ),
+ 'foobar_any' => array(
+ $expected['foobar_any'],
+ 'foobar',
+ array('password'),
+ ),
+ 'foobar_mixed' => array(
+ $expected['foobar_mixed'],
+ 'FooBar',
+ array('password'),
+ ),
+ 'foobar_alpha' => array(
+ $expected['foobar_alpha'],
+ 'F00bar',
+ array('password'),
+ ),
+ 'foobar_symbol' => array(
+ $expected['foobar_symbol'],
+ 'fooBar123*',
+ array('password'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php
new file mode 100644
index 0000000000..ab44c28541
--- /dev/null
+++ b/tests/functions/validate_string_test.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_string_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_string()
+ {
+ $this->helper->assert_valid_data(array(
+ 'empty_opt' => array(
+ array(),
+ '',
+ array('string', true),
+ ),
+ 'empty' => array(
+ array(),
+ '',
+ array('string'),
+ ),
+ 'foo' => array(
+ array(),
+ 'foobar',
+ array('string'),
+ ),
+ 'foo_minmax_correct' => array(
+ array(),
+ 'foobar',
+ array('string', false, 2, 6),
+ ),
+ 'foo_minmax_short' => array(
+ array('TOO_SHORT'),
+ 'foobar',
+ array('string', false, 7, 9),
+ ),
+ 'foo_minmax_long' => array(
+ array('TOO_LONG'),
+ 'foobar',
+ array('string', false, 2, 5),
+ ),
+ 'empty_short' => array(
+ array('TOO_SHORT'),
+ '',
+ array('string', false, 1, 6),
+ ),
+ 'empty_length_opt' => array(
+ array(),
+ '',
+ array('string', true, 1, 6),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php
new file mode 100644
index 0000000000..0819974e54
--- /dev/null
+++ b/tests/functions/validate_username_test.php
@@ -0,0 +1,190 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_data_test extends phpbb_database_test_case
+{
+ protected $db;
+ protected $cache;
+ protected $helper;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/validate_username.xml');
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->db = $this->new_dbal();
+ $this->cache = new phpbb_mock_cache;
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function validate_username_data()
+ {
+ return array(
+ array('USERNAME_CHARS_ANY', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array(),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array(),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array(),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('USERNAME_TAKEN'),
+ )),
+ array('USERNAME_ALPHA_ONLY', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array('INVALID_CHARS'),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array('INVALID_CHARS'),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('INVALID_CHARS'),
+ )),
+ array('USERNAME_ALPHA_SPACERS', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array(),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array('INVALID_CHARS'),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('USERNAME_TAKEN'),
+ )),
+ array('USERNAME_LETTER_NUM', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array('INVALID_CHARS'),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array('INVALID_CHARS'),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('INVALID_CHARS'),
+ )),
+ array('USERNAME_LETTER_NUM_SPACERS', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array('INVALID_CHARS'),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array(),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array(),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('USERNAME_TAKEN'),
+ )),
+ array('USERNAME_ASCII', array(
+ 'foobar_allow' => array(),
+ 'foobar_ascii' => array(),
+ 'foobar_any' => array(),
+ 'foobar_alpha' => array(),
+ 'foobar_alpha_spacers' => array(),
+ 'foobar_letter_num' => array(),
+ 'foobar_letter_num_sp' => array('INVALID_CHARS'),
+ 'foobar_quot' => array('INVALID_CHARS'),
+ 'barfoo_disallow' => array('USERNAME_DISALLOWED'),
+ 'admin_taken' => array('USERNAME_TAKEN'),
+ 'group_taken' => array('USERNAME_TAKEN'),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider validate_username_data
+ */
+ public function test_validate_username($allow_name_chars, $expected)
+ {
+ global $cache, $config, $db;
+
+ $db = $this->db;
+ $cache = $this->cache;
+ $cache->put('_disallowed_usernames', array('barfoo'));
+
+ $config['allow_name_chars'] = $allow_name_chars;
+
+ $this->helper->assert_valid_data(array(
+ 'foobar_allow' => array(
+ $expected['foobar_allow'],
+ 'foobar',
+ array('username', 'foobar'),
+ ),
+ 'foobar_ascii' => array(
+ $expected['foobar_ascii'],
+ 'foobar',
+ array('username'),
+ ),
+ 'foobar_any' => array(
+ $expected['foobar_any'],
+ 'f*~*^=oo_bar1',
+ array('username'),
+ ),
+ 'foobar_alpha' => array(
+ $expected['foobar_alpha'],
+ 'fo0Bar',
+ array('username'),
+ ),
+ 'foobar_alpha_spacers' => array(
+ $expected['foobar_alpha_spacers'],
+ 'Fo0-[B]_a+ R',
+ array('username'),
+ ),
+ 'foobar_letter_num' => array(
+ $expected['foobar_letter_num'],
+ 'fo0Bar0',
+ array('username'),
+ ),
+ 'foobar_letter_num_sp' => array(
+ $expected['foobar_letter_num_sp'],
+ 'Fö0-[B]_a+ R',
+ array('username'),
+ ),
+ 'foobar_quot' => array(
+ $expected['foobar_quot'],
+ '"foobar"',
+ array('username'),
+ ),
+ 'barfoo_disallow' => array(
+ $expected['barfoo_disallow'],
+ 'barfoo',
+ array('username'),
+ ),
+ 'admin_taken' => array(
+ $expected['admin_taken'],
+ 'admin',
+ array('username'),
+ ),
+ 'group_taken' => array(
+ $expected['group_taken'],
+ 'foobar_group',
+ array('username'),
+ ),
+ ));
+ }
+}
diff --git a/tests/functions_database_helper/fixtures/bookmarks_duplicates.xml b/tests/functions_database_helper/fixtures/bookmarks_duplicates.xml
new file mode 100644
index 0000000000..d49f76b073
--- /dev/null
+++ b/tests/functions_database_helper/fixtures/bookmarks_duplicates.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_bookmarks">
+ <column>user_id</column>
+ <column>topic_id</column>
+
+ <!-- one entry for this topic -->
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+
+ <!-- non-conflicting entries -->
+ <row>
+ <value>2</value>
+ <value>2</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ </row>
+
+ <!-- conflicting entries -->
+ <row>
+ <value>1</value>
+ <value>4</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ </row>
+
+ <!-- conflicting and non-conflicting entries -->
+ <row>
+ <value>1</value>
+ <value>6</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>7</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>6</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions_database_helper/fixtures/topics_watch_duplicates.xml b/tests/functions_database_helper/fixtures/topics_watch_duplicates.xml
new file mode 100644
index 0000000000..c387bb737a
--- /dev/null
+++ b/tests/functions_database_helper/fixtures/topics_watch_duplicates.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics_watch">
+ <column>user_id</column>
+ <column>topic_id</column>
+ <column>notify_status</column>
+
+ <!-- one entry for this topic -->
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ </row>
+
+ <!-- non-conflicting entries -->
+ <row>
+ <value>1</value>
+ <value>2</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>3</value>
+ <value>0</value>
+ </row>
+
+ <!-- conflicting entries, same notify status -->
+ <row>
+ <value>1</value>
+ <value>4</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>5</value>
+ <value>1</value>
+ </row>
+
+ <!-- conflicting entries, notify status 0 into 1 -->
+ <row>
+ <value>1</value>
+ <value>6</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>7</value>
+ <value>1</value>
+ </row>
+
+ <!-- conflicting entries, notify status 1 into 0 -->
+ <row>
+ <value>1</value>
+ <value>8</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>9</value>
+ <value>0</value>
+ </row>
+
+ <!-- conflicting and non-conflicting entries -->
+ <row>
+ <value>1</value>
+ <value>10</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>11</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>10</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php b/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php
new file mode 100644
index 0000000000..d4881daf7e
--- /dev/null
+++ b/tests/functions_database_helper/update_rows_avoiding_duplicates_notify_status_test.php
@@ -0,0 +1,101 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_database_helper.php';
+
+class phpbb_update_rows_avoiding_duplicates_notify_status_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/topics_watch_duplicates.xml');
+ }
+
+ public static function fixture_data()
+ {
+ return array(
+ // description
+ // from array
+ // to value
+ // expected count with to value post update
+ // expected notify_status values
+ array(
+ 'trivial',
+ array(1),
+ 1000,
+ 1,
+ 1,
+ ),
+ array(
+ 'no conflict',
+ array(2),
+ 3,
+ 2,
+ 1,
+ ),
+ array(
+ 'conflict, same notify status',
+ array(4),
+ 5,
+ 1,
+ 1,
+ ),
+ array(
+ 'conflict, notify status 0 into 1',
+ array(6),
+ 7,
+ 1,
+ 0,
+ ),
+ array(
+ 'conflict, notify status 1 into 0',
+ array(8),
+ 9,
+ 1,
+ 0,
+ ),
+ array(
+ 'conflict and no conflict',
+ array(10),
+ 11,
+ 2,
+ 0,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider fixture_data
+ */
+ public function test_update($description, $from, $to, $expected_result_count, $expected_notify_status)
+ {
+ $db = $this->new_dbal();
+
+ phpbb_update_rows_avoiding_duplicates_notify_status($db, TOPICS_WATCH_TABLE, 'topic_id', $from, $to);
+
+ $sql = 'SELECT COUNT(*) AS remaining_rows
+ FROM ' . TOPICS_WATCH_TABLE . '
+ WHERE topic_id = ' . (int) $to;
+ $result = $db->sql_query($sql);
+ $result_count = $db->sql_fetchfield('remaining_rows');
+ $db->sql_freeresult($result);
+
+ $this->assertEquals($expected_result_count, $result_count);
+
+ // user id of 1 is the user being updated
+ $sql = 'SELECT notify_status
+ FROM ' . TOPICS_WATCH_TABLE . '
+ WHERE topic_id = ' . (int) $to . '
+ AND user_id = 1';
+ $result = $db->sql_query($sql);
+ $notify_status = $db->sql_fetchfield('notify_status');
+ $db->sql_freeresult($result);
+
+ $this->assertEquals($expected_notify_status, $notify_status);
+ }
+}
diff --git a/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php b/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php
new file mode 100644
index 0000000000..2f01d29d15
--- /dev/null
+++ b/tests/functions_database_helper/update_rows_avoiding_duplicates_test.php
@@ -0,0 +1,71 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_database_helper.php';
+
+class phpbb_update_rows_avoiding_duplicates_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/bookmarks_duplicates.xml');
+ }
+
+ public static function fixture_data()
+ {
+ return array(
+ // description
+ // from array
+ // to value
+ // expected count with to value post update
+ array(
+ 'trivial',
+ array(1),
+ 10,
+ 1,
+ ),
+ array(
+ 'no conflict',
+ array(2),
+ 3,
+ 2,
+ ),
+ array(
+ 'conflict',
+ array(4),
+ 5,
+ 1,
+ ),
+ array(
+ 'conflict and no conflict',
+ array(6),
+ 7,
+ 2,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider fixture_data
+ */
+ public function test_update($description, $from, $to, $expected_result_count)
+ {
+ $db = $this->new_dbal();
+
+ phpbb_update_rows_avoiding_duplicates($db, BOOKMARKS_TABLE, 'topic_id', $from, $to);
+
+ $sql = 'SELECT COUNT(*) AS remaining_rows
+ FROM ' . BOOKMARKS_TABLE . '
+ WHERE topic_id = ' . (int) $to;
+ $result = $db->sql_query($sql);
+ $result_count = $db->sql_fetchfield('remaining_rows');
+ $db->sql_freeresult($result);
+
+ $this->assertEquals($expected_result_count, $result_count);
+ }
+}
diff --git a/tests/lint_test.php b/tests/lint_test.php
new file mode 100644
index 0000000000..905067072d
--- /dev/null
+++ b/tests/lint_test.php
@@ -0,0 +1,74 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_lint_test extends phpbb_test_case
+{
+ static protected $exclude;
+
+ static public function setUpBeforeClass()
+ {
+ $output = array();
+ $status = 1;
+ exec('(php -v) 2>&1', $output, $status);
+ if ($status)
+ {
+ $output = implode("\n", $output);
+ self::markTestSkipped("php is not in PATH or broken: $output");
+ }
+
+ self::$exclude = array(
+ // 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()
+ {
+ 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);
+ }
+
+ protected function check($root)
+ {
+ $dh = opendir($root);
+ while (($filename = readdir($dh)) !== false)
+ {
+ if ($filename == '.' || $filename == '..' || $filename == 'git')
+ {
+ continue;
+ }
+ $path = $root . '/' . $filename;
+ // skip symlinks to avoid infinite loops
+ if (is_link($path))
+ {
+ continue;
+ }
+ if (is_dir($path) && !in_array($path, self::$exclude))
+ {
+ $this->check($path);
+ }
+ else if (substr($filename, strlen($filename)-4) == '.php')
+ {
+ // assume php binary is called php and it is in PATH
+ $cmd = '(php -l ' . escapeshellarg($path) . ') 2>&1';
+ $output = array();
+ $status = 1;
+ exec($cmd, $output, $status);
+ $output = implode("\n", $output);
+ $this->assertEquals(0, $status, "php -l failed for $path:\n$output");
+ }
+ }
+ }
+}
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 650545c3d6..acf4288319 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -34,6 +34,16 @@ class phpbb_mock_cache
$this->data[$var_name] = $var;
}
+ public function destroy($var_name, $table = '')
+ {
+ if ($table)
+ {
+ throw new Exception('Destroying tables is not implemented yet');
+ }
+
+ unset($this->data[$var_name]);
+ }
+
/**
* Obtain active bots
*/
@@ -41,7 +51,7 @@ class phpbb_mock_cache
{
return $this->data['_bots'];
}
-
+
/**
* Obtain list of word censors. We don't need to parse them here,
* that is tested elsewhere.
@@ -64,6 +74,21 @@ class phpbb_mock_cache
);
}
+ /**
+ * Obtain disallowed usernames. Input data via standard put method.
+ */
+ public function obtain_disallowed_usernames()
+ {
+ if (($usernames = $this->get('_disallowed_usernames')) !== false)
+ {
+ return $usernames;
+ }
+ else
+ {
+ return array();
+ }
+ }
+
public function set_bots($bots)
{
$this->data['_bots'] = $bots;
diff --git a/tests/mock/null_cache.php b/tests/mock/null_cache.php
new file mode 100644
index 0000000000..aca20ca77b
--- /dev/null
+++ b/tests/mock/null_cache.php
@@ -0,0 +1,42 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_mock_null_cache
+{
+ public function __construct()
+ {
+ }
+
+ public function get($var_name)
+ {
+ return false;
+ }
+
+ public function put($var_name, $var, $ttl = 0)
+ {
+ }
+
+ public function destroy($var_name, $table = '')
+ {
+ }
+
+ public function obtain_bots()
+ {
+ return array();
+ }
+
+ public function obtain_word_list()
+ {
+ return array();
+ }
+
+ public function set_bots($bots)
+ {
+ }
+}
diff --git a/tests/mock_user.php b/tests/mock/user.php
index ec14ce430e..bd547b3973 100644
--- a/tests/mock_user.php
+++ b/tests/mock/user.php
@@ -33,4 +33,17 @@ class phpbb_mock_user
{
$this->options[$item] = $value;
}
+
+ public function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
+ {
+ $banned_users = $this->optionget('banned_users');
+ foreach ($banned_users as $banned)
+ {
+ if ($banned == $user_id || $banned == $user_ips || $banned == $user_email)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php
new file mode 100644
index 0000000000..f705825262
--- /dev/null
+++ b/tests/privmsgs/delete_user_pms_test.php
@@ -0,0 +1,102 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_privmsgs.php';
+
+class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user_pms.xml');
+ }
+
+ static public function delete_user_pms_data()
+ {
+ return array(
+ // array(
+ // (user we delete),
+ // array(remaining privmsgs ids),
+ // array(remaining privmsgs_to),
+ // ),
+ array(
+ 2,
+ array(
+ array('msg_id' => 1),
+ ),
+ array(
+ array('msg_id' => 1, 'user_id' => 3),
+ ),
+ ),
+ array(
+ 3,
+ array(
+ array('msg_id' => 1),
+ array('msg_id' => 2),
+ array('msg_id' => 3),
+ array('msg_id' => 5),
+ ),
+ array(
+ array('msg_id' => 1, 'user_id' => 2),
+ array('msg_id' => 1, 'user_id' => 4),
+ array('msg_id' => 2, 'user_id' => 2),
+ array('msg_id' => 2, 'user_id' => 4),
+ array('msg_id' => 3, 'user_id' => 2),
+ array('msg_id' => 5, 'user_id' => 2),
+ array('msg_id' => 5, 'user_id' => 4),
+ ),
+ ),
+ array(
+ 5,
+ array(
+ array('msg_id' => 1),
+ array('msg_id' => 2),
+ array('msg_id' => 3),
+ array('msg_id' => 4),
+ array('msg_id' => 5),
+ ),
+ array(
+ array('msg_id' => 1, 'user_id' => 2),
+ array('msg_id' => 1, 'user_id' => 3),
+ array('msg_id' => 1, 'user_id' => 4),
+ array('msg_id' => 2, 'user_id' => 2),
+ array('msg_id' => 2, 'user_id' => 4),
+ array('msg_id' => 3, 'user_id' => 2),
+ array('msg_id' => 4, 'user_id' => 3),
+ array('msg_id' => 5, 'user_id' => 2),
+ array('msg_id' => 5, 'user_id' => 3),
+ array('msg_id' => 5, 'user_id' => 4),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider delete_user_pms_data
+ */
+ public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to)
+ {
+ global $db;
+
+ $db = $this->new_dbal();
+
+ phpbb_delete_user_pms($delete_user);
+
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TABLE;
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals($remaining_privmsgs, $db->sql_fetchrowset($result));
+
+ $sql = 'SELECT msg_id, user_id
+ FROM ' . PRIVMSGS_TO_TABLE;
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals($remaining_privmsgs_to, $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml
new file mode 100644
index 0000000000..9a86501b7a
--- /dev/null
+++ b/tests/privmsgs/fixtures/delete_user_pms.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_new_privmsg</column>
+ <column>user_unread_privmsg</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>2</value>
+ <value>sender</value>
+ <value>sender</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>pm in inbox</value>
+ <value>pm in inbox</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>pm in no box</value>
+ <value>pm in no box</value>
+ <value>2</value>
+ <value>2</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>no pms</value>
+ <value>no pms</value>
+ <value>0</value>
+ <value>0</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_privmsgs">
+ <column>msg_id</column>
+ <column>root_level</column>
+ <column>author_id</column>
+ <column>message_subject</column>
+ <column>message_text</column>
+ <column>to_address</column>
+ <column>bcc_address</column>
+ <row>
+ <value>1</value>
+ <value>0</value>
+ <value>2</value>
+ <value>#1</value>
+ <value>
+ 2 - outbox
+ 3 - inbox
+ 4 - nobox
+ </value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>0</value>
+ <value>2</value>
+ <value>#2</value>
+ <value>
+ 2 - outbox
+ 4 - nobox
+ </value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>0</value>
+ <value>2</value>
+ <value>#3</value>
+ <value>
+ 2 - outbox
+ </value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>0</value>
+ <value>2</value>
+ <value>#4</value>
+ <value>
+ 3 - nobox
+ </value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>0</value>
+ <value>2</value>
+ <value>#5</value>
+ <value>
+ 2 - outbox
+ 3 - nobox
+ 4 - nobox
+ </value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_privmsgs_to">
+ <column>msg_id</column>
+ <column>user_id</column>
+ <column>author_id</column>
+ <column>pm_new</column>
+ <column>pm_unread</column>
+ <column>folder_id</column>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-2</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>3</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>1</value>
+ <value>4</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-3</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-2</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>4</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-3</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-2</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value>3</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-3</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>2</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-2</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>3</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-3</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value>4</value>
+ <value>2</value>
+ <value>0</value>
+ <value>0</value>
+ <value>-3</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php
index 8e609c00af..0c07fe11a3 100644
--- a/tests/request/request_var_test.php
+++ b/tests/request/request_var_test.php
@@ -73,7 +73,7 @@ class phpbb_request_request_var_test extends phpbb_test_case
unset($_GET[$var], $_POST[$var], $_REQUEST[$var], $_COOKIE[$var]);
}
- public static function request_variables()
+ static public function request_variables()
{
return array(
// strings
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index 4911f7b452..0f5128884b 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
- public static function security_variables()
+ static public function security_variables()
{
return array(
array('http://localhost/phpBB/index.php', 'mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php
index 0c2580c19b..e226365ef3 100644
--- a/tests/security/hash_test.php
+++ b/tests/security/hash_test.php
@@ -17,5 +17,13 @@ class phpbb_security_hash_test extends phpbb_test_case
$this->assertTrue(phpbb_check_hash('test', '$P$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
$this->assertFalse(phpbb_check_hash('foo', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
}
+
+ public function test_check_hash_with_large_input()
+ {
+ // 16 MB password, should be rejected quite fast
+ $start_time = time();
+ $this->assertFalse(phpbb_check_hash(str_repeat('a', 1024 * 1024 * 16), '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1'));
+ $this->assertLessThanOrEqual(5, time() - $start_time);
+ }
}
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index 4848a938c6..872a331dc7 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
class phpbb_security_redirect_test extends phpbb_security_test_base
{
- public static function provider()
+ static public function provider()
{
// array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false))
return array(
diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php
index 88f6f0718e..ce7bf71215 100644
--- a/tests/session/append_sid_test.php
+++ b/tests/session/append_sid_test.php
@@ -1,51 +1,50 @@
-<?php
-/**
-*
-* @package testing
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
-class phpbb_session_append_sid_test extends phpbb_test_case
-{
-
- public function append_sid_data()
- {
- return array(
- array('viewtopic.php?t=1&amp;f=2', false, true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in url-argument'),
- array('viewtopic.php', 't=1&amp;f=2', true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument using amp'),
- array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'),
- array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument as array'),
-
- // Custom sid parameter
- array('viewtopic.php', 't=1&amp;f=2', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
-
- // Testing anchors
- array('viewtopic.php?t=1&amp;f=2#anchor', false, true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in url-argument'),
- array('viewtopic.php', 't=1&amp;f=2#anchor', true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument'),
- array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
-
- // Anchors and custom sid
- array('viewtopic.php?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
- array('viewtopic.php', 't=1&amp;f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
- array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
-
- // Empty parameters should not append the ?
- array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'),
- array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'),
- array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'),
- );
- }
-
- /**
- * @dataProvider append_sid_data
- */
- public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
- {
- $this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
- }
-}
-
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_session_append_sid_test extends phpbb_test_case
+{
+
+ public function append_sid_data()
+ {
+ return array(
+ array('viewtopic.php?t=1&amp;f=2', false, true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in url-argument'),
+ array('viewtopic.php', 't=1&amp;f=2', true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument using amp'),
+ array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('viewtopic.php', 't=1&amp;f=2', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
+
+ // Testing anchors
+ array('viewtopic.php?t=1&amp;f=2#anchor', false, true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in url-argument'),
+ array('viewtopic.php', 't=1&amp;f=2#anchor', true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('viewtopic.php?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
+ array('viewtopic.php', 't=1&amp;f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the ?
+ array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'),
+ array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'),
+ array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider append_sid_data
+ */
+ public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
+ }
+}
diff --git a/tests/session/init_test.php b/tests/session/creation_test.php
index 2ce6c4a4ac..bef52c6554 100644
--- a/tests/session/init_test.php
+++ b/tests/session/creation_test.php
@@ -10,7 +10,7 @@
require_once dirname(__FILE__) . '/../mock/cache.php';
require_once dirname(__FILE__) . '/testable_factory.php';
-class phpbb_session_init_test extends phpbb_database_test_case
+class phpbb_session_creation_test extends phpbb_database_test_case
{
public function getDataSet()
{
@@ -35,10 +35,11 @@ class phpbb_session_init_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('session_user_id' => 3)),
$sql,
- 'Check if exacly one session for user id 3 was created'
+ 'Check if exactly one session for user id 3 was created'
);
- $cookie_expire = $session->time_now + 31536000; // default is one year
+ $one_year_in_seconds = 365 * 24 * 60 * 60;
+ $cookie_expire = $session->time_now + $one_year_in_seconds;
$session->check_cookies($this, array(
'u' => array(null, $cookie_expire),
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index aaee7bb4a0..94ec2ab8a7 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -32,7 +32,7 @@ class phpbb_template_template_test extends phpbb_test_case
}
catch (Exception $exception)
{
- // reset the error level even when an error occured
+ // reset the error level even when an error occurred
// PHPUnit turns trigger_error into exceptions as well
error_reporting($error_level);
ob_end_clean();
@@ -69,9 +69,14 @@ class phpbb_template_template_test extends phpbb_test_case
$this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable.");
}
- foreach (glob($this->template->cachepath . '*') as $file)
+ $file_array = scandir($template_cache_dir);
+ $file_prefix = basename($this->template->cachepath);
+ foreach ($file_array as $file)
{
- unlink($file);
+ if (strpos($file, $file_prefix) === 0)
+ {
+ unlink($template_cache_dir . '/' . $file);
+ }
}
$GLOBALS['config'] = array(
@@ -84,9 +89,15 @@ class phpbb_template_template_test extends phpbb_test_case
{
if (is_object($this->template))
{
- foreach (glob($this->template->cachepath . '*') as $file)
+ $template_cache_dir = dirname($this->template->cachepath);
+ $file_array = scandir($template_cache_dir);
+ $file_prefix = basename($this->template->cachepath);
+ foreach ($file_array as $file)
{
- unlink($file);
+ if (strpos($file, $file_prefix) === 0)
+ {
+ unlink($template_cache_dir . '/' . $file);
+ }
}
}
}
@@ -94,7 +105,7 @@ class phpbb_template_template_test extends phpbb_test_case
/**
* @todo put test data into templates/xyz.test
*/
- public static function template_data()
+ static public function template_data()
{
return array(
/*
@@ -233,12 +244,34 @@ class phpbb_template_template_test extends phpbb_test_case
'value',
),
array(
+ 'include_define.html',
+ array('VARIABLE' => 'value'),
+ array(),
+ array(),
+ 'value',
+ ),
+ array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
array('loop'),
'',
- ),/* no top level nested loops
+ ),
+ array(
+ 'include_define_variable.html',
+ array('VARIABLE' => 'variable.html'),
+ array(),
+ array(),
+ 'variable.html',
+ ),
+ array(
+ 'include_loop_define.html',
+ array('VARIABLE' => 'value'),
+ array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
+ array(),
+ 'value',
+ ),
+ /* no top level nested loops
array(
'loop_vars.html',
array(),
@@ -419,7 +452,7 @@ class phpbb_template_template_test extends phpbb_test_case
$GLOBALS['config']['tpl_allow_php'] = false;
}
- public static function alter_block_array_data()
+ static public function alter_block_array_data()
{
return array(
array(
diff --git a/tests/template/templates/include_define.html b/tests/template/templates/include_define.html
new file mode 100644
index 0000000000..2419c8cba1
--- /dev/null
+++ b/tests/template/templates/include_define.html
@@ -0,0 +1,2 @@
+<!-- DEFINE $DEF = 'variable.html' -->
+<!-- INCLUDE {$DEF} -->
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
new file mode 100644
index 0000000000..aff9b574c2
--- /dev/null
+++ b/tests/template/templates/include_define_variable.html
@@ -0,0 +1,2 @@
+<!-- DEFINE $DEF = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF} -->
diff --git a/tests/template/templates/include_loop_define.html b/tests/template/templates/include_loop_define.html
new file mode 100644
index 0000000000..f539b21396
--- /dev/null
+++ b/tests/template/templates/include_loop_define.html
@@ -0,0 +1,4 @@
+<!-- BEGIN loop -->
+<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
+<!-- INCLUDE {$DEF} -->
+<!-- END loop -->
diff --git a/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
new file mode 100644
index 0000000000..ec59fa3886
--- /dev/null
+++ b/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+if (!class_exists('PDO'))
+{
+ return;
+}
+
+/**
+* Used for passing in information about the PDO driver
+* since the PDO class reveals nothing about the DSN that
+* the user provided.
+*
+* This is used in the custom PHPUnit ODBC driver
+*/
+class phpbb_database_connection_odbc_pdo_wrapper extends PDO
+{
+ // Name of the driver being used (i.e. mssql, firebird)
+ public $driver = '';
+
+ // Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this
+ public $version = 0;
+
+ function __construct($dbms, $version, $dsn, $user, $pass)
+ {
+ $this->driver = $dbms;
+ $this->version = (double) $version;
+
+ parent::__construct($dsn, $user, $pass);
+ }
+}
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index e742b543b0..28d3a716f0 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -11,8 +11,12 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
{
static private $already_connected;
+ private $db_connections;
+
protected $test_case_helpers;
+ protected $fixture_xml_data;
+
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
@@ -26,6 +30,75 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
'phpbb_database_test_case' => array('already_connected'),
);
+
+ $this->db_connections = array();
+ }
+
+ protected function tearDown()
+ {
+ parent::tearDown();
+
+ // Close all database connections from this test
+ if (!empty($this->db_connections))
+ {
+ foreach ($this->db_connections as $db)
+ {
+ $db->sql_close();
+ }
+ }
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ // Resynchronise tables if a fixture was loaded
+ if (isset($this->fixture_xml_data))
+ {
+ $config = $this->get_database_config();
+ $manager = $this->create_connection_manager($config);
+ $manager->connect();
+ $manager->post_setup_synchronisation($this->fixture_xml_data);
+ }
+ }
+
+ /**
+ * Performs synchronisations for a given table/column set on the database
+ *
+ * @param array $table_column_map Information about the tables/columns to synchronise
+ *
+ * @return null
+ */
+ protected function database_synchronisation($table_column_map)
+ {
+ $config = $this->get_database_config();
+ $manager = $this->create_connection_manager($config);
+ $manager->connect();
+ $manager->database_synchronisation($table_column_map);
+ }
+
+ public function createXMLDataSet($path)
+ {
+ $db_config = $this->get_database_config();
+
+ // Firebird requires table and column names to be uppercase
+ if ($db_config['dbms'] == 'firebird')
+ {
+ $xml_data = file_get_contents($path);
+ $xml_data = preg_replace_callback('/(?:(<table name="))([a-z_]+)(?:(">))/', 'phpbb_database_test_case::to_upper', $xml_data);
+ $xml_data = preg_replace_callback('/(?:(<column>))([a-z_]+)(?:(<\/column>))/', 'phpbb_database_test_case::to_upper', $xml_data);
+
+ $new_fixture = tmpfile();
+ fwrite($new_fixture, $xml_data);
+ fseek($new_fixture, 0);
+
+ $meta_data = stream_get_meta_data($new_fixture);
+ $path = $meta_data['uri'];
+ }
+
+ $this->fixture_xml_data = parent::createXMLDataSet($path);
+
+ return $this->fixture_xml_data;
}
public function get_test_case_helpers()
@@ -83,6 +156,8 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
$db = new $dbal();
$db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
+ $this->db_connections[] = $db;
+
return $db;
}
@@ -106,4 +181,17 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
{
return new phpbb_database_test_connection_manager($config);
}
+
+ /**
+ * Converts a match in the middle of a string to uppercase.
+ * This is necessary for transforming the fixture information for Firebird tests
+ *
+ * @param $matches The array of matches from a regular expression
+ *
+ * @return string The string with the specified match converted to uppercase
+ */
+ static public function to_upper($matches)
+ {
+ return $matches[1] . strtoupper($matches[2]) . $matches[3];
+ }
}
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index c734c90a1a..30f1fa6589 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -8,6 +8,7 @@
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_install.php';
+require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.php';
class phpbb_database_test_connection_manager
{
@@ -62,6 +63,13 @@ class phpbb_database_test_connection_manager
// e.g. Driver={SQL Server Native Client 10.0};Server=(local)\SQLExpress;
$dsn .= $this->config['dbhost'];
+ // Primarily for MSSQL Native/Azure as ODBC needs it in $dbhost, attached to the Server param
+ if ($this->config['dbport'])
+ {
+ $port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
+ $dsn .= $port_delimiter . $this->config['dbport'];
+ }
+
if ($use_db)
{
$dsn .= ';Database=' . $this->config['dbname'];
@@ -80,12 +88,52 @@ class phpbb_database_test_connection_manager
{
$dsn .= ';dbname=' . $this->config['dbname'];
}
+ else if ($this->dbms['PDO'] == 'pgsql')
+ {
+ // Postgres always connects to a
+ // database. If the database is not
+ // specified here, but the username
+ // is specified, then connection
+ // will be to the database named
+ // as the username.
+ //
+ // For greater compatibility, connect
+ // instead to postgres database which
+ // should always exist:
+ // http://www.postgresql.org/docs/9.0/static/manage-ag-templatedbs.html
+ $dsn .= ';dbname=postgres';
+ }
break;
}
+ // These require different connection strings on the phpBB side than they do in PDO
+ // so you must provide a DSN string for ODBC separately
+ if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'mssql' || $this->config['dbms'] == 'firebird'))
+ {
+ $dsn = 'odbc:' . $this->config['custom_dsn'];
+ }
+
try
{
- $this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
+ switch ($this->config['dbms'])
+ {
+ case 'mssql':
+ case 'mssql_odbc':
+ $this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
+ break;
+
+ case 'firebird':
+ if (!empty($this->config['custom_dsn']))
+ {
+ $this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
+ break;
+ }
+ // Fall through if they're using the firebird PDO driver and not the generic ODBC driver
+
+ default:
+ $this->pdo = new PDO($dsn, $this->config['dbuser'], $this->config['dbpasswd']);
+ break;
+ }
}
catch (PDOException $e)
{
@@ -93,8 +141,29 @@ class phpbb_database_test_connection_manager
throw new Exception("Unable do connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
}
- // good for debug
- // $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+ $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ switch ($this->config['dbms'])
+ {
+ case 'mysql':
+ case 'mysqli':
+ $this->pdo->exec('SET NAMES utf8');
+
+ /*
+ * The phpBB MySQL drivers set the STRICT_ALL_TABLES and
+ * STRICT_TRANS_TABLES flags/modes, so as a minimum requirement
+ * we want to make sure those are set for the PDO side of the
+ * test suite.
+ *
+ * The TRADITIONAL flag implies STRICT_ALL_TABLES and
+ * STRICT_TRANS_TABLES as well as other useful strictness flags
+ * the phpBB MySQL driver does not set.
+ */
+ $this->pdo->exec("SET SESSION sql_mode='TRADITIONAL'");
+ break;
+
+ default:
+ }
}
/**
@@ -119,10 +188,34 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
case 'sqlite':
- if (file_exists($this->config['dbhost']))
+ case 'firebird':
+ $this->connect();
+ // Drop all of the tables
+ foreach ($this->get_tables() as $table)
+ {
+ $this->pdo->exec('DROP TABLE ' . $table);
+ }
+ $this->purge_extras();
+ break;
+
+ case 'oracle':
+ $this->connect();
+ // Drop all of the tables
+ foreach ($this->get_tables() as $table)
+ {
+ $this->pdo->exec('DROP TABLE ' . $table . ' CASCADE CONSTRAINTS');
+ }
+ $this->purge_extras();
+ break;
+
+ case 'postgres':
+ $this->connect();
+ // Drop all of the tables
+ foreach ($this->get_tables() as $table)
{
- unlink($this->config['dbhost']);
+ $this->pdo->exec('DROP TABLE ' . $table . ' CASCADE');
}
+ $this->purge_extras();
break;
default:
@@ -131,6 +224,15 @@ class phpbb_database_test_connection_manager
try
{
$this->pdo->exec('DROP DATABASE ' . $this->config['dbname']);
+
+ try
+ {
+ $this->pdo->exec('CREATE DATABASE ' . $this->config['dbname']);
+ }
+ catch (PDOException $e)
+ {
+ throw new Exception("Unable to re-create database: {$e->getMessage()}");
+ }
}
catch (PDOException $e)
{
@@ -139,9 +241,8 @@ class phpbb_database_test_connection_manager
{
$this->pdo->exec('DROP TABLE ' . $table);
}
+ $this->purge_extras();
}
-
- $this->pdo->exec('CREATE DATABASE ' . $this->config['dbname']);
break;
}
}
@@ -224,7 +325,7 @@ class phpbb_database_test_connection_manager
protected function load_schema_from_file($directory)
{
$schema = $this->dbms['SCHEMA'];
-
+
if ($this->config['dbms'] == 'mysql')
{
$sth = $this->pdo->query('SELECT VERSION() AS version');
@@ -243,8 +344,8 @@ class phpbb_database_test_connection_manager
$filename = $directory . $schema . '_schema.sql';
$queries = file_get_contents($filename);
- $sql = remove_comments($queries);
-
+ $sql = phpbb_remove_comments($queries);
+
$sql = split_sql_file($sql, $this->dbms['DELIM']);
foreach ($sql as $query)
@@ -317,4 +418,185 @@ class phpbb_database_test_connection_manager
throw new Exception($message);
}
}
+
+ /**
+ * Removes extra objects from a database. This is for cases where dropping the database fails.
+ */
+ public function purge_extras()
+ {
+ $this->ensure_connected(__METHOD__);
+ $queries = array();
+
+ switch ($this->config['dbms'])
+ {
+ case 'firebird':
+ $sql = 'SELECT RDB$GENERATOR_NAME
+ FROM RDB$GENERATORS
+ WHERE RDB$SYSTEM_FLAG = 0';
+ $result = $this->pdo->query($sql);
+
+ while ($row = $result->fetch(PDO::FETCH_NUM))
+ {
+ $queries[] = 'DROP GENERATOR ' . current($row);
+ }
+ break;
+
+ case 'oracle':
+ $sql = 'SELECT sequence_name
+ FROM USER_SEQUENCES';
+ $result = $this->pdo->query($sql);
+
+ while ($row = $result->fetch(PDO::FETCH_NUM))
+ {
+ $queries[] = 'DROP SEQUENCE ' . current($row);
+ }
+ break;
+
+ case 'postgres':
+ $sql = 'SELECT sequence_name
+ FROM information_schema.sequences';
+ $result = $this->pdo->query($sql);
+
+ while ($row = $result->fetch(PDO::FETCH_NUM))
+ {
+ $queries[] = 'DROP SEQUENCE ' . current($row);
+ }
+
+ $queries[] = 'DROP TYPE IF EXISTS varchar_ci CASCADE';
+ break;
+ }
+
+ foreach ($queries as $query)
+ {
+ $this->pdo->exec($query);
+ }
+ }
+
+ /**
+ * Performs synchronisations on the database after a fixture has been loaded
+ *
+ * @param PHPUnit_Extensions_Database_DataSet_XmlDataSet $xml_data_set Information about the tables contained within the loaded fixture
+ *
+ * @return null
+ */
+ public function post_setup_synchronisation($xml_data_set)
+ {
+ $table_names = $xml_data_set->getTableNames();
+
+ $tables = array();
+ foreach ($table_names as $table)
+ {
+ $tables[$table] = $xml_data_set->getTableMetaData($table)->getColumns();
+ }
+
+ $this->database_synchronisation($tables);
+ }
+
+ /**
+ * Performs synchronisations on the database after a fixture has been loaded
+ *
+ * @param array $table_column_map Array of tables/columns to synchronise
+ * array(table1 => array(column1, column2))
+ *
+ * @return null
+ */
+ public function database_synchronisation($table_column_map)
+ {
+ $this->ensure_connected(__METHOD__);
+ $queries = array();
+
+ // Get escaped versions of the table names to synchronise
+ $table_names = array_map(array($this->pdo, 'PDO::quote'), array_keys($table_column_map));
+
+ switch ($this->config['dbms'])
+ {
+ case 'oracle':
+ // Get all of the information about the sequences
+ $sql = "SELECT t.table_name, tc.column_name, d.referenced_name as sequence_name, s.increment_by, s.min_value
+ FROM USER_TRIGGERS t
+ JOIN USER_DEPENDENCIES d ON (d.name = t.trigger_name)
+ JOIN USER_TRIGGER_COLS tc ON (tc.trigger_name = t.trigger_name)
+ JOIN USER_SEQUENCES s ON (s.sequence_name = d.referenced_name)
+ WHERE d.referenced_type = 'SEQUENCE'
+ AND d.type = 'TRIGGER'
+ AND t.table_name IN (" . implode(', ', array_map('strtoupper', $table_names)) . ')';
+
+ $result = $this->pdo->query($sql);
+
+ while ($row = $result->fetch(PDO::FETCH_ASSOC))
+ {
+ // Get the current max value of the table
+ $sql = "SELECT MAX({$row['COLUMN_NAME']}) AS max FROM {$row['TABLE_NAME']}";
+ $max_result = $this->pdo->query($sql);
+ $max_row = $max_result->fetch(PDO::FETCH_ASSOC);
+
+ if (!$max_row)
+ {
+ continue;
+ }
+
+ $max_val = (int) $max_row['MAX'];
+ $max_val++;
+
+ /**
+ * This is not the "proper" way, but the proper way does not allow you to completely reset
+ * tables with no rows since you have to select the next value to make the change go into effect.
+ * You would have to go past the minimum value to set it correctly, but that's illegal.
+ * Since we have no objects attached to our sequencers (triggers aren't attached), this works fine.
+ */
+ $queries[] = 'DROP SEQUENCE ' . $row['SEQUENCE_NAME'];
+ $queries[] = "CREATE SEQUENCE {$row['SEQUENCE_NAME']}
+ MINVALUE {$row['MIN_VALUE']}
+ INCREMENT BY {$row['INCREMENT_BY']}
+ START WITH $max_val";
+ }
+ break;
+
+ case 'postgres':
+ // Get the sequences attached to the tables
+ $sql = 'SELECT column_name, table_name FROM information_schema.columns
+ WHERE table_name IN (' . implode(', ', $table_names) . ")
+ AND strpos(column_default, '_seq''::regclass') > 0";
+ $result = $this->pdo->query($sql);
+
+ $setval_queries = array();
+ while ($row = $result->fetch(PDO::FETCH_ASSOC))
+ {
+ // Get the columns used in the fixture for this table
+ $column_names = $table_column_map[$row['table_name']];
+
+ // Skip sequences that weren't specified in the fixture
+ if (!in_array($row['column_name'], $column_names))
+ {
+ continue;
+ }
+
+ // Get the old value if it exists, or use 1 if it doesn't
+ $sql = "SELECT COALESCE((SELECT MAX({$row['column_name']}) + 1 FROM {$row['table_name']}), 1) AS val";
+ $result_max = $this->pdo->query($sql);
+ $row_max = $result_max->fetch(PDO::FETCH_ASSOC);
+
+ if ($row_max)
+ {
+ $seq_name = $this->pdo->quote($row['table_name'] . '_seq');
+ $max_val = (int) $row_max['val'];
+
+ // The last parameter is false so that the system doesn't increment it again
+ $setval_queries[] = "SETVAL($seq_name, $max_val, false)";
+ }
+ }
+
+ // Combine all of the SETVALs into one query
+ if (sizeof($setval_queries))
+ {
+ $queries[] = 'SELECT ' . implode(', ', $setval_queries);
+ }
+ break;
+ }
+
+ foreach ($queries as $query)
+ {
+ $this->pdo->exec($query);
+ }
+ }
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 76fed76fae..7d8b4a3144 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -9,11 +9,17 @@
use Symfony\Component\BrowserKit\CookieJar;
require_once __DIR__ . '/../../phpBB/includes/functions_install.php';
+require_once __DIR__ . '/../../phpBB/includes/acm/acm_file.php';
+require_once __DIR__ . '/../../phpBB/includes/cache.php';
class phpbb_functional_test_case extends phpbb_test_case
{
- protected $client;
- protected $root_url;
+ static protected $client;
+ static protected $cookieJar;
+ static protected $root_url;
+
+ protected $cache = null;
+ protected $db = null;
/**
* Session ID for current test's session (each test makes its own)
@@ -32,33 +38,91 @@ class phpbb_functional_test_case extends phpbb_test_case
static public function setUpBeforeClass()
{
- if (!extension_loaded('phar'))
+ parent::setUpBeforeClass();
+
+ self::$config = phpbb_test_case_helpers::get_test_config();
+ self::$root_url = self::$config['phpbb_functional_url'];
+
+ if (!isset(self::$config['phpbb_functional_url']))
{
- self::markTestSkipped('phar extension is not loaded');
+ self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
}
- require_once 'phar://' . __DIR__ . '/../../vendor/goutte.phar';
+ if (!self::$already_installed)
+ {
+ self::install_board();
+ self::$already_installed = true;
+ }
}
public function setUp()
{
- if (!isset(self::$config['phpbb_functional_url']))
- {
- $this->markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
- }
+ parent::setUp();
+
+ $this->bootstrap();
+
+ self::$cookieJar = new CookieJar;
+ self::$client = new Goutte\Client(array(), null, self::$cookieJar);
+ // Reset the curl handle because it is 0 at this point and not a valid
+ // resource
+ self::$client->getClient()->getCurlMulti()->reset(true);
- $this->cookieJar = new CookieJar;
- $this->client = new Goutte\Client(array(), array(), null, $this->cookieJar);
- $this->root_url = self::$config['phpbb_functional_url'];
// Clear the language array so that things
// that were added in other tests are gone
$this->lang = array();
$this->add_lang('common');
+ $this->purge_cache();
}
- public function request($method, $path)
+ /**
+ * Perform a request to page
+ *
+ * @param string $method HTTP Method
+ * @param string $path Page path, relative from phpBB root path
+ * @param array $form_data An array of form field values
+ * @param bool $assert_response_html Should we perform standard assertions for a normal html page
+ * @return Symfony\Component\DomCrawler\Crawler
+ */
+ static public function request($method, $path, $form_data = array(), $assert_response_html = true)
{
- return $this->client->request($method, $this->root_url . $path);
+ $crawler = self::$client->request($method, self::$root_url . $path, $form_data);
+
+ if ($assert_response_html)
+ {
+ self::assert_response_html();
+ }
+
+ return $crawler;
+ }
+
+ /**
+ * Submits a form
+ *
+ * @param Symfony\Component\DomCrawler\Form $form A Form instance
+ * @param array $values An array of form field values
+ * @param bool $assert_response_html Should we perform standard assertions for a normal html page
+ * @return Symfony\Component\DomCrawler\Crawler
+ */
+ static public function submit(Symfony\Component\DomCrawler\Form $form, array $values = array(), $assert_response_html = true)
+ {
+ $crawler = self::$client->submit($form, $values);
+
+ if ($assert_response_html)
+ {
+ self::assert_response_html();
+ }
+
+ return $crawler;
+ }
+
+ /**
+ * Get Client Content
+ *
+ * @return string HTML page
+ */
+ static public function get_content()
+ {
+ return self::$client->getResponse()->getContent();
}
// bootstrap, called after board is set up
@@ -68,6 +132,42 @@ class phpbb_functional_test_case extends phpbb_test_case
{
}
+ protected function get_db()
+ {
+ global $phpbb_root_path, $phpEx;
+ // so we don't reopen an open connection
+ if (!($this->db instanceof dbal))
+ {
+ if (!class_exists('dbal_' . self::$config['dbms']))
+ {
+ include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
+ }
+ $sql_db = 'dbal_' . self::$config['dbms'];
+ $this->db = new $sql_db();
+ $this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
+ }
+ return $this->db;
+ }
+
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new cache();
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
@@ -75,63 +175,127 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->backupStaticAttributesBlacklist += array(
'phpbb_functional_test_case' => array('config', 'already_installed'),
);
-
- if (!static::$already_installed)
- {
- $this->install_board();
- $this->bootstrap();
- static::$already_installed = true;
- }
}
- protected function install_board()
+ static protected function install_board()
{
global $phpbb_root_path, $phpEx;
- self::$config = phpbb_test_case_helpers::get_test_config();
-
- if (!isset(self::$config['phpbb_functional_url']))
- {
- return;
- }
-
self::$config['table_prefix'] = 'phpbb_';
- $this->recreate_database(self::$config);
+ self::recreate_database(self::$config);
+
+ $config_file = $phpbb_root_path . "config.$phpEx";
+ $config_file_dev = $phpbb_root_path . "config_dev.$phpEx";
+ $config_file_test = $phpbb_root_path . "config_test.$phpEx";
- if (file_exists($phpbb_root_path . "config.$phpEx"))
+ if (file_exists($config_file))
{
- if (!file_exists($phpbb_root_path . "config_dev.$phpEx"))
+ if (!file_exists($config_file_dev))
{
- rename($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_dev.$phpEx");
+ rename($config_file, $config_file_dev);
}
else
{
- unlink($phpbb_root_path . "config.$phpEx");
+ unlink($config_file);
}
}
- // begin data
- $data = array();
+ self::$cookieJar = new CookieJar;
+ self::$client = new Goutte\Client(array(), null, self::$cookieJar);
+ // Set client manually so we can increase the cURL timeout
+ self::$client->setClient(new Guzzle\Http\Client('', array(
+ Guzzle\Http\Client::DISABLE_REDIRECTS => true,
+ 'curl.options' => array(
+ CURLOPT_TIMEOUT => 120,
+ ),
+ )));
+
+ // Reset the curl handle because it is 0 at this point and not a valid
+ // resource
+ self::$client->getClient()->getCurlMulti()->reset(true);
+
+ $parseURL = parse_url(self::$config['phpbb_functional_url']);
+
+ $crawler = self::request('GET', 'install/index.php?mode=install');
+ self::assertContains('Welcome to Installation', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form();
+
+ // install/index.php?mode=install&sub=requirements
+ $crawler = self::submit($form);
+ self::assertContains('Installation compatibility', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form();
+
+ // install/index.php?mode=install&sub=database
+ $crawler = self::submit($form);
+ self::assertContains('Database configuration', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form(array(
+ // Installer uses 3.0-style dbms name
+ 'dbms' => str_replace('phpbb_db_driver_', '', self::$config['dbms']),
+ 'dbhost' => self::$config['dbhost'],
+ 'dbport' => self::$config['dbport'],
+ 'dbname' => self::$config['dbname'],
+ 'dbuser' => self::$config['dbuser'],
+ 'dbpasswd' => self::$config['dbpasswd'],
+ 'table_prefix' => self::$config['table_prefix'],
+ ));
- $data = array_merge($data, self::$config);
+ // install/index.php?mode=install&sub=database
+ $crawler = self::submit($form);
+ self::assertContains('Successful connection', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form();
- $data = array_merge($data, array(
+ // install/index.php?mode=install&sub=administrator
+ $crawler = self::submit($form);
+ self::assertContains('Administrator configuration', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form(array(
'default_lang' => 'en',
'admin_name' => 'admin',
- 'admin_pass1' => 'admin',
- 'admin_pass2' => 'admin',
- 'board_email' => 'nobody@example.com',
+ 'admin_pass1' => 'adminadmin',
+ 'admin_pass2' => 'adminadmin',
+ 'board_email1' => 'nobody@example.com',
+ 'board_email2' => 'nobody@example.com',
));
- $parseURL = parse_url(self::$config['phpbb_functional_url']);
+ // install/index.php?mode=install&sub=administrator
+ $crawler = self::submit($form);
+ self::assertContains('Tests passed', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form();
+
+ // We have to skip install/index.php?mode=install&sub=config_file
+ // because that step will create a config.php file if phpBB has the
+ // permission to do so. We have to create the config file on our own
+ // in order to get the DEBUG constants defined.
+ $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], array(), true, true);
+ $config_created = file_put_contents($config_file, $config_php_data) !== false;
+ if (!$config_created)
+ {
+ self::markTestSkipped("Could not write $config_file file.");
+ }
- $data = array_merge($data, array(
- 'email_enable' => false,
- 'smtp_delivery' => false,
- 'smtp_host' => '',
- 'smtp_auth' => '',
- 'smtp_user' => '',
- 'smtp_pass' => '',
+ // We also have to create a install lock that is normally created by
+ // the installer. The file will be removed by the final step of the
+ // installer.
+ $install_lock_file = $phpbb_root_path . 'cache/install_lock';
+ $lock_created = file_put_contents($install_lock_file, '') !== false;
+ if (!$lock_created)
+ {
+ self::markTestSkipped("Could not create $lock_created file.");
+ }
+ @chmod($install_lock_file, 0666);
+
+ // install/index.php?mode=install&sub=advanced
+ $form_data = $form->getValues();
+ unset($form_data['submit']);
+
+ $crawler = self::request('POST', 'install/index.php?mode=install&sub=advanced', $form_data);
+ self::assertContains('The settings on this page are only necessary to set if you know that you require something different from the default.', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form(array(
+ 'email_enable' => true,
+ 'smtp_delivery' => true,
+ 'smtp_host' => 'nxdomain.phpbb.com',
+ 'smtp_auth' => 'PLAIN',
+ 'smtp_user' => 'nxuser',
+ 'smtp_pass' => 'nxpass',
'cookie_secure' => false,
'force_server_vars' => false,
'server_protocol' => $parseURL['scheme'] . '://',
@@ -139,69 +303,226 @@ class phpbb_functional_test_case extends phpbb_test_case
'server_port' => isset($parseURL['port']) ? (int) $parseURL['port'] : 80,
'script_path' => $parseURL['path'],
));
- // end data
- $content = $this->do_request('install');
- $this->assertContains('Welcome to Installation', $content);
+ // install/index.php?mode=install&sub=create_table
+ $crawler = self::submit($form);
+ self::assertContains('The database tables used by phpBB', $crawler->filter('#main')->text());
+ self::assertContains('have been created and populated with some initial data.', $crawler->filter('#main')->text());
+ $form = $crawler->selectButton('submit')->form();
- $this->do_request('create_table', $data);
+ // install/index.php?mode=install&sub=final
+ $crawler = self::submit($form);
+ self::assertContains('You have successfully installed', $crawler->text());
- file_put_contents($phpbb_root_path . "config.$phpEx", phpbb_create_config_file_data($data, self::$config['dbms'], array(), true));
+ copy($config_file, $config_file_test);
+ }
- $this->do_request('config_file', $data);
+ static private function recreate_database($config)
+ {
+ $db_conn_mgr = new phpbb_database_test_connection_manager($config);
+ $db_conn_mgr->recreate_db();
+ }
- copy($phpbb_root_path . "config.$phpEx", $phpbb_root_path . "config_test.$phpEx");
+ /**
+ * Creates a new style
+ *
+ * @param string $style_id Style ID
+ * @param string $style_path Style directory
+ * @param string $parent_style_id Parent style id. Default = 1
+ * @param string $parent_style_path Parent style directory. Default = 'prosilver'
+ */
+ protected function add_style($style_id, $style_path, $parent_style_id = 1, $parent_style_path = 'prosilver')
+ {
+ global $phpbb_root_path;
+
+ $db = $this->get_db();
+ $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'style_id' => $style_id,
+ 'style_name' => $style_path,
+ 'style_copyright' => '',
+ 'style_active' => 1,
+ 'template_id' => $style_id,
+ 'theme_id' => $style_id,
+ 'imageset_id' => $style_id,
+ ));
+ $db->sql_query($sql);
- $this->do_request('final', $data);
+ $sql = 'INSERT INTO ' . STYLES_IMAGESET_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'imageset_id' => $style_id,
+ 'imageset_name' => $style_path,
+ 'imageset_copyright' => '',
+ 'imageset_path' => $style_path,
+ ));
+ $db->sql_query($sql);
+
+ $sql = 'INSERT INTO ' . STYLES_TEMPLATE_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'template_id' => $style_id,
+ 'template_name' => $style_path,
+ 'template_copyright' => '',
+ 'template_path' => $style_path,
+ 'bbcode_bitfield' => 'kNg=',
+ 'template_inherits_id' => $parent_style_id,
+ 'template_inherit_path' => $parent_style_path,
+ ));
+ $db->sql_query($sql);
+
+ $sql = 'INSERT INTO ' . STYLES_THEME_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'theme_id' => $style_id,
+ 'theme_name' => $style_path,
+ 'theme_copyright' => '',
+ 'theme_path' => $style_path,
+ 'theme_storedb' => 0,
+ 'theme_mtime' => 0,
+ 'theme_data' => '',
+ ));
+ $db->sql_query($sql);
+
+ if ($style_path != 'prosilver' && $style_path != 'subsilver2')
+ {
+ @mkdir($phpbb_root_path . 'styles/' . $style_path, 0777);
+ @mkdir($phpbb_root_path . 'styles/' . $style_path . '/template', 0777);
+ }
}
- private function do_request($sub, $post_data = null)
+ /**
+ * Remove temporary style created by add_style()
+ *
+ * @param string $style_id Style ID
+ * @param string $style_path Style directory
+ */
+ protected function delete_style($style_id, $style_path)
{
- $context = null;
+ global $phpbb_root_path;
+
+ $db = $this->get_db();
+ $db->sql_query('DELETE FROM ' . STYLES_TABLE . ' WHERE style_id = ' . $style_id);
+ $db->sql_query('DELETE FROM ' . STYLES_IMAGESET_TABLE . ' WHERE imageset_id = ' . $style_id);
+ $db->sql_query('DELETE FROM ' . STYLES_TEMPLATE_TABLE . ' WHERE template_id = ' . $style_id);
+ $db->sql_query('DELETE FROM ' . STYLES_THEME_TABLE . ' WHERE theme_id = ' . $style_id);
- if ($post_data)
+ if ($style_path != 'prosilver' && $style_path != 'subsilver2')
{
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-Type: application/x-www-form-urlencoded',
- 'content' => http_build_query($post_data),
- 'ignore_errors' => true,
- ),
- ));
+ @rmdir($phpbb_root_path . 'styles/' . $style_path . '/template');
+ @rmdir($phpbb_root_path . 'styles/' . $style_path);
}
-
- return file_get_contents(self::$config['phpbb_functional_url'] . 'install/index.php?mode=install&sub=' . $sub, false, $context);
}
- private function recreate_database($config)
+ /**
+ * Creates a new user with limited permissions
+ *
+ * @param string $username Also doubles up as the user's password
+ * @return int ID of created user
+ */
+ protected function create_user($username)
{
- $db_conn_mgr = new phpbb_database_test_connection_manager($config);
- $db_conn_mgr->recreate_db();
+ // Required by unique_id
+ global $config;
+
+ if (!is_array($config))
+ {
+ $config = array();
+ }
+
+ $config['rand_seed'] = '';
+ $config['rand_seed_last_update'] = time() + 600;
+
+ // Required by user_add
+ global $db, $cache;
+ $db = $this->get_db();
+ if (!function_exists('phpbb_mock_null_cache'))
+ {
+ require_once(__DIR__ . '/../mock/null_cache.php');
+ }
+ $cache = new phpbb_mock_null_cache;
+
+ if (!function_exists('utf_clean_string'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
+ }
+ if (!function_exists('user_add'))
+ {
+ require_once(__DIR__ . '/../../phpBB/includes/functions_user.php');
+ }
+
+ $user_row = array(
+ 'username' => $username,
+ 'group_id' => 2,
+ 'user_email' => 'nobody@example.com',
+ 'user_type' => 0,
+ 'user_lang' => 'en',
+ 'user_timezone' => 0,
+ 'user_dateformat' => '',
+ 'user_password' => phpbb_hash($username . $username),
+ );
+ return user_add($user_row);
}
- protected function login()
+ protected function login($username = 'admin')
{
$this->add_lang('ucp');
- $crawler = $this->request('GET', 'ucp.php');
+ $crawler = self::request('GET', 'ucp.php');
$this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), $crawler->filter('html')->text());
$form = $crawler->selectButton($this->lang('LOGIN'))->form();
- $login = $this->client->submit($form, array('username' => 'admin', 'password' => 'admin'));
+ $crawler = self::submit($form, array('username' => $username, 'password' => $username . $username));
+ $this->assertContains($this->lang('LOGIN_REDIRECT'), $crawler->filter('html')->text());
+
+ $cookies = self::$cookieJar->all();
- $cookies = $this->cookieJar->all();
-
// The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
- foreach ($cookies as $key => $cookie);
+ foreach ($cookies as $cookie);
{
- if (substr($key, -4) == '_sid')
+ if (substr($cookie->getName(), -4) == '_sid')
{
$this->sid = $cookie->getValue();
}
}
}
+ /**
+ * Login to the ACP
+ * You must run login() before calling this.
+ */
+ protected function admin_login($username = 'admin')
+ {
+ $this->add_lang('acp/common');
+
+ // Requires login first!
+ if (empty($this->sid))
+ {
+ $this->fail('$this->sid is empty. Make sure you call login() before admin_login()');
+ return;
+ }
+
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
+ $this->assertContains($this->lang('LOGIN_ADMIN_CONFIRM'), $crawler->filter('html')->text());
+
+ $form = $crawler->selectButton($this->lang('LOGIN'))->form();
+
+ foreach ($form->getValues() as $field => $value)
+ {
+ if (strpos($field, 'password_') === 0)
+ {
+ $crawler = self::submit($form, array('username' => $username, $field => $username . $username));
+ $this->assertContains($this->lang('LOGIN_ADMIN_SUCCESS'), $crawler->filter('html')->text());
+
+ $cookies = self::$cookieJar->all();
+
+ // The session id is stored in a cookie that ends with _sid - we assume there is only one such cookie
+ foreach ($cookies as $cookie);
+ {
+ if (substr($cookie->getName(), -4) == '_sid')
+ {
+ $this->sid = $cookie->getValue();
+ }
+ }
+
+ break;
+ }
+ }
+ }
+
protected function add_lang($lang_file)
{
if (is_array($lang_file))
@@ -238,4 +559,169 @@ class phpbb_functional_test_case extends phpbb_test_case
return call_user_func_array('sprintf', $args);
}
+
+ /**
+ * Perform some basic assertions for the page
+ *
+ * Checks for debug/error output before the actual page content and the status code
+ *
+ * @param mixed $status_code Expected status code, false to disable check
+ * @return null
+ */
+ static public function assert_response_html($status_code = 200)
+ {
+ if ($status_code !== false)
+ {
+ self::assert_response_status_code($status_code);
+ }
+
+ // Any output before the doc type means there was an error
+ $content = self::$client->getResponse()->getContent();
+ self::assertStringStartsWith('<!DOCTYPE', trim($content), 'Output found before DOCTYPE specification.');
+ }
+
+ /**
+ * Heuristic function to check that the response is success.
+ *
+ * When php decides to die with a fatal error, it still sends 200 OK
+ * status code. This assertion tries to catch that.
+ *
+ * @param int $status_code Expected status code
+ * @return null
+ */
+ static public function assert_response_status_code($status_code = 200)
+ {
+ self::assertEquals($status_code, self::$client->getResponse()->getStatus());
+ }
+
+ /**
+ * Creates a topic
+ *
+ * Be sure to login before creating
+ *
+ * @param int $forum_id
+ * @param string $subject
+ * @param string $message
+ * @param array $additional_form_data Any additional form data to be sent in the request
+ * @return array post_id, topic_id
+ */
+ public function create_topic($forum_id, $subject, $message, $additional_form_data = array())
+ {
+ $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}";
+
+ $form_data = array_merge(array(
+ 'subject' => $subject,
+ 'message' => $message,
+ 'post' => true,
+ ), $additional_form_data);
+
+ return self::submit_post($posting_url, 'POST_TOPIC', $form_data);
+ }
+
+ /**
+ * Creates a post
+ *
+ * Be sure to login before creating
+ *
+ * @param int $forum_id
+ * @param int $topic_id
+ * @param string $subject
+ * @param string $message
+ * @param array $additional_form_data Any additional form data to be sent in the request
+ * @return array post_id, topic_id
+ */
+ public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array())
+ {
+ $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}";
+
+ $form_data = array_merge(array(
+ 'subject' => $subject,
+ 'message' => $message,
+ 'post' => true,
+ ), $additional_form_data);
+
+ return self::submit_post($posting_url, 'POST_REPLY', $form_data);
+ }
+
+ /**
+ * Helper for submitting posts
+ *
+ * @param string $posting_url
+ * @param string $posting_contains
+ * @param array $form_data
+ * @return array post_id, topic_id
+ */
+ protected function submit_post($posting_url, $posting_contains, $form_data)
+ {
+ $this->add_lang('posting');
+
+ $crawler = self::request('GET', $posting_url);
+ $this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
+
+ $hidden_fields = array(
+ $crawler->filter('[type="hidden"]')->each(function ($node, $i) {
+ return array('name' => $node->getAttribute('name'), 'value' => $node->getAttribute('value'));
+ }),
+ );
+
+ foreach ($hidden_fields as $fields)
+ {
+ foreach($fields as $field)
+ {
+ $form_data[$field['name']] = $field['value'];
+ }
+ }
+
+ // Bypass time restriction that said that if the lastclick time (i.e. time when the form was opened)
+ // is not at least 2 seconds before submission, cancel the form
+ $form_data['lastclick'] = 0;
+
+ // I use a request because the form submission method does not allow you to send data that is not
+ // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs)
+ // Instead, I send it as a request with the submit button "post" set to true.
+ $crawler = self::request('POST', $posting_url, $form_data);
+ $this->assertContains($this->lang('POST_STORED'), $crawler->filter('html')->text());
+ $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri();
+
+ return array(
+ 'topic_id' => $this->get_parameter_from_link($url, 't'),
+ 'post_id' => $this->get_parameter_from_link($url, 'p'),
+ );
+ }
+
+ /**
+ * Returns the requested parameter from a URL
+ *
+ * @param string $url
+ * @param string $parameter
+ * @return string Value of the parameter in the URL, null if not set
+ */
+ public function get_parameter_from_link($url, $parameter)
+ {
+ if (strpos($url, '?') === false)
+ {
+ return null;
+ }
+
+ $url_parts = explode('?', $url);
+ if (isset($url_parts[1]))
+ {
+ $url_parameters = $url_parts[1];
+ if (strpos($url_parameters, '#') !== false)
+ {
+ $url_parameters = explode('#', $url_parameters);
+ $url_parameters = $url_parameters[0];
+ }
+
+ foreach (explode('&', $url_parameters) as $url_param)
+ {
+ list($param, $value) = explode('=', $url_param);
+ if ($param == $parameter)
+ {
+ return $value;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 2a3c27f9f9..29adfc6817 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -79,6 +79,7 @@ class phpbb_test_case_helpers
'dbname' => $dbname,
'dbuser' => $dbuser,
'dbpasswd' => $dbpasswd,
+ 'custom_dsn' => isset($custom_dsn) ? $custom_dsn : '',
));
if (isset($phpbb_functional_url))
@@ -95,7 +96,8 @@ class phpbb_test_case_helpers
'dbport' => isset($_SERVER['PHPBB_TEST_DBPORT']) ? $_SERVER['PHPBB_TEST_DBPORT'] : '',
'dbname' => isset($_SERVER['PHPBB_TEST_DBNAME']) ? $_SERVER['PHPBB_TEST_DBNAME'] : '',
'dbuser' => isset($_SERVER['PHPBB_TEST_DBUSER']) ? $_SERVER['PHPBB_TEST_DBUSER'] : '',
- 'dbpasswd' => isset($_SERVER['PHPBB_TEST_DBPASSWD']) ? $_SERVER['PHPBB_TEST_DBPASSWD'] : ''
+ 'dbpasswd' => isset($_SERVER['PHPBB_TEST_DBPASSWD']) ? $_SERVER['PHPBB_TEST_DBPASSWD'] : '',
+ 'custom_dsn' => isset($_SERVER['PHPBB_TEST_CUSTOM_DSN']) ? $_SERVER['PHPBB_TEST_CUSTOM_DSN'] : '',
));
}
diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php
index 8fcdb7ef85..f0e13638a5 100644
--- a/tests/text_processing/censor_text_test.php
+++ b/tests/text_processing/censor_text_test.php
@@ -9,7 +9,7 @@
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../mock_user.php';
+require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/../mock/cache.php';
class phpbb_text_processing_censor_text_test extends phpbb_test_case
diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php
index 8697907311..db0812319d 100644
--- a/tests/text_processing/make_clickable_test.php
+++ b/tests/text_processing/make_clickable_test.php
@@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
class phpbb_text_processing_make_clickable_test extends phpbb_test_case
{
- public static function make_clickable_data()
+ static public function make_clickable_data()
{
// value => whether it should work
$prefix_texts = array(
diff --git a/tests/utf/utf8_clean_string_test.php b/tests/utf/utf8_clean_string_test.php
index 70bd549d5b..5ebf6409af 100644
--- a/tests/utf/utf8_clean_string_test.php
+++ b/tests/utf/utf8_clean_string_test.php
@@ -11,7 +11,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_utf_utf8_clean_string_test extends phpbb_test_case
{
- public static function cleanable_strings()
+ static public function cleanable_strings()
{
return array(
array('MiXed CaSe', 'mixed case', 'Checking case folding'),
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
index e54b2bb77b..179a2a358e 100644
--- a/travis/phpunit-mysql-travis.xml
+++ b/travis/phpunit-mysql-travis.xml
@@ -9,6 +9,7 @@
stopOnFailure="false"
syntaxCheck="true"
strict="true"
+ verbose="true"
bootstrap="../tests/bootstrap.php">
<testsuites>
<testsuite name="phpBB Test Suite">
@@ -16,7 +17,7 @@
<exclude>tests/functional</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">../tests/functional</directory>
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
</testsuites>
@@ -34,5 +35,6 @@
<server name="PHPBB_TEST_DBUSER" value="root" />
<server name="PHPBB_TEST_DBPASSWD" value="" />
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
</php>
</phpunit>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
index 55ba996548..12e20547ba 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -9,6 +9,7 @@
stopOnFailure="false"
syntaxCheck="true"
strict="true"
+ verbose="true"
bootstrap="../tests/bootstrap.php">
<testsuites>
<testsuite name="phpBB Test Suite">
@@ -16,7 +17,7 @@
<exclude>tests/functional</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
- <directory suffix="_test.php" phpVersion="5.3.0" phpVersionOperator=">=">../tests/functional</directory>
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
</testsuites>
@@ -36,5 +37,6 @@
<server name="PHPBB_TEST_DBUSER" value="postgres" />
<server name="PHPBB_TEST_DBPASSWD" value="" />
<server name="PHPBB_TEST_TABLE_PREFIX" value="phpbb_"/>
+ <server name="PHPBB_FUNCTIONAL_URL" value="http://localhost/" />
</php>
</phpunit>
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
new file mode 100755
index 0000000000..beb04b0fef
--- /dev/null
+++ b/travis/setup-webserver.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+#
+# @copyright (c) 2013 phpBB Group
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+#
+set -e
+
+sudo apt-get update -qq
+sudo apt-get install -qq nginx realpath
+
+sudo service nginx stop
+
+DIR=$(dirname "$0")
+PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB")
+
+NGINX_CONF="/etc/nginx/sites-enabled/default"
+
+PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm"
+PHP_FPM_CONF="$DIR/php-fpm.conf"
+PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock
+
+USER=$(whoami)
+
+# php-fpm configuration
+echo "
+[global]
+
+[travis]
+user = $USER
+group = $USER
+listen = $PHP_FPM_SOCK
+pm = static
+pm.max_children = 2
+
+php_admin_value[memory_limit] = 128M
+" > $PHP_FPM_CONF
+
+# nginx configuration
+echo "
+server {
+ listen 80;
+ root $PHPBB_ROOT_PATH/;
+ index index.php index.html;
+
+ location ~ \.php$ {
+ fastcgi_pass unix:$PHP_FPM_SOCK;
+ include fastcgi_params;
+ }
+}
+" | sudo tee $NGINX_CONF > /dev/null
+
+# Start daemons
+sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf"
+sudo service nginx start
diff --git a/vendor/goutte.phar b/vendor/goutte.phar
deleted file mode 100644
index 20b7166a67..0000000000
--- a/vendor/goutte.phar
+++ /dev/null
Binary files differ