aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--README.md20
-rw-r--r--build/build.xml155
-rwxr-xr-xbuild/build_diff.php31
-rw-r--r--build/build_helper.php175
-rwxr-xr-xbuild/package.php155
-rw-r--r--build/phpdoc-phpbb.ini106
-rw-r--r--build/webpi/parameters.xml112
-rwxr-xr-xgit-tools/hooks/commit-msg258
-rwxr-xr-xgit-tools/hooks/install17
-rwxr-xr-xgit-tools/hooks/pre-commit7
-rwxr-xr-xgit-tools/hooks/prepare-commit-msg10
-rwxr-xr-xgit-tools/hooks/uninstall16
-rw-r--r--phpBB/adm/index.php16
-rw-r--r--phpBB/adm/style/acp_ban.html6
-rw-r--r--phpBB/adm/style/acp_forums.html2
-rw-r--r--phpBB/adm/style/acp_styles.html2
-rw-r--r--phpBB/adm/style/acp_update.html6
-rw-r--r--phpBB/adm/style/acp_users_signature.html2
-rw-r--r--phpBB/adm/style/admin.css6
-rw-r--r--phpBB/adm/style/captcha_recaptcha.html3
-rw-r--r--phpBB/adm/style/editor.js15
-rw-r--r--phpBB/common.php6
-rw-r--r--phpBB/config.php0
-rw-r--r--phpBB/develop/check_flash_bbcodes.php163
-rwxr-xr-xphpBB/develop/set_permissions.sh9
-rw-r--r--phpBB/docs/AUTHORS3
-rw-r--r--phpBB/docs/CHANGELOG.html521
-rw-r--r--phpBB/docs/INSTALL.html4
-rw-r--r--phpBB/docs/README.html2
-rw-r--r--phpBB/docs/auth_api.html50
-rw-r--r--phpBB/docs/coding-guidelines.html128
-rw-r--r--phpBB/docs/hook_system.html4
-rw-r--r--phpBB/docs/lighttpd.sample.conf60
-rw-r--r--phpBB/download/file.php23
-rw-r--r--phpBB/feed.php4
-rw-r--r--phpBB/includes/.htaccess4
-rw-r--r--phpBB/includes/acm/acm_file.php16
-rw-r--r--phpBB/includes/acm/acm_memory.php8
-rw-r--r--phpBB/includes/acm/acm_wincache.php84
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_ban.php4
-rw-r--r--phpBB/includes/acp/acp_board.php3
-rw-r--r--phpBB/includes/acp/acp_captcha.php4
-rw-r--r--phpBB/includes/acp/acp_database.php54
-rw-r--r--phpBB/includes/acp/acp_forums.php5
-rw-r--r--phpBB/includes/acp/acp_groups.php11
-rw-r--r--phpBB/includes/acp/acp_php_info.php4
-rw-r--r--phpBB/includes/acp/acp_prune.php8
-rw-r--r--phpBB/includes/acp/acp_styles.php29
-rw-r--r--phpBB/includes/acp/acp_update.php10
-rw-r--r--phpBB/includes/acp/acp_users.php14
-rw-r--r--phpBB/includes/acp/info/acp_board.php2
-rw-r--r--phpBB/includes/auth/auth_db.php6
-rw-r--r--phpBB/includes/cache.php9
-rw-r--r--phpBB/includes/captcha/plugins/captcha_abstract.php8
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php5
-rw-r--r--phpBB/includes/constants.php8
-rw-r--r--phpBB/includes/db/db_tools.php18
-rw-r--r--phpBB/includes/db/firebird.php11
-rw-r--r--phpBB/includes/db/mssql.php7
-rw-r--r--phpBB/includes/db/mssql_odbc.php7
-rw-r--r--phpBB/includes/db/mssqlnative.php61
-rw-r--r--phpBB/includes/db/mysql.php7
-rw-r--r--phpBB/includes/db/mysqli.php8
-rw-r--r--phpBB/includes/db/oracle.php15
-rw-r--r--phpBB/includes/db/postgres.php12
-rw-r--r--phpBB/includes/db/sqlite.php11
-rw-r--r--phpBB/includes/functions.php225
-rw-r--r--phpBB/includes/functions_admin.php92
-rw-r--r--phpBB/includes/functions_compress.php6
-rw-r--r--phpBB/includes/functions_convert.php10
-rw-r--r--phpBB/includes/functions_display.php15
-rw-r--r--phpBB/includes/functions_messenger.php94
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php7
-rw-r--r--phpBB/includes/functions_profile_fields.php10
-rw-r--r--phpBB/includes/functions_upload.php5
-rw-r--r--phpBB/includes/functions_user.php57
-rw-r--r--phpBB/includes/mcp/mcp_main.php35
-rw-r--r--phpBB/includes/mcp/mcp_post.php4
-rw-r--r--phpBB/includes/mcp/mcp_queue.php23
-rw-r--r--phpBB/includes/mcp/mcp_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_topic.php2
-rw-r--r--phpBB/includes/message_parser.php9
-rw-r--r--phpBB/includes/search/fulltext_mysql.php10
-rw-r--r--phpBB/includes/search/fulltext_native.php13
-rw-r--r--phpBB/includes/session.php23
-rw-r--r--phpBB/includes/template.php2
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php2
-rw-r--r--phpBB/includes/ucp/ucp_groups.php2
-rw-r--r--phpBB/includes/ucp/ucp_main.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php5
-rw-r--r--phpBB/includes/ucp/ucp_profile.php9
-rw-r--r--phpBB/includes/ucp/ucp_register.php6
-rw-r--r--phpBB/includes/ucp/ucp_remind.php4
-rw-r--r--phpBB/index.php8
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php4
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php2
-rw-r--r--phpBB/install/database_update.php255
-rw-r--r--phpBB/install/install_convert.php4
-rw-r--r--phpBB/install/install_install.php6
-rw-r--r--phpBB/install/install_update.php11
-rw-r--r--phpBB/install/schemas/schema_data.sql9
-rw-r--r--phpBB/language/en/acp/board.php80
-rw-r--r--phpBB/language/en/acp/common.php6
-rw-r--r--phpBB/language/en/acp/groups.php2
-rw-r--r--phpBB/language/en/acp/search.php2
-rw-r--r--phpBB/language/en/acp/styles.php52
-rw-r--r--phpBB/language/en/acp/users.php1
-rw-r--r--phpBB/language/en/captcha_qa.php14
-rw-r--r--phpBB/language/en/captcha_recaptcha.php2
-rw-r--r--phpBB/language/en/common.php19
-rw-r--r--phpBB/language/en/help_faq.php2
-rw-r--r--phpBB/language/en/install.php5
-rw-r--r--phpBB/language/en/memberlist.php2
-rw-r--r--phpBB/language/en/search.php2
-rw-r--r--phpBB/language/en/search_synonyms.php4
-rw-r--r--phpBB/language/en/viewforum.php13
-rw-r--r--phpBB/memberlist.php2
-rw-r--r--phpBB/posting.php40
-rw-r--r--phpBB/search.php74
-rw-r--r--phpBB/style.php21
-rw-r--r--phpBB/styles/prosilver/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/prosilver/style.cfg2
-rw-r--r--phpBB/styles/prosilver/template/captcha_recaptcha.html1
-rw-r--r--phpBB/styles/prosilver/template/editor.js6
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js13
-rw-r--r--phpBB/styles/prosilver/template/index_body.html2
-rw-r--r--phpBB/styles/prosilver/template/login_body.html8
-rw-r--r--phpBB/styles/prosilver/template/mcp_post.html4
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/prosilver/template/search_body.html8
-rw-r--r--phpBB/styles/prosilver/template/template.cfg2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_signature.html2
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html8
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css1
-rw-r--r--phpBB/styles/prosilver/theme/content.css14
-rw-r--r--phpBB/styles/prosilver/theme/forms.css5
-rw-r--r--phpBB/styles/prosilver/theme/print.css2
-rw-r--r--phpBB/styles/prosilver/theme/theme.cfg2
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css9
-rw-r--r--phpBB/styles/subsilver2/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/subsilver2/style.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/attachment.html4
-rw-r--r--phpBB/styles/subsilver2/template/captcha_default.html2
-rw-r--r--phpBB/styles/subsilver2/template/captcha_recaptcha.html1
-rw-r--r--phpBB/styles/subsilver2/template/editor.js11
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html6
-rw-r--r--phpBB/styles/subsilver2/template/login_body.html21
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html6
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html8
-rw-r--r--phpBB/styles/subsilver2/template/posting_buttons.html3
-rw-r--r--phpBB/styles/subsilver2/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/subsilver2/template/search_body.html19
-rw-r--r--phpBB/styles/subsilver2/template/template.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_signature.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html18
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html2
-rw-r--r--phpBB/styles/subsilver2/theme/theme.cfg2
-rw-r--r--phpBB/ucp.php2
-rw-r--r--phpBB/viewforum.php17
-rw-r--r--phpBB/viewtopic.php4
-rw-r--r--tests/RUNNING_TESTS.txt57
-rw-r--r--tests/all_tests.php15
-rw-r--r--tests/dbal/all_tests.php6
-rw-r--r--tests/dbal/fixtures/config.xml18
-rw-r--r--tests/dbal/select.php (renamed from tests/dbal/dbal.php)37
-rw-r--r--tests/dbal/write.php172
-rw-r--r--tests/network/all_tests.php40
-rw-r--r--tests/network/checkdnsrr.php63
-rw-r--r--tests/random/all_tests.php40
-rw-r--r--tests/random/gen_rand_string.php63
-rw-r--r--tests/regex/all_tests.php46
-rw-r--r--tests/regex/email.php119
-rw-r--r--tests/regex/ipv4.php72
-rw-r--r--tests/regex/ipv6.php143
-rw-r--r--tests/regex/url.php34
-rw-r--r--tests/template/template.php25
-rw-r--r--tests/test_framework/framework.php8
-rw-r--r--tests/test_framework/phpbb_database_test_case.php288
-rw-r--r--tests/test_framework/phpbb_test_case.php7
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php53
190 files changed, 4221 insertions, 1216 deletions
diff --git a/.gitignore b/.gitignore
index 3e0f454e0c..871d17b386 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,8 @@
+*~
phpBB/cache/*.php
-*~ \ No newline at end of file
+phpBB/config.php
+phpBB/files/*
+phpBB/images/avatars/upload/*
+phpBB/store/*
+tests/phpbb_unit_tests.sqlite2
+tests/test_config.php
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..6b94f898a3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+[![phpBB](http://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com)
+
+## ABOUT
+
+phpBB is a free bulletin board written in PHP.
+
+## COMMUNITY
+
+Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
+
+## CONTRIBUTE
+
+1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
+2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
+3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
+4. Send us a pull request
+
+## LICENSE
+
+[GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php)
diff --git a/build/build.xml b/build/build.xml
new file mode 100644
index 0000000000..8d2afcb00c
--- /dev/null
+++ b/build/build.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
+ <!-- a few settings for the build -->
+ <property name="newversion" value="3.0.8" />
+ <property name="prevversion" value="3.0.8-RC1" />
+ <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7-PL1" />
+ <!-- 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="prepare">
+ <mkdir dir="build/logs" />
+ <mkdir dir="build/api" />
+ <mkdir dir="build/codebrowser" />
+ <mkdir dir="build/coverage" />
+ <mkdir dir="build/cpd" />
+ <mkdir dir="build/dependencies" />
+ <mkdir dir="build/new_version" />
+ <mkdir dir="build/new_version/files" />
+ <mkdir dir="build/new_version/patches" />
+ <mkdir dir="build/new_version/release_files" />
+ <mkdir dir="build/new_version/update" />
+ <mkdir dir="build/old_versions" />
+ <mkdir dir="build/save" />
+ </target>
+
+ <target name="clean">
+ <delete dir="build/logs" />
+ <delete dir="build/api" />
+ <delete dir="build/codebrowser" />
+ <delete dir="build/coverage" />
+ <delete dir="build/cpd" />
+ <delete dir="build/dependencies" />
+ <delete dir="build/new_version" />
+ <delete dir="build/old_versions" />
+ <delete dir="build/save" />
+ </target>
+
+ <target name="test">
+ <exec dir="tests"
+ command="phpunit --log-junit ../build/logs/phpunit.xml
+ --coverage-clover ../build/logs/clover.xml
+ --coverage-html ../build/coverage
+ phpbb_all_tests all_tests.php"
+ passthru="true" />
+
+
+ <!-- Does not allow changing the working directory to tests/
+ so this approach does not work for us unfortunately
+ <phpunit codecoverage="true" haltonfailure="true">
+ <formatter todir="build/logs" type="xml"/>
+ <batchtest>
+ <fileset dir="tests">
+ <include name="all_tests.php"/>
+ </fileset>
+ </batchtest>
+ </phpunit>
+ -->
+ </target>
+
+ <target name="docs">
+ <exec dir="build"
+ command="phpdoc -c phpdoc-phpbb.ini"
+ passthru="true" />
+ </target>
+
+ <target name="old-version-diffs">
+ <foreach list="${oldversions}" param="version" target="old-version-diff" />
+ </target>
+
+ <!-- This target retrieves an old version from the git tag release-${version}
+ and creates a diff between that release and the new one -->
+ <target name="old-version-diff">
+ <echo msg="Retrieving version ${version}" />
+ <mkdir dir="build/old_versions/release-${version}" />
+
+ <phingcall target="export">
+ <property name="revision" value="release-${version}" />
+ <property name="dir" value="build/old_versions/release-${version}" />
+ </phingcall>
+
+ <phingcall target="clean-diff-dir">
+ <property name="dir" value="build/old_versions/release-${version}" />
+ </phingcall>
+
+ <exec dir="build/old_versions" command="diff -crNEBwd release-${version} release-${newversion} >
+ ../new_version/patches/phpBB-${version}_to_${newversion}.patch" escape="false" />
+ </target>
+
+ <target name="prepare-new-version">
+ <!-- select the currently checked out commit (HEAD) for packaging -->
+ <mkdir dir="build/new_version/phpBB3" />
+ <phingcall target="export">
+ <property name="revision" value="HEAD" />
+ <property name="dir" value="build/new_version/phpBB3" />
+ </phingcall>
+
+ <!-- copy into directory for diffs -->
+ <exec dir="build" command="cp -rp new_version/phpBB3 old_versions/release-${newversion}" />
+ <!-- and clean up -->
+ <phingcall target="clean-diff-dir">
+ <property name="dir" value="build/old_versions/release-${newversion}" />
+ </phingcall>
+
+ <!-- create an empty config.php file (not for diffs) -->
+ <touch file="build/new_version/phpBB3/config.php" />
+
+ </target>
+
+ <target name="create-package" depends="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" />
+ </target>
+
+ <!--
+ This target can be called using phingcall to retrieve a clean
+ checkout of a commit from git. It will only export the phpBB directory.
+ The properties revision and dir are required.
+ This target will remove directories that are not needed in distribution
+ and set correct permissions.
+ -->
+ <target name="export">
+ <exec dir="phpBB"
+ command="git archive ${revision} | tar -x -C ../${dir}"
+ checkreturn="true" />
+ <delete file="${dir}/config.php" />
+ <delete dir="${dir}/develop" />
+ <delete dir="${dir}/install/data" />
+
+ <echo msg="Setting permissions for checkout of ${revision} in ${dir}" />
+ <!-- set permissions of all files to 644, directories to 755 -->
+ <exec dir="${dir}" command="find -type f|xargs chmod 644" escape="false" />
+ <exec dir="${dir}" command="find -type d|xargs chmod 755" escape="false" />
+ <!-- set permissions of some directories to 777 -->
+ <chmod mode="0777" file="${dir}/cache" />
+ <chmod mode="0777" file="${dir}/store" />
+ <chmod mode="0777" file="${dir}/files" />
+ <chmod mode="0777" file="${dir}/images/avatars/upload" />
+ </target>
+
+ <target name="clean-diff-dir">
+ <delete dir="${dir}/cache" />
+ <delete dir="${dir}/docs" />
+ <delete dir="${dir}/files" />
+ <delete dir="${dir}/install" />
+ <delete dir="${dir}/store" />
+ </target>
+
+</project>
diff --git a/build/build_diff.php b/build/build_diff.php
index ef815bc0c3..6a6070228f 100755
--- a/build/build_diff.php
+++ b/build/build_diff.php
@@ -9,16 +9,26 @@
*
*/
-// CONFIG - Begin
-$substitute_old = '3.0.6';
-$substitute_new = '3.0.7-PL1';
-$simple_name_old = 'phpbb306';
-$simple_name_new = 'phpbb307-PL1';
+if ($_SERVER['argc'] != 3)
+{
+ die("Please specify the previous and current version as arguments (e.g. build_diff.php '1.0.2' '1.0.3').");
+}
+
+$old_version = trim($_SERVER['argv'][1]);
+$new_version = trim($_SERVER['argv'][2]);
+
+$substitute_old = $old_version;
+$substitute_new = $new_version;
+$simple_name_old = 'release-' . $old_version;
+$simple_name_new = 'release-' . $new_version;
$echo_changes = false;
+
+// DO NOT EVER USE THE FOLLOWING! Fix the script to generate proper changes,
+// do NOT manually create them.
+
// Set this to true to just compress the changes and do not build them again
// This should be used for building custom modified txt file. ;)
$package_changed_files = false;
-// CONFIG - End
//$debug_file = 'includes/functions_user.php'; //'styles/prosilver/style.cfg';
$debug_file = false;
@@ -36,9 +46,6 @@ if (!$package_changed_files)
{
if (!$echo_changes)
{
- // Cleanup...
- run_command("rm -R $location/save/*");
-
// Create directory...
run_command("mkdir $location/save/{$s_name}");
run_command("mkdir $location/save/{$s_name}/language");
@@ -72,14 +79,14 @@ if (!$echo_changes)
foreach ($compress_programs as $extension => $compress_command)
{
echo "Packaging code changes for $extension\n";
- run_command("rm ./../../release_files/{$code_changes_filename}.{$extension}");
+ run_command("rm ./../../new_version/release_files/{$code_changes_filename}.{$extension}");
flush();
// Build Package
- run_command("$compress_command ./../../release_files/{$code_changes_filename}.{$extension} *");
+ run_command("$compress_command ./../../new_version/release_files/{$code_changes_filename}.{$extension} *");
// Build MD5 Sum
- run_command("md5sum ./../../release_files/{$code_changes_filename}.{$extension} > ./../../release_files/{$code_changes_filename}.{$extension}.md5");
+ run_command("md5sum ./../../new_version/release_files/{$code_changes_filename}.{$extension} > ./../../new_version/release_files/{$code_changes_filename}.{$extension}.md5");
flush();
}
}
diff --git a/build/build_helper.php b/build/build_helper.php
index 2bae32218b..94fc0ff3b5 100644
--- a/build/build_helper.php
+++ b/build/build_helper.php
@@ -14,10 +14,6 @@ class build_package
var $old_packages;
var $versions;
var $locations;
- var $clean_directory_structure;
- var $files_to_copy;
- var $files_to_remove;
- var $remove_from_diff_structure;
// -c - context diff
// -r - compare recursive
@@ -53,11 +49,11 @@ class build_package
$this->package_infos = array(
'package_name' => 'phpBB3',
'name_prefix' => 'phpbb',
- 'simple_name' => 'phpbb' . str_replace('.', '', $_latest),
+ 'simple_name' => 'release-' . $_latest,
'new_version_number' => $_latest,
'short_version_number' => str_replace('.', '', $_latest),
'release_filename' => 'phpBB-' . $_latest,
- 'last_version' => 'phpbb' . str_replace('.', '', $_before),
+ 'last_version' => 'release-' . $_before,
'last_version_number' => $_before,
);
@@ -78,112 +74,7 @@ class build_package
continue;
}
- $this->old_packages['phpbb' . str_replace('.', '', $package_version)] = $package_version . '_to_';
- }
-
- // We need to make sure this is up to date with the latest version
- $this->clean_directory_structure = array(
- 'adm' => array(
- 'images' => '',
- 'style' => '',
- ),
- 'cache' => '',
- 'docs' => '',
- 'download' => '',
- 'files' => '',
- 'images' => array(
- 'avatars' => array(
- 'gallery' => '',
- 'upload' => '',
- ),
- 'icons' => array(
- 'misc' => '',
- 'smile' => '',
- ),
- 'ranks' => '',
- 'smilies' => '',
- 'upload_icons' => '',
- ),
- 'includes' => array(
- 'acm' => '',
- 'acp' => array(
- 'info' => '',
- ),
- 'auth' => '',
- 'captcha' => array(
- 'plugins' => '',
- ),
- 'diff' => '',
- 'db' => '',
- 'hooks' => '',
- 'mcp' => array(
- 'info' => '',
- ),
- 'questionnaire' => '',
- 'search' => '',
- 'ucp' => array(
- 'info' => '',
- ),
- 'utf' => array(
- 'data' => '',
- ),
- ),
- 'install' => array(
- 'convertors'=> '',
- 'schemas' => '',
-// 'data' => '',
- ),
- 'language' => array(
- 'en' => array(
- 'acp' => '',
- 'email' => '',
- 'mods' => '',
- ),
- ),
- 'store' => '',
- 'styles' => array(
- 'subsilver2' => array(
- 'imageset' => array(
- 'en' => '',
- ),
- 'template' => '',
- 'theme' => array(
- 'images' => '',
- ),
- ),
- 'prosilver' => array(
- 'imageset' => array(
- 'en' => '',
- ),
- 'template' => '',
- 'theme' => array(
- 'images' => '',
- ),
- ),
- ),
- );
-
- // Files to remove (not include within package)
- $this->files_to_remove = array(); //array('includes/utf/data/recode_cjk.php');
-
- // Files within the main directory to copy - do not include config.php
- $this->files_to_copy = array(
- '.htaccess', 'common.php', 'cron.php', 'faq.php', 'feed.php', 'index.php', 'mcp.php', 'memberlist.php', 'posting.php', 'report.php',
- 'search.php', 'style.php', 'ucp.php', 'viewforum.php', 'viewonline.php', 'viewtopic.php'
- );
-
- // These files/directories will be removed and not used for creating the patch files
- $this->remove_from_diff_structure = array(
- 'config.php', 'cache', 'docs', 'files', 'install', 'store', 'develop'
- );
-
- // Writeable directories
- $this->writeable = array('cache', 'store', 'images/avatars/upload', 'files');
-
- // Fill the rest of the files_to_copy array
- foreach ($this->clean_directory_structure as $cur_dir => $dir_struct)
- {
- $this->_fill_files_to_copy($this->locations['new_version'] . $cur_dir, $cur_dir, $dir_struct);
+ $this->old_packages['release-' . $package_version] = $package_version . '_to_';
}
}
@@ -192,66 +83,6 @@ class build_package
return $this->package_infos[$var];
}
- function _fill_files_to_copy($directory, $cur_dir, $dir_struct)
- {
- $dh = opendir($directory);
-
- while ($file = readdir($dh))
- {
- if (is_file($directory . '/' . $file) && $file != '.' && $file != '..')
- {
- $_loc = str_replace($this->locations['new_version'], '', $directory . '/' . $file);
-
- if (in_array($_loc, $this->files_to_remove))
- {
- continue;
- }
-
- $this->files_to_copy[] = $cur_dir . '/' . $file;
- }
- }
- closedir($dh);
-
- if (is_array($dir_struct))
- {
- foreach ($dir_struct as $_cur_dir => $_dir_struct)
- {
- $this->_fill_files_to_copy($directory . '/' . $_cur_dir, $cur_dir . '/' . $_cur_dir, $_dir_struct);
- }
- }
- }
-
- function adjust_permissions($directory)
- {
- $dh = opendir($directory);
-
- while ($file = readdir($dh))
- {
- if ($file == '.' || $file == '..' || $file == '.svn')
- {
- continue;
- }
-
- // If file, then 644
- if (is_file($directory . '/' . $file))
- {
- chmod($directory . '/' . $file, 0644);
- }
- else if (is_dir($directory . '/' . $file))
- {
- $_loc = str_replace($this->package_infos['dest_dir'] . '/', '', $directory . '/' . $file);
-
- // If directory is within the writeable chmod to 777, else 755
- $mode = (in_array($_loc, $this->writeable)) ? 0777 : 0755;
- chmod($directory . '/' . $file, $mode);
-
- // Now traverse to the directory
- $this->adjust_permissions($directory . '/' . $file);
- }
- }
- closedir($dh);
- }
-
function begin_status($headline)
{
if ($this->status_begun)
diff --git a/build/package.php b/build/package.php
index a0da6404c6..4ce644e8ca 100755
--- a/build/package.php
+++ b/build/package.php
@@ -9,145 +9,24 @@
*
*/
-// The only thing i need to adjust. ;)
-// Please always add the latest version number to the end
-// Only have 5 releases here...
-// If RC8 drops remove the install/data directory
-//$versions = array('3.0.2', '3.0.3-RC1', '3.0.3', '3.0.4-RC1', '3.0.4', '3.0.5-RC1', '3.0.5', '3.0.6-RC1', '3.0.6-RC2', '3.0.6-RC3');
-//$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7');
-$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7-RC2', '3.0.7', '3.0.7-PL1');
-$verbose = false;
+//$versions = array('3.0.2', '3.0.3', '3.0.4', '3.0.5', '3.0.6', '3.0.7-RC1', '3.0.7-RC2', '3.0.7', '3.0.7-PL1');
-require('build_helper.php');
-
-$package = new build_package($versions, $verbose);
-
-echo "Building Release Packages\n";
-echo "Now all three package types (patch, files, release) are built as well as the update package (update).\n";
-
-$package->begin_status('Remove temporary files');
-
-// Cleanup...
-$package->run_command('rm -Rv ' . $package->get('dest_dir'));
-$package->run_command('rm -Rv ' . $package->get('diff_dir'));
-$package->run_command('rm -Rv ' . $package->get('patch_directory'));
-$package->run_command('rm -Rv ' . $package->get('files_directory'));
-$package->run_command('rm -Rv ' . $package->get('update_directory'));
-$package->run_command('rm -Rv ' . $package->get('release_directory'));
-
-$package->begin_status('Create new directories');
-
-// Make sure the directories got removed
-while (file_exists($package->get('update_directory')))
-{
- sleep(1);
-}
-
-if (!file_exists($package->get('dest_dir')))
-{
- $package->run_command('mkdir ' . $package->get('dest_dir'));
-}
-
-if (!file_exists($package->get('diff_dir')))
-{
- $package->run_command('mkdir ' . $package->get('diff_dir'));
-}
-
-if (!file_exists($package->get('patch_directory')))
-{
- $package->run_command('mkdir ' . $package->get('patch_directory'));
-}
-
-if (!file_exists($package->get('files_directory')))
-{
- $package->run_command('mkdir ' . $package->get('files_directory'));
-}
-
-if (!file_exists($package->get('update_directory')))
-{
- $package->run_command('mkdir ' . $package->get('update_directory'));
-}
-
-if (!file_exists($package->get('release_directory')))
-{
- $package->run_command('mkdir ' . $package->get('release_directory'));
-}
-
-$package->begin_status('Copy release files to clean release directory');
-
-// Create config.php file
-$package->run_command('touch ' . $package->get('dest_dir') . '/config.php');
-//$package->run_command('sudo chown www-data:www-data ' . $package->get('dest_dir') . '/config.php');
-
-// Create new directory structure
-foreach ($package->clean_directory_structure as $dir => $dir_struct)
-{
- $package->create_directory($package->get('dest_dir') . '/' . $dir, $dir_struct);
-}
-
-// First step is to copy the new version over (clean structure)
-foreach ($package->files_to_copy as $file)
-{
- $source_file = $package->locations['new_version'] . $file;
- $dest_file = $package->get('dest_dir') . '/' . $file;
-
- $package->run_command("cp -p $source_file $dest_file");
-}
-
-// fix line endings
-chdir($package->get('dest_dir'));
-$package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
-
-// Now clean up the permissions
-$package->begin_status('Adjust permissions');
-
-$package->adjust_permissions($package->get('dest_dir'));
-
-// Now create a version for diffing the version - copy the tree over to old_versions...
-$package->begin_status('Create diff directory for obtaining file differences');
-
-$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/* ' . $package->get('diff_dir'));
-$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/.htaccess ' . $package->get('diff_dir'));
-
-// Cleanup diff directory (only contents to diff)
-foreach ($package->remove_from_diff_structure as $remove_dir)
+if ($_SERVER['argc'] < 2)
{
- $package->run_command('rm -Rv ' . $package->get('diff_dir') . '/' . $remove_dir);
+ die("Please specify a list of versions as the first argument (e.g. package.php '1.0.0, 1.0.1, 1.0.2').");
}
-// Now, first of all we need to rebuild all old packages we want to support
-foreach ($package->old_packages as $package_name => $tag_name)
-{
- $package->begin_status('Create old packages directory for diffing to ' . $package_name);
-
- chdir($package->locations['old_versions']);
-
- if (is_dir($package->locations['old_versions'] . $package_name))
- {
- $package->run_command('rm -Rv ' . $package->locations['old_versions'] . $package_name);
- }
-
- // Now, create a new one...
- $tag_name = 'release_' . str_replace(array('.', '_to_'), array('_', ''), $tag_name);
+$versions = explode(',', $_SERVER['argv'][1]);
+$versions = array_map('trim', $versions);
- $package->run_command('svn export --non-interactive http://code.phpbb.com/svn/phpbb/tags/' . $tag_name . '/phpBB/ ' . $package_name);
+$verbose = true;
- $location = $package->locations['old_versions'] . $package_name;
- chdir($location . '/');
-
- $package->run_command($package->locations['new_version'] . 'develop/fix_files.sh');
-
- // Now clean up the permissions
- $package->begin_status('Adjust permissions for package ' . $package_name);
+require('build_helper.php');
- $package->adjust_permissions($location);
+$package = new build_package($versions, $verbose);
- // Cleanup diff directory (only contents to diff)
- foreach ($package->remove_from_diff_structure as $remove_dir)
- {
- $package->run_command('rm -Rv ' . $location . '/' . $remove_dir);
- }
-}
+echo "Building Release Packages\n";
+echo "Now all three package types (patch, files, release) are built as well as the update package (update).\n";
// Go trough all versions making a diff if we even have old versions
// For phpBB 3.0.x we might choose a different update method, rendering the things below useless...
@@ -160,13 +39,13 @@ if (sizeof($package->old_packages))
foreach ($package->old_packages as $_package_name => $dest_package_filename)
{
- $package->begin_status('Creating patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
-
- $dest_package_filename = $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch';
- $package->run_command('diff ' . $package->diff_options . ' ' . $_package_name . ' ' . $package->get('simple_name') . ' > ' . $dest_package_filename);
+ $package->begin_status('Parsing patch/diff files for phpBB-' . $dest_package_filename . $package->get('new_version_number'));
// Parse this diff to determine file changes from the checked versions and save them
- $diff_file_changes[$_package_name] = $package->collect_diff_files($dest_package_filename, $_package_name);
+ $diff_file_changes[$_package_name] = $package->collect_diff_files(
+ $package->get('patch_directory') . '/phpBB-' . $dest_package_filename . $package->get('new_version_number') . '.patch',
+ $_package_name
+ );
}
// Now put those files determined within the correct directories
@@ -404,7 +283,6 @@ if (sizeof($package->old_packages))
foreach ($compress_programs as $extension => $compress_command)
{
$package->begin_status('Packaging phpBB Patch Files for ' . $extension);
- $package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-patch.' . $extension);
// Build Package
$package->run_command($compress_command . ' ../release_files/' . $package->get('release_filename') . '-patch.' . $extension . ' *');
@@ -420,7 +298,6 @@ if (sizeof($package->old_packages))
{
$package->begin_status('Packaging phpBB Files for ' . $extension);
- $package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-files.' . $extension);
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
@@ -457,7 +334,6 @@ if (sizeof($package->old_packages))
$package->begin_status('Packaging phpBB Update for ' . $extension);
- $package->run_command('rm -v ../release_files/' . $package->get('release_filename') . '-update.' . $extension);
$package->run_command('mkdir ' . $package->get('update_directory') . '/release');
// Pack update files
@@ -521,7 +397,6 @@ foreach ($compress_programs as $extension => $compress_command)
// Microsoft Web PI packaging
$package->begin_status('Packaging phpBB for Microsoft WebPI');
$file = './release_files/' . $package->get('release_filename') . '.webpi.zip';
-$package->run_command("rm -v $file");
$package->run_command('cp -p ./release_files/' . $package->get('release_filename') . ".zip $file");
$package->run_command('cd ./../webpi && ' . $compress_programs['zip'] . " ./../new_version/$file *");
$package->run_command("md5sum $file > $file.md5");
diff --git a/build/phpdoc-phpbb.ini b/build/phpdoc-phpbb.ini
new file mode 100644
index 0000000000..86d33549c0
--- /dev/null
+++ b/build/phpdoc-phpbb.ini
@@ -0,0 +1,106 @@
+;; phpDocumentor parse configuration file
+;;
+;; This file is designed to cut down on repetitive typing on the command-line or web interface
+;; You can copy this file to create a number of configuration files that can be used with the
+;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web
+;; interface will automatically generate a list of .ini files that can be used.
+;;
+;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs
+;;
+;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini
+;;
+;; Copyright 2002, Greg Beaver <cellog@users.sourceforge.net>
+;;
+;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them
+
+[Parse Data]
+;; title of all the documentation
+;; legal values: any string
+title = phpBB3 Sourcecode Documentation
+
+;; parse files that start with a . like .bash_profile
+;; legal values: true, false
+hidden = false
+
+;; show elements marked @access private in documentation by setting this to on
+;; legal values: on, off
+parseprivate = on
+
+;; parse with javadoc-like description (first sentence is always the short description)
+;; legal values: on, off
+javadocdesc = off
+
+;; add any custom @tags separated by commas here
+;; legal values: any legal tagname separated by commas.
+;customtags = mytag1,mytag2
+
+;; This is only used by the XML:DocBook/peardoc2 converter
+defaultcategoryname = sourcecode
+
+;; what is the main package?
+;; legal values: alphanumeric string plus - and _
+defaultpackagename = phpBB3
+
+;; output any parsing information? set to on for cron jobs
+;; legal values: on
+;quiet = on
+
+;; parse a PEAR-style repository. Do not turn this on if your project does
+;; not have a parent directory named "pear"
+;; legal values: on/off
+;pear = on
+
+;; where should the documentation be written?
+;; legal values: a legal path
+target = api
+
+;; Which files should be parsed out as special documentation files, such as README,
+;; INSTALL and CHANGELOG? This overrides the default files found in
+;; phpDocumentor.ini (this file is not a user .ini file, but the global file)
+readmeinstallchangelog = README.html, INSTALL.html, CHANGELOG.html, COPYING
+
+;; limit output to the specified packages, even if others are parsed
+;; legal values: package names separated by commas
+;packageoutput = phpBB3,ACP,SEARCH,DBAL,ACM,MCP,UCP,LOGIN,lang_english
+
+;; comma-separated list of files to parse
+;; legal values: paths separated by commas
+;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory
+
+;; comma-separated list of directories to parse
+;; legal values: directory paths separated by commas
+;directory = /path1,/path2,.,..,subdirectory
+;directory = /home/jeichorn/cvs/pear
+directory = ../phpBB/
+
+;; template base directory (the equivalent directory of <installdir>/phpDocumentor)
+;templatebase = /path/to/my/templates
+
+;; directory to find any example files in through @example and {@example} tags
+;examplesdir = c:\wamp\www\examples
+
+;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore
+;; legal values: any wildcard strings separated by commas
+;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/
+ignore = templates_c/,*HTML/default/*,spec/,*config.php*,*CVS/,test_chora.php,testupdate/,cache/,store/,*proSilver/,develop/,includes/utf/data/,includes/captcha/fonts/,install/update/,install/update.new/,files/,*phpinfo.php*,*update_script.php*,*upgrade.php*,*convert.php*,install/converter/,language/de/,script/,*swatch.php*,*test.php*,*test2.php*,*install.php*,*functions_diff.php*,*acp_update.php*
+
+;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format
+;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,
+;; HTML:frames:earthli,
+;; HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,
+;; HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli
+;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
+;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default
+;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS,CHM:default:default,PDF:default:default
+;output=HTML:frames:DOM/default,XML:DocBook/peardoc2:default,CHM:default:default,HTML:frames:DOM/earthli,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/phphtmllib,HTML:frames:phphtmllib
+;HTML:frames:earthli
+;output=XML:DocBook/peardoc2:default
+
+;output=HTML:frames:DOM/earthli
+;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS,CHM:default:default,PDF:default:default
+;output=HTML:Smarty:PHP
+output=HTML:frames:earthli
+
+;; turn this option on if you want highlighted source code for every file
+;; legal values: on/off
+sourcecode = off
diff --git a/build/webpi/parameters.xml b/build/webpi/parameters.xml
index 994247e48e..be4d374632 100644
--- a/build/webpi/parameters.xml
+++ b/build/webpi/parameters.xml
@@ -9,7 +9,7 @@
scope="iisapp"
match="phpBB3" />
</parameter>
-
+ <!--ACLs-->
<parameter
name="aclCache"
description="Sets the ACL on the cache/ folder"
@@ -19,7 +19,7 @@
<parameterEntry
type="ProviderPath"
scope="setAcl"
- match="phpBB3/cache" />
+ match="phpBB3/cache$" />
</parameter>
<parameter
@@ -31,7 +31,7 @@
<parameterEntry
type="ProviderPath"
scope="setAcl"
- match="phpBB3/files" />
+ match="phpBB3/files$" />
</parameter>
<parameter
@@ -43,7 +43,7 @@
<parameterEntry
type="ProviderPath"
scope="setAcl"
- match="phpBB3/store" />
+ match="phpBB3/store$" />
</parameter>
<parameter
@@ -55,7 +55,7 @@
<parameterEntry
type="ProviderPath"
scope="setAcl"
- match="phpBB3/images/avatars/upload" />
+ match="phpBB3/images/avatars/upload$" />
</parameter>
<parameter
@@ -67,43 +67,44 @@
<parameterEntry
type="ProviderPath"
scope="setAcl"
- match="phpBB3/config.php" />
+ match="phpBB3/config.php$" />
</parameter>
- <parameter
- name="DatabaseServer"
- description="Enter the database server"
- defaultValue=".\SQLExpress"
- tags="SQL, dbServer" >
+ <!-- SQL parameters -->
+ <parameter name="SQL Database Server" description="Enter the database server (usually machine name ) " defaultValue="." tags="SQL">
</parameter>
+ <parameter name="SQL DatabaseServer Instance" description="Enter the database instance name" defaultValue="SQLExpress" tags="SQL">
+ </parameter>
+ <!-- Read database server from config.php . Update 'dbhost' in config.php on publish -->
+ <parameter name="SQL Automatic DatabaseServer" defaultValue="dbhost = '{SQL Database Server}\\{SQL DatabaseServer Instance}';" tags="Hidden,SQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbhost\s*=\s*'([^']*)'\s*;" />
+ </parameter>
<parameter
- name="DatabaseName"
- description="Database name for your application."
- defaultValue="phpbb"
- tags="SQL, dbName">
+ name="SQL DatabaseName" description="Database name for your application." defaultValue="phpbb" tags="SQL, dbName">
- <parameterEntry
- type="TextFile"
- scope="install/mssql.sql"
- match="PlaceHolderForDb" />
+ <parameterEntry type="TextFile" scope="install/mssql.sql" match="PlaceHolderForDb" />
+ </parameter>
+ <!-- Read database name from config.php . Update 'dbname' in config.php on publish -->
+ <parameter name="SQL Automatic DatabaseName" defaultValue="dbname = '{SQL DatabaseName}';" tags="Hidden,SQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbname\s*=\s*'([^']*)'\s*;" />
</parameter>
<parameter
- name="DatabaseAdministrator"
+ name="SQL DatabaseAdministrator"
description="Database server administartor username."
defaultValue="sa"
tags="SQL, DbAdminUsername" >
</parameter>
<parameter
- name="DatabaseAdministratorPassword"
+ name="SQL DatabaseAdministratorPassword"
description="Database server administrator password."
tags="Password,SQL,DbAdminPassword">
</parameter>
<parameter
- name="Database Username"
+ name="SQL Database Username"
description="Username to access your database."
defaultValue="phpbb"
tags="SQL, DbUsername">
@@ -113,9 +114,13 @@
scope="install/mssql.sql"
match="PlaceHolderForUser" />
</parameter>
-
+ <!-- Read database user from config.php . Update 'dbuser' in config.php on publish -->
+ <parameter name="SQL Automatic Database User" defaultValue="dbuser = '{SQL Database Username}';" tags="Hidden,SQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbuser\s*=\s*'([^']*)'\s*;" />
+ </parameter>
+
<parameter
- name="Database Password"
+ name="SQL Database Password"
description="Password for your phpBB database. (Must be at least 8 characters, contain at least one lower case letter, one upper case letter and one digit)"
tags="New, Password,SQL, DbUserPassword">
@@ -129,10 +134,16 @@
match="PlaceHolderForPassword" />
</parameter>
+ <!-- Read database user password from config.php . Update 'dbpasswd' in config.php on publish -->
+ <parameter name="SQL Automatic Database Password" defaultValue="dbpasswd = '{SQL Database Password}';" tags="Hidden,SQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbpasswd\s*=\s*'([^']*)'\s*;" />
+ </parameter>
+
+ <!-- SQL Connection string -->
<parameter
- name="ConnectionString"
+ name="SQL ConnectionString"
description="Automatically sets the connection string for the connection request."
- defaultValue="Server={DatabaseServer};Database={DatabaseName};uid={DatabaseAdministrator};Pwd={DatabaseAdministratorPassword};"
+ defaultValue="Server={SQL Database Server}\{SQL DatabaseServer Instance};Database={SQL DatabaseName};uid={SQL DatabaseAdministrator};Pwd={SQL DatabaseAdministratorPassword};"
tags="Hidden,SQLConnectionString,Validate">
<parameterEntry
@@ -148,6 +159,7 @@
tags="SQL,Hidden">
</parameter>
+ <!-- MYSQL parameters -->
<parameter
name="MySQL Database Server"
description="Enter the hostname"
@@ -160,8 +172,13 @@
match="PlaceHolderForServer" />
</parameter>
+ <!-- Read database server from config.php . Update 'dbhost' in config.php on publish -->
+ <parameter name="Automatic MySQL DatabaseServer" defaultValue="dbhost = '{MySQL Database Server}';" tags="Hidden,MySQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbhost\s*=\s*'([^']*)'\s*;" />
+ </parameter>
+
<parameter
- name="Application Database Name"
+ name="MySQL Database Name"
description="Database Name for your application."
defaultValue="phpbb"
tags="MySQL, dbName">
@@ -171,22 +188,13 @@
scope="install/mysql.sql"
match="PlaceHolderForDb" />
</parameter>
-
- <parameter
- name="MySQL Database Administrator"
- description="Database administrator username."
- defaultValue="root"
- tags="MySQL, DbAdminUsername" >
- </parameter>
-
- <parameter
- name="MySQL Database Administrator Password"
- description="Database administrator password."
- tags="Password,MySQL,DbAdminPassword" >
+ <!-- Read database name from config.php . Update 'dbname' in config.php on publish -->
+ <parameter name="Automatic MySQL Database Name" defaultValue="dbname = '{MySQL Database Name}';" tags="Hidden,MySQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbname\s*=\s*'([^']*)'\s*;" />
</parameter>
<parameter
- name="phpBB Database Username"
+ name="MySQL Database Username"
description="Username to access your phpBB database."
defaultValue="phpbb"
tags="MySQL, DbUsername">
@@ -196,6 +204,10 @@
scope="install/mysql.sql"
match="PlaceHolderForUser" />
</parameter>
+ <!-- Read database user from config.php . Update 'dbuser' in config.php on publish -->
+ <parameter name="Automatic MySQL Database User" defaultValue="dbuser = '{MySQL Database Username}';" tags="Hidden,MySQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbuser\s*=\s*'([^']*)'\s*;" />
+ </parameter>
<parameter
name="MySQL Database Password"
@@ -210,12 +222,30 @@
type="TextFile"
scope="install/mysql.sql"
match="PlaceHolderForPassword" />
+ </parameter>
+ <!-- Read database password from config.php . Update 'dbpasswd' in config.php on publish -->
+ <parameter name="MySQL Automatic Database Password" defaultValue="dbpasswd = '{MySQL Database Password}';" tags="Hidden,MySQL">
+ <parameterEntry kind="TextFile" scope="\\config\.php$" match="dbpasswd\s*=\s*'([^']*)'\s*;" />
+ </parameter>
+
+ <!-- MySQL admin credentials -->
+ <parameter
+ name="MySQL Database Administrator"
+ description="Database administrator username."
+ defaultValue="root"
+ tags="MySQL, DbAdminUsername" >
+ </parameter>
+ <parameter
+ name="MySQL Database Administrator Password"
+ description="Database administrator password."
+ tags="Password,MySQL,DbAdminPassword" >
</parameter>
+ <!-- MySQL Connectionstring -->
<parameter
name="MySQLConnectionString"
description="Automatically sets the connection string for the connection request."
- defaultValue="Server={MySQL Database Server};Database={Application Database Name};uid={MySQL Database Administrator};Pwd={MySQL Database Administrator Password};"
+ defaultValue="Server={MySQL Database Server};Database={MySQL Database Name};uid={MySQL Database Administrator};Pwd={MySQL Database Administrator Password};"
tags="Hidden,MySQLConnectionString,Validate">
<parameterEntry
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
new file mode 100755
index 0000000000..a6777ff9c9
--- /dev/null
+++ b/git-tools/hooks/commit-msg
@@ -0,0 +1,258 @@
+#!/bin/sh
+#
+# A hook to check syntax of a phpBB3 commit message, per:
+# * <http://wiki.phpbb.com/display/DEV/Git>
+# * <http://area51.phpbb.com/phpBB/viewtopic.php?p=209919#p209919>
+#
+# This is a commit-msg hook.
+#
+# To install this you can either copy or symlink it to
+# $GIT_DIR/hooks, example:
+#
+# ln -s ../../git-tools/hooks/commit-msg \\
+# .git/hooks/commit-msg
+
+config_ns="phpbb.hooks.commit-msg";
+
+if [ "$(git config --bool $config_ns.fatal)" = "false" ]
+then
+ fatal=0;
+else
+ fatal=1;
+fi
+
+debug_level=$(git config --int $config_ns.debug || echo 0);
+
+# Error codes
+ERR_LENGTH=1;
+ERR_HEADER=2;
+ERR_EMPTY=3;
+ERR_DESCRIPTION=4;
+ERR_FOOTER=5;
+ERR_EOF=6;
+ERR_UNKNOWN=42;
+
+debug()
+{
+ local level;
+
+ level=$1;
+ shift;
+
+ if [ $debug_level -ge $level ]
+ then
+ echo $@;
+ fi
+}
+
+quit()
+{
+ if [ $1 -gt 0 ] && [ $1 -ne $ERR_UNKNOWN ] && [ $fatal -eq 0 ]
+ then
+ exit 0;
+ else
+ exit $1;
+ fi
+}
+
+msg=$(grep -nE '.{81,}' "$1");
+
+if [ $? -eq 0 ]
+then
+ echo "The following lines are greater than 80 characters long:\n" >&2;
+ echo $msg >&2;
+
+ quit $ERR_LENGTH;
+fi
+
+lines=$(wc -l "$1" | awk '{ print $1; }');
+expecting=header;
+in_description=0;
+in_empty=0;
+ticket=0;
+branch_regex="[a-z]+[a-z0-9-]*[a-z0-9]+";
+i=1;
+tickets="";
+
+while [ $i -le $lines ]
+do
+ # Grab the line we are studying
+ line=$(head -n$i "$1" | tail -n1);
+
+ debug 1 "==> [$i] $line (description: $in_description, empty: $in_empty)";
+
+ err=$ERR_UNKNOWN;
+
+ if [ -z "$expecting" ]
+ then
+ quit $err;
+ fi
+
+ if [ "${expecting#comment}" = "$expecting" ]
+ then
+ # Prefix comments to the expected tokens list
+ expecting="comment $expecting";
+ fi
+
+ debug 2 "Expecting: $expecting";
+
+ # Loop over each of the expected line formats
+ for expect in $expecting
+ do
+ # Reset the error code each iteration
+ err=$ERR_UNKNOWN;
+
+ # Test for validity of each line format
+ # This is done first so $? contains the result
+ case $expect in
+ "header")
+ err=$ERR_HEADER;
+ echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] [A-Z].+$"
+ ;;
+ "empty")
+ err=$ERR_EMPTY;
+ echo "$line" | grep -Eq "^$"
+ ;;
+ "description")
+ err=$ERR_DESCRIPTION;
+ # Free flow text, the line length was constrained by the initial check
+ echo "$line" | grep -Eq "^.+$";
+ ;;
+ "footer")
+ err=$ERR_FOOTER;
+ # Each ticket is on its own line
+ echo "$line" | grep -Eq "^PHPBB3-[0-9]+$";
+ ;;
+ "eof")
+ err=$ERR_EOF;
+ # Should not end up here
+ false
+ ;;
+ "comment")
+ echo "$line" | grep -Eq "^#";
+ ;;
+ *)
+ echo "Unrecognised token $expect" >&2;
+ quit $err;
+ ;;
+ esac
+
+ # Preserve the result of the line check
+ result=$?;
+
+ debug 2 "$expect - '$line' - $result";
+
+ if [ $result -eq 0 ]
+ then
+ # Break out the loop on success
+ # otherwise roll on round and keep looking for a match
+ break;
+ fi
+ done
+
+ if [ $result -eq 0 ]
+ then
+ # Have we switched out of description mode?
+ if [ $in_description -eq 1 ] && [ "$expect" != "description" ] && [ "$expect" != "empty" ] && [ "$expect" != "comment" ]
+ then
+ # Yes, okay we need to backtrace one line and reanalyse
+ in_description=0;
+ i=$(( $i - $in_empty ));
+
+ # Reset the empty counter
+ in_empty=0;
+ continue;
+ fi
+
+ # Successful match, but on which line format
+ case $expect in
+ "header")
+ expecting="empty";
+
+ echo "$line" | grep -Eq "^\[ticket/[0-9]+\]$" && (
+ ticket=$(echo "$line" | sed 's,\[ticket/\([0-9]*\)\].*,\1,');
+ )
+ ;;
+ "empty")
+ # Description might have empty lines as spacing
+ expecting="footer description";
+ in_empty=$(($in_empty + 1));
+
+ if [ $in_description -eq 1 ]
+ then
+ expecting="$expecting empty";
+ fi
+ ;;
+ "description")
+ expecting="description empty";
+ in_description=1;
+ ;;
+ "footer")
+ expecting="footer eof";
+ if [ "$tickets" = "" ]
+ then
+ tickets="$line";
+ else
+ tickets="$tickets $line";
+ fi
+ ;;
+ "comment")
+ # Comments should expect the same thing again
+ ;;
+ *)
+ echo "Unrecognised token $expect" >&2;
+ quit 254;
+ ;;
+ esac
+
+ if [ "$expect" != "empty" ]
+ then
+ in_empty=0;
+ fi
+
+ debug 3 "Now expecting: $expecting";
+ else
+ # None of the expected line formats matched
+ # Guess we'll call it a day here then
+ echo "Syntax error on line $i:" >&2;
+ echo ">> $line" >&2;
+ echo -n "Expecting: " >&2;
+ echo "$expecting" | sed 's/ /, /g' >&2;
+ exit $err;
+ fi
+
+ i=$(( $i + 1 ));
+done
+
+# If EOF is expected exit cleanly
+echo "$expecting" | grep -q "eof" || (
+ # Unexpected EOF, error
+ echo "Unexpected EOF encountered" >&2;
+ quit $ERR_EOF;
+) && (
+ # Do post scan checks
+ if [ ! -z "$tickets" ]
+ then
+ # Check for duplicate tickets
+ dupes=$(echo "$tickets" | sed 's/ /\n/g' | sort | uniq -d);
+
+ if [ ! -z "$dupes" ]
+ then
+ echo "The following tickets are repeated:" >&2;
+ echo "$dupes" | sed 's/ /\n/g;s/^/* /g' >&2;
+ quit $ERR_FOOTER;
+ fi
+ fi
+ # Check the branch ticket is mentioned, doesn't make sense otherwise
+ if [ $ticket -gt 0 ]
+ then
+ echo "$tickets" | grep -Eq "\bPHPBB3-$ticket\b" || (
+ echo "Ticket ID [$ticket] of branch missing from list of tickets:" >&2;
+ echo "$tickets" | sed 's/ /\n/g;s/^/* /g' >&2;
+ quit $ERR_FOOTER;
+ ) || exit $?;
+ fi
+ # Got here okay exit to reality
+ exit 0;
+);
+exit $?;
diff --git a/git-tools/hooks/install b/git-tools/hooks/install
new file mode 100755
index 0000000000..a42c55a769
--- /dev/null
+++ b/git-tools/hooks/install
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Script to install the git hooks
+# by symlinking them into the .git/hooks directory
+#
+# Usage (from within git-tools/hooks):
+# ./install
+
+dir=$(dirname $0)
+
+for file in $(ls $dir)
+do
+ if [ $file != "install" ] && [ $file != "uninstall" ]
+ then
+ ln -s "../../git-tools/hooks/$file" "$dir/../../.git/hooks/$file"
+ fi
+done
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit
index 9719b91746..4d03359773 100755
--- a/git-tools/hooks/pre-commit
+++ b/git-tools/hooks/pre-commit
@@ -27,6 +27,13 @@ fi
error=0
errors=""
+if ! which $PHP_BIN >/dev/null 2>&1
+then
+ echo "PHP Syntax check failed:"
+ echo "PHP binary does not exist or is not in path: $PHP_BIN"
+ exit 1
+fi
+
# dash does not support $'\n':
# http://forum.soft32.com/linux2/Bug-409179-DASH-Settings-IFS-work-properly-ftopict70039.html
IFS='
diff --git a/git-tools/hooks/prepare-commit-msg b/git-tools/hooks/prepare-commit-msg
index 033cb187c7..2bf25e58a4 100755
--- a/git-tools/hooks/prepare-commit-msg
+++ b/git-tools/hooks/prepare-commit-msg
@@ -30,5 +30,13 @@ branch="$(echo "$branch" | sed "s/refs\/heads\///g")"
# * also make sure the branch name begins with bug/ or feature/
if [ "$2" = "" ]
then
- echo "[$branch] $(cat "$1")" > "$1"
+ tail="";
+
+ # Branch is prefixed with 'ticket/', append ticket ID to message
+ if [ "$branch" != "${branch##ticket/}" ];
+ then
+ tail="\n\nPHPBB3-${branch##ticket/}";
+ fi
+
+ echo "[$branch]$tail $(cat "$1")" > "$1"
fi
diff --git a/git-tools/hooks/uninstall b/git-tools/hooks/uninstall
new file mode 100755
index 0000000000..1b3b7fd2c9
--- /dev/null
+++ b/git-tools/hooks/uninstall
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Script to uninstall the git hooks
+#
+# Usage (from within git-tools/hooks):
+# ./uninstall
+
+dir=$(dirname $0)
+
+for file in $(ls $dir)
+do
+ if [ $file != "install" ] && [ $file != "uninstall" ]
+ then
+ rm -f "$dir/../../.git/hooks/$file"
+ fi
+done
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 26f934f6bf..92bcf90039 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -432,6 +432,20 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
{
$error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]);
}
+
+ if (strpos($config_name, '_max') !== false)
+ {
+ // Min/max pairs of settings should ensure that min <= max
+ // Replace _max with _min to find the name of the minimum
+ // corresponding configuration variable
+ $min_name = str_replace('_max', '_min', $config_name);
+
+ if (isset($cfg_array[$min_name]) && is_numeric($cfg_array[$min_name]) && $cfg_array[$config_name] < $cfg_array[$min_name])
+ {
+ // A minimum value exists and the maximum value is less than it
+ $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], (int) $cfg_array[$min_name]);
+ }
+ }
break;
// Absolute path
@@ -533,7 +547,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
// Check if the path is writable
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
{
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
+ if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !phpbb_is_writable($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
}
diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html
index 539e8032dd..cf44f4aaa7 100644
--- a/phpBB/adm/style/acp_ban.html
+++ b/phpBB/adm/style/acp_ban.html
@@ -31,9 +31,9 @@
function display_details(option)
{
- document.getElementById('acp_unban').unbangivereason.value = ban_give_reason[option];
- document.getElementById('acp_unban').unbanreason.value = ban_reason[option];
- document.getElementById('acp_unban').unbanlength.value = ban_length[option];
+ document.getElementById('acp_unban').unbangivereason.innerHTML = ban_give_reason[option];
+ document.getElementById('acp_unban').unbanreason.innerHTML = ban_reason[option];
+ document.getElementById('acp_unban').unbanlength.innerHTML = ban_length[option];
}
// ]]>
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 9f9216a068..d27cea28f7 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -58,7 +58,7 @@
/**
* Init the wanted display functionality if javascript is enabled.
- * If javascript is not available, the user is still able to properly administrate.
+ * If javascript is not available, the user is still able to properly administer.
*/
onload = function()
{
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index 5bde4008ad..cb4361dd6f 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -77,7 +77,7 @@
/**
* Init the wanted display functionality if javascript is enabled.
- * If javascript is not available, the user is still able to properly administrate.
+ * If javascript is not available, the user is still able to properly administer.
*/
onload = function()
{
diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html
index 34d4f6934e..a87366a78b 100644
--- a/phpBB/adm/style/acp_update.html
+++ b/phpBB/adm/style/acp_update.html
@@ -18,6 +18,12 @@
</div>
<!-- ENDIF -->
+ <!-- IF NEXT_FEATURE_VERSION -->
+ <div class="errorbox">
+ <p>{UPGRADE_INSTRUCTIONS}</p>
+ </div>
+ <!-- ENDIF -->
+
<fieldset>
<legend></legend>
<dl>
diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html
index 6317a375b4..69c6d8f3fb 100644
--- a/phpBB/adm/style/acp_users_signature.html
+++ b/phpBB/adm/style/acp_users_signature.html
@@ -56,7 +56,7 @@
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
- <input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
+ <input type="button" class="button2" accesskey="y" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 5f1f01c0a9..4c3fa51af3 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -670,14 +670,10 @@ legend {
position: relative;
text-transform: none;
line-height: 1.2em;
- top: 0;
+ top: -.2em;
vertical-align: middle;
}
-/* Hide from macIE \*/
-legend { top: -1.2em; }
-/* end */
-
* html legend {
margin: 0 0 -10px -7px;
line-height: 1em;
diff --git a/phpBB/adm/style/captcha_recaptcha.html b/phpBB/adm/style/captcha_recaptcha.html
index 702a4a1099..d3038fd714 100644
--- a/phpBB/adm/style/captcha_recaptcha.html
+++ b/phpBB/adm/style/captcha_recaptcha.html
@@ -4,7 +4,8 @@
<script type="text/javascript">
// <![CDATA[
var RecaptchaOptions = {
- lang : '{LA_RECAPTCHA_LANG}'
+ lang : '{LA_RECAPTCHA_LANG}',
+ theme : 'clean'
};
// ]]>
</script>
diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js
index 7e3ce1c708..217aa699e2 100644
--- a/phpBB/adm/style/editor.js
+++ b/phpBB/adm/style/editor.js
@@ -46,7 +46,11 @@ function initInsertions()
{
textarea.focus();
baseHeight = doc.selection.createRange().duplicate().boundingHeight;
- // document.body.focus();
+
+ if (!document.forms[form_name])
+ {
+ document.body.focus();
+ }
}
}
@@ -230,6 +234,7 @@ function addquote(post_id, username)
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');
+ theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
}
else if (document.all)
{
@@ -273,8 +278,8 @@ function mozWrap(txtarea, open, close)
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
- txtarea.selectionStart = selEnd + open.length + close.length;
- txtarea.selectionEnd = txtarea.selectionStart;
+ txtarea.selectionStart = selStart + open.length;
+ txtarea.selectionEnd = selEnd + open.length;
txtarea.focus();
txtarea.scrollTop = scrollTop;
@@ -327,8 +332,8 @@ function colorPalette(dir, width, height)
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td bgcolor="#' + color + '">');
- document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');" onmouseout="helpline(\'tip\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
+ document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
+ document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}
diff --git a/phpBB/common.php b/phpBB/common.php
index 9b6913e95f..c8b2fb9609 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -123,13 +123,11 @@ if (defined('IN_CRON'))
$phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
}
-if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
+if (file_exists($phpbb_root_path . 'config.' . $phpEx))
{
- die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
+ require($phpbb_root_path . 'config.' . $phpEx);
}
-require($phpbb_root_path . 'config.' . $phpEx);
-
if (!defined('PHPBB_INSTALLED'))
{
// Redirect the user to the installer
diff --git a/phpBB/config.php b/phpBB/config.php
deleted file mode 100644
index e69de29bb2..0000000000
--- a/phpBB/config.php
+++ /dev/null
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php
new file mode 100644
index 0000000000..b0fa399209
--- /dev/null
+++ b/phpBB/develop/check_flash_bbcodes.php
@@ -0,0 +1,163 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id$
+* @copyright (c) 2009, 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* This script will check your database for potentially dangerous flash BBCode tags
+*/
+
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it\n");
+
+/**
+*/
+define('IN_PHPBB', true);
+$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+include($phpbb_root_path . 'common.' . $phpEx);
+
+if (php_sapi_name() != 'cli')
+{
+ header('Content-Type: text/plain');
+}
+
+check_table_flash_bbcodes(POSTS_TABLE, 'post_id', 'post_text', 'bbcode_uid', 'bbcode_bitfield');
+check_table_flash_bbcodes(PRIVMSGS_TABLE, 'msg_id', 'message_text', 'bbcode_uid', 'bbcode_bitfield');
+check_table_flash_bbcodes(USERS_TABLE, 'user_id', 'user_sig', 'user_sig_bbcode_uid', 'user_sig_bbcode_bitfield');
+check_table_flash_bbcodes(FORUMS_TABLE, 'forum_id', 'forum_desc', 'forum_desc_uid', 'forum_desc_bitfield');
+check_table_flash_bbcodes(FORUMS_TABLE, 'forum_id', 'forum_rules', 'forum_rules_uid', 'forum_rules_bitfield');
+check_table_flash_bbcodes(GROUPS_TABLE, 'group_id', 'group_desc', 'group_desc_uid', 'group_desc_bitfield');
+
+echo "If potentially dangerous flash bbcodes were found, please reparse the posts using the Support Toolkit (http://www.phpbb.com/support/stk/) and/or file a ticket in the Incident Tracker (http://www.phpbb.com/incidents/).\n";
+
+function check_table_flash_bbcodes($table_name, $id_field, $content_field, $uid_field, $bitfield_field)
+{
+ echo "Checking $content_field on $table_name\n";
+
+ $ids = get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field);
+
+ $size = sizeof($ids);
+ if ($size)
+ {
+ echo "Found $size potentially dangerous flash bbcodes.\n";
+ echo "$id_field: " . implode(', ', $ids) . "\n";
+ }
+ else
+ {
+ echo "No potentially dangerous flash bbcodes found.\n";
+ }
+
+ echo "\n";
+}
+
+function get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field)
+{
+ global $db;
+
+ $ids = array();
+
+ $sql = "SELECT $id_field, $content_field, $uid_field, $bitfield_field
+ FROM $table_name
+ WHERE $content_field LIKE '%[/flash:%'
+ AND $bitfield_field <> ''";
+
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $uid = $row[$uid_field];
+
+ // thanks support toolkit
+ $content = html_entity_decode_utf8($row[$content_field]);
+ set_var($content, $content, 'string', true);
+ $content = utf8_normalize_nfc($content);
+
+ $bitfield_data = $row[$bitfield_field];
+
+ if (!is_valid_flash_bbcode($content, $uid) && has_flash_enabled($bitfield_data))
+ {
+ $ids[] = (int) $row[$id_field];
+ }
+ }
+ $db->sql_freeresult($result);
+
+ return $ids;
+}
+
+function get_flash_regex($uid)
+{
+ return "#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#";
+}
+
+// extract all valid flash bbcodes
+// check if the bbcode content is a valid URL for each match
+function is_valid_flash_bbcode($cleaned_content, $uid)
+{
+ $regex = get_flash_regex($uid);
+
+ $url_regex = get_preg_expression('url');
+ $www_url_regex = get_preg_expression('www_url');
+
+ if (preg_match_all($regex, $cleaned_content, $matches))
+ {
+ foreach ($matches[3] as $flash_url)
+ {
+ if (!preg_match("#^($url_regex|$www_url_regex)$#i", $flash_url))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+// check if a bitfield includes flash
+// 11 = flash bit
+function has_flash_enabled($bitfield_data)
+{
+ $bitfield = new bitfield($bitfield_data);
+ return $bitfield->get(11);
+}
+
+// taken from support toolkit
+function html_entity_decode_utf8($string)
+{
+ static $trans_tbl;
+
+ // replace numeric entities
+ $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf8(hexdec("\\1"))', $string);
+ $string = preg_replace('~&#([0-9]+);~e', 'code2utf8(\\1)', $string);
+
+ // replace literal entities
+ if (!isset($trans_tbl))
+ {
+ $trans_tbl = array();
+
+ foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key)
+ $trans_tbl[$key] = utf8_encode($val);
+ }
+ return strtr($string, $trans_tbl);
+}
+
+// taken from support toolkit
+// Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
+function code2utf8($num)
+{
+ if ($num < 128) return chr($num);
+ if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
+ if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
+ if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
+ return '';
+}
diff --git a/phpBB/develop/set_permissions.sh b/phpBB/develop/set_permissions.sh
new file mode 100755
index 0000000000..879b94e518
--- /dev/null
+++ b/phpBB/develop/set_permissions.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# set permissions required for installation
+
+dir=$(dirname $0)
+
+for file in cache files store config.php images/avatars/upload
+do
+ chmod a+w $dir/../$file
+done
diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS
index 84677c4e15..b3166313c3 100644
--- a/phpBB/docs/AUTHORS
+++ b/phpBB/docs/AUTHORS
@@ -26,8 +26,8 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody)
Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
APTX (Marek A. R.)
bantu (Andreas Fischer)
- DavidMJ (David M.)
dhn (Dominik Dröscher)
+ igorw (Igor Wiedler)
kellanved (Henry Sudhof)
nickvergessen (Joas Schilling)
rxu (Ruslan Uzdenov)
@@ -49,6 +49,7 @@ phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005]
phpBB Developers: Ashe (Ludovic Arnaud) [10/2002 - 11/2003, 06/2006 - 10/2006]
BartVB (Bart van Bragt) [11/2000 - 03/2006]
+ DavidMJ (David M.) [12/2005 - 08/2009]
GrahamJE (Graham Eames) [09/2005 - 11/2006]
Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 36dc3d037c..66915b18fa 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -53,7 +53,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
- <li><a href="#v307">Changes since 3.0.7-PL1</a></li>
+ <li><a href="#v307-PL1">Changes since 3.0.7-PL1</a></li>
<li><a href="#v307">Changes since 3.0.7</a></li>
<li><a href="#v306">Changes since 3.0.6</a></li>
<li><a href="#v305">Changes since 3.0.5</a></li>
@@ -89,42 +89,471 @@
<div class="content">
- <a name="v307-pl1"></a><h3>1.i. Changes since 3.0.7-PL1</h3>
-
- <ul>
- <li>[Fix] Correctly sort database backup file list by date on database restore page. (Bug #57385)</li>
- <li>[Fix] Take admin's time zone settings into account when listing database backup files. (Bug #57385)</li>
- <li>[Fix] Honor minimum and maximum password length in generated passwords as much as we can. (Bug #13181)</li>
- <li>[Fix] No longer return the character O in generated random strings and passwords. (Bug #57345)</li>
- <li>[Fix] Allow redirect() function to redirect across directories. (Bug #56965)</li>
- <li>[Fix] Add terminating semicolons to JavaScript code. (Bug #58085 - Patch by nn-)</li>
- <li>[Fix] Minor language fixes. (Bug #54855)</li>
- <li>[Fix] Parsing urls in signatures properly uses config settings. (Bug #57105)</li>
- <li>[Fix] Allow multibyte keys in request_var(). (Bug #51555)</li>
- <li>[Fix] Fix inclusion check for captcha garbage collection (Bug #59425)</li>
- <li>[Fix] Prevent wrong tar archive type detection. (Bug #12531)</li>
- <li>[Fix] Correct redirection after login to forum not in web root (Bug #58755)</li>
- <li>[Fix] Allow setting parent forums regardless of permission settings. (Bug #57415)</li>
- <li>[Fix] Redirect search engines that access pages with SIDs in the URL. (Bug #58025)</li>
- <li>[Fix] Fix incorrect ampersand encoding in redirect parameter. (Bug #58465)</li>
- <li>[Fix] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135)</li>
- <li>[Fix] Fix table binding issues with PostgreSQL in board-wide feed. (Bug #58425)</li>
- <li>[Fix] Only show unapproved posts in ATOM Feeds for moderators (Bug #58695)</li>
- <li>[Fix] Various XHTML mistakes in ACP (Bug #58745)</li>
- <li>[Fix] Fix dead link in MCP on reports for global announcements in prosilver. (Bug #9512)</li>
- <li>[Fix] Fix broken links for reports on active topics, when the topic is in a subforum. (Bug #9047)</li>
- <li>[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)</li>
- <li>[Feature] The memcache acm plugin now supports multiple memcache servers.</li>
- <li>[Feature] Show note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed (Bug #9511)</li>
- </ul>
-
- <a name="v307"></a><h3>1.i. Changes since 3.0.7</h3>
+ <a name="v307-PL1"></a><h3>1.i. Changes since 3.0.7-PL1</h3>
+<h4> Security
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9903'>PHPBB3-9903</a>] - Execute javascript in [flash=] BBCode
+</li>
+</ul>
+
+<h4> Bug
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-4923'>PHPBB3-4923</a>] - compress_tar incorrectly determines type
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-5164'>PHPBB3-5164</a>] - Honor minimum and maximum password length in generated passwords as much as possible.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-6726'>PHPBB3-6726</a>] - Connecting to PostgreSQL using &#39;localhost&#39; doesn&#39;t try to use a TCP connection
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-6747'>PHPBB3-6747</a>] - word censoring * does not handle space for two or more words
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7260'>PHPBB3-7260</a>] - Do not delete polls if one exists and editing user lacks permissions
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7296'>PHPBB3-7296</a>] - Style export to tar(.*) does not work
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7369'>PHPBB3-7369</a>] - Custom Profile dates display incorrectly
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7417'>PHPBB3-7417</a>] - Search keywords field does not initially get focus
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7538'>PHPBB3-7538</a>] - Query exceeds maximum value for user_login_attempts
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7716'>PHPBB3-7716</a>] - Data too long for column &#39;message_subject&#39;
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7720'>PHPBB3-7720</a>] - Fix alternative image-description for unread posts.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7782'>PHPBB3-7782</a>] - Send HTTP 404 if topic, forum or user do not exist
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7972'>PHPBB3-7972</a>] - Copied topics are not indexed
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8169'>PHPBB3-8169</a>] - Parse CSS Regex accepts invalid code
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8792'>PHPBB3-8792</a>] - Misleading error message in auth_ldap.php, function init_ldap()
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8894'>PHPBB3-8894</a>] - JavaScript error and visible quote button on topic review if BBCodes disallowed
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8924'>PHPBB3-8924</a>] - spelling in admin_welcome_inactive.txt
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8929'>PHPBB3-8929</a>] - MS SQL error on view all smilies after 3.0.6 upgrade
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8935'>PHPBB3-8935</a>] - able to set minimal avatar size larger than maximum
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8944'>PHPBB3-8944</a>] - Error on database update (must specify size of index on MySQL4)
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9012'>PHPBB3-9012</a>] - Retain original topic title in shadow topic when moving a topic and editing the title.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9034'>PHPBB3-9034</a>] - Redirect() fails with directory traversal
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9047'>PHPBB3-9047</a>] - Active topics and reported posts
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9049'>PHPBB3-9049</a>] - Password reminder system generates confusable passwords
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9053'>PHPBB3-9053</a>] - Correctly sort database backup file list by date on database restore page
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9061'>PHPBB3-9061</a>] - Race condition in queue locking
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9068'>PHPBB3-9068</a>] - Grammatical Error under Load Settings
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9075'>PHPBB3-9075</a>] - Missing / bad default values of CPFs result in SQL errors on registration of new users
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9091'>PHPBB3-9091</a>] - Wrong IP checking for IPv4 addresses mapped into IPv6
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9094'>PHPBB3-9094</a>] - Hide &quot;Copy permissions&quot; message, when permissions were copied.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9095'>PHPBB3-9095</a>] - Misleading setting text for CAPTCHA
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9099'>PHPBB3-9099</a>] - Missing comma in PASSWORD_EXPLAIN acp language strings
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9101'>PHPBB3-9101</a>] - Bad text placement for reCAPTCHA description
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9104'>PHPBB3-9104</a>] - Safari does not display box headers correctly in the ACP.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9107'>PHPBB3-9107</a>] - Can&#39;t Set Parent Forum
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9108'>PHPBB3-9108</a>] - RSS feeds does not work on Postgres
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9112'>PHPBB3-9112</a>] - Most active forum post count does not respect m_approve permission
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9114'>PHPBB3-9114</a>] - Recent bug fix for smilies causing problems on older MySQL versions
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9117'>PHPBB3-9117</a>] - Wrong redirection after login
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9119'>PHPBB3-9119</a>] - Language selection is disregarded in automatic update
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9120'>PHPBB3-9120</a>] - Typo fix in a comment in functions.php
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9121'>PHPBB3-9121</a>] - Forum feed shows posts that are currently on the moderation queue
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9125'>PHPBB3-9125</a>] - ACP User Overview: Unmatched &lt;/form&gt; tag when viewing own user
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9126'>PHPBB3-9126</a>] - Invalid redirection after login to forum not in web root
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9132'>PHPBB3-9132</a>] - Oracle CLOB support is broken, preventing storage of long strings
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9135'>PHPBB3-9135</a>] - Fix report-icon for moderators in PM folders.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9140'>PHPBB3-9140</a>] - Check current board version in incremental update packages
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9145'>PHPBB3-9145</a>] - Fix open_basedir issues when accessing styles- and language-management
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9146'>PHPBB3-9146</a>] - Quick-Reply tabindex=&quot;6&quot; set twice
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9147'>PHPBB3-9147</a>] - &quot;Change topic type&quot;-option &quot;Normal&quot; always selected.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9154'>PHPBB3-9154</a>] - Correctly check for double inclusion in captcha garbage collection
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9158'>PHPBB3-9158</a>] - viewforum/viewtopic pages unnecessarily duplicated with start=0
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9162'>PHPBB3-9162</a>] - BBCode in poll options is broken, when posting without question.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9167'>PHPBB3-9167</a>] - Remove shadow topics from remaining forums when deleting a forum including posts
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9170'>PHPBB3-9170</a>] - Unable to get image size in img bbcode when URL has multiple parameters.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9173'>PHPBB3-9173</a>] - sql_config_count() artificially limits number scope to 4byte-integer on PostgreSQL and Firebird
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9176'>PHPBB3-9176</a>] - When setting the board&#39;s date format the board&#39;s timezone settings aren&#39;t taken into account
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9451'>PHPBB3-9451</a>] - Unnecessary overhead in avatar_process_user function
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9478'>PHPBB3-9478</a>] - Validate maximum number of allowed recipients per PM value
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9495'>PHPBB3-9495</a>] - Loginbox &lt;input /&gt; redirect breaks xHTML
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9499'>PHPBB3-9499</a>] - Javascript function dE does not correctly detect element visibility
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9504'>PHPBB3-9504</a>] - Allow gallery avatars with whitespaces in the filename
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9509'>PHPBB3-9509</a>] - phpBB Coding Guidelines state subversion as the version control system for phpBB
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9510'>PHPBB3-9510</a>] - Unable to copy permissions from and to forums you cannot see
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9512'>PHPBB3-9512</a>] - Fix dead link in MCP on reports for global announcements in prosilver.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9514'>PHPBB3-9514</a>] - Correctly delete big datasets when deleting a forum including topics/posts on non-MySQL databases
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9518'>PHPBB3-9518</a>] - Postgres DBAL does not correctly create a new database connection when passing $new_link as true
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9519'>PHPBB3-9519</a>] - Replace remaining is_writable() calls with phpbb_is_writable().
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9521'>PHPBB3-9521</a>] - MSSQL error reporting returns String instead of an error
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9524'>PHPBB3-9524</a>] - IPv6 regular expression does not match addresses starting in ::
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9526'>PHPBB3-9526</a>] - User Preference to hide online status does not work for bots
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9528'>PHPBB3-9528</a>] - Quoting in a PM does not fall back to bbcode-less quotes using &quot;&gt; &quot; when bbcodes are disabled
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9529'>PHPBB3-9529</a>] - Topic review does not display all selected posts
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9530'>PHPBB3-9530</a>] - subsilver2 missing fallback option on quoting when bbcodes are disabled
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9531'>PHPBB3-9531</a>] - BBCode-less fall back option for quotes is missing &quot;Author wrote:&quot; line when quoting from topic-review.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9535'>PHPBB3-9535</a>] - Incorrect margins in RTL languages: signatures, permission ACP &amp; updater
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9545'>PHPBB3-9545</a>] - &#39;Your first forum&#39; should have &#39;Display active topics:&#39; set to &#39;Yes&#39;
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9546'>PHPBB3-9546</a>] - Moving all posts from one topic to another does not delete bookmarks
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9547'>PHPBB3-9547</a>] - Changing forum type applies FORUM_FLAG_ACTIVE_TOPICS to new forum type.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9548'>PHPBB3-9548</a>] - Delete user quicktool drop down should have an empty or invalid selection as the default
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9559'>PHPBB3-9559</a>] - Messenger Queue Batch Size configuration option is overridden
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9567'>PHPBB3-9567</a>] - Newly registered users group ACP wording
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9582'>PHPBB3-9582</a>] - Missing MSSQL native driver case statements
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9587'>PHPBB3-9587</a>] - Prosilver overrides reCaptcha class.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9592'>PHPBB3-9592</a>] - Test suite does not run on SQLite
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9593'>PHPBB3-9593</a>] - Missing documentation for running unit tests
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9599'>PHPBB3-9599</a>] - Windows workaround for checkdnsrr() returns wrong results
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9605'>PHPBB3-9605</a>] - Wrong class added to topiclist, when there&#39;s no announcement topic.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9615'>PHPBB3-9615</a>] - When attaching a file whose name contains quotes, filename before last quote is cut off in display
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9623'>PHPBB3-9623</a>] - Strings not properly normalized - acp_prune.php
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9626'>PHPBB3-9626</a>] - Regular expressions from get_preg_expression() are untested.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9628'>PHPBB3-9628</a>] - Add module function does not correctly insert a module after the specified one
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9633'>PHPBB3-9633</a>] - Newly registered users group color is not used in Our Newest Member
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9635'>PHPBB3-9635</a>] - Useless parameter $data[&#39;post_time&#39;] in function submit_post.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9637'>PHPBB3-9637</a>] - SET NAMES &#39;BINARY&#39; error in convertor
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9643'>PHPBB3-9643</a>] - DB connection error when $dbhost is an IPv6 address
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9644'>PHPBB3-9644</a>] - submit_post shows support for options that cause a trigger_error in the call to user_notification
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9646'>PHPBB3-9646</a>] - Cant hide/outcomment @import in stylesheet.css
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9650'>PHPBB3-9650</a>] - It should not be possible to ban Anonymous
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9653'>PHPBB3-9653</a>] - xhtml errors in subsilver2 when using the bbcodes code and quote in signatures
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9655'>PHPBB3-9655</a>] - Selecting an unavailable captcha plugin looks like a successful action
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9656'>PHPBB3-9656</a>] - PHP Information in ACP always lists error_reporting as 0
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9658'>PHPBB3-9658</a>] - Optimize topic splitting
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9662'>PHPBB3-9662</a>] - Search interval applied inconsistently
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9664'>PHPBB3-9664</a>] - Another duplicate accesskey: t = top and list item
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9665'>PHPBB3-9665</a>] - Signature &quot;0&quot; cannot be previewed
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9677'>PHPBB3-9677</a>] - Subsilver2 is missing the bbcode-helpline for inline-attachments.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9678'>PHPBB3-9678</a>] - Flash attachments are not displayed in subsilver2.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9679'>PHPBB3-9679</a>] - &quot;Notify User&quot; checkbox appears in MCP Queue even if no notification methods are enabled
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9686'>PHPBB3-9686</a>] - Unable to create data backup using the mssqlnative DBAL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9694'>PHPBB3-9694</a>] - Calling download/file.php with empty avatar parameter can throw an E_NOTICE message
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9695'>PHPBB3-9695</a>] - Bad Display of User Input - mcp_ban
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9696'>PHPBB3-9696</a>] - Installation of phpBB with SQLite fails
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9697'>PHPBB3-9697</a>] - Backlink broken when the select parent forum does not exist.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9698'>PHPBB3-9698</a>] - Returning result of new by reference is deprecated in php 5.3
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9702'>PHPBB3-9702</a>] - &quot;Ban until (date)&quot; appears to be based on UTC time instead of local time
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9703'>PHPBB3-9703</a>] - Removing a user does not remove their private message folders or rules
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9704'>PHPBB3-9704</a>] - Coding guidelines typo
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9712'>PHPBB3-9712</a>] - Future dates display as &quot;less than one minute ago&quot;
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9714'>PHPBB3-9714</a>] - &quot;Undefined variable: email&quot; in email regular expression unit tests
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9715'>PHPBB3-9715</a>] - Fix email address regular expression or adjust email regular expression unit tests
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9722'>PHPBB3-9722</a>] - &quot;New Topic&quot; button title attribute mismatch in prosilver&#39;s viewforum
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9727'>PHPBB3-9727</a>] - Feed replaces ./ with board URL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9743'>PHPBB3-9743</a>] - Fix background-position of top2-class in prosilver for RTL-languages.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9744'>PHPBB3-9744</a>] - Mistyped word &#39;then&#39; in FAQ. It should be &#39;than&#39;.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9748'>PHPBB3-9748</a>] - &lt;br /&gt; not being replaced in prepare_message
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9749'>PHPBB3-9749</a>] - fulltext_mysql.php overreacts on + and - characters in search words
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9752'>PHPBB3-9752</a>] - Misleading text when using Q&amp;A CAPTCHA
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9754'>PHPBB3-9754</a>] - Template variable S_USER_POSTED always set to false in search.php
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9757'>PHPBB3-9757</a>] - Empty template variable HISTORY_TITLE in ucp_pm_history
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9760'>PHPBB3-9760</a>] - Fulltext native search, wildcard * does not get escaped leading to long execution time
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9761'>PHPBB3-9761</a>] - Quote nesting depth explanation is misleading
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9771'>PHPBB3-9771</a>] - build_url() doesn&#39;t ignore empty parameters
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9772'>PHPBB3-9772</a>] - Under some circumstances, email addresses are shown to undesired users
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9780'>PHPBB3-9780</a>] - gen_rand_string() not respecting $num_chars parameter anymore.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9782'>PHPBB3-9782</a>] - Board disable radio in Board-Settings set on when server load high
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9793'>PHPBB3-9793</a>] - Undefined function send_status_line() in download/file.php when in avatar mode.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9807'>PHPBB3-9807</a>] - Avatar tab displays when avatars are disabled
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9810'>PHPBB3-9810</a>] - Clicking on &quot;Select All&quot; of code tag on print page results in a javascript error when using prosilver
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9820'>PHPBB3-9820</a>] - Fix undefined indexes when trying to post a new topic
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9822'>PHPBB3-9822</a>] - Can not delete style-components from the file-system as per explanation.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9829'>PHPBB3-9829</a>] - Recaptcha plugin result interpretation fault
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9835'>PHPBB3-9835</a>] - Login Confirm Explain Not Working
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9840'>PHPBB3-9840</a>] - Display view unread posts link for guests
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9841'>PHPBB3-9841</a>] - Change &quot;Save&quot; button to &quot;Save draft&quot;
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9847'>PHPBB3-9847</a>] - Language typo and written form (British/American)
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9854'>PHPBB3-9854</a>] - Auth API documentation is incomplete
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9855'>PHPBB3-9855</a>] - Tests don&#39;t run on PHPUnit 3.5
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9879'>PHPBB3-9879</a>] - captcha_qa.php spelling, punctuation and grammar errors
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9883'>PHPBB3-9883</a>] - CAPTCHA uses american english
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9884'>PHPBB3-9884</a>] - Massive email delays
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9885'>PHPBB3-9885</a>] - Default file extension groups not properly updated by database updater.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9886'>PHPBB3-9886</a>] - Database updater does not run on PostgreSQL because of an error in _add_module()
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9888'>PHPBB3-9888</a>] - Update fails when Bing [Bot] was already added to the users table
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9891'>PHPBB3-9891</a>] - Updater drops language-selection after database-update
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9509'>PHPBB3-9509</a>] - phpBB Coding Guidelines state subversion as the version control system for phpBB
+</li>
+</ul>
+
+<h4> Improvement
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7332'>PHPBB3-7332</a>] - MCP post details usability
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-7717'>PHPBB3-7717</a>] - Use user&#39;s language for standard-extensions-group name
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8709'>PHPBB3-8709</a>] - Multibyte keys in request_var not possible
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-8936'>PHPBB3-8936</a>] - subsilver2 missing reply-to-all feature
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9088'>PHPBB3-9088</a>] - Add missing semicolons in js files
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9179'>PHPBB3-9179</a>] - improve quasi-documentation of notify_status values
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9503'>PHPBB3-9503</a>] - Posts with empty titles in moderation queue are not easily approved
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9534'>PHPBB3-9534</a>] - user_ipwhois() does not support IPv6 addresses
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9536'>PHPBB3-9536</a>] - Small improvement for query against sessions table in acp_users.php
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9553'>PHPBB3-9553</a>] - Make git hooks run with /bin/sh instead of bash
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9570'>PHPBB3-9570</a>] - Change &quot;system timezone&quot; to &quot;guest timezone&quot; in acp, add explanation
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9578'>PHPBB3-9578</a>] - ACP Posting tab is missing &quot;Post settings&quot; module.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9589'>PHPBB3-9589</a>] - Sample nginx configuration file
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9595'>PHPBB3-9595</a>] - Search settings in ACP: Add information on minimum word size indexed when using Fulltext MySQL backend
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9598'>PHPBB3-9598</a>] - Call checkdnsrr() on Windows with PHP 5.3
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9609'>PHPBB3-9609</a>] - Use send_status_line instead of calling header
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9611'>PHPBB3-9611</a>] - Increase entropy in activation keys
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9612'>PHPBB3-9612</a>] - Split gen_rand_string() into gen_rand_string() and gen_rand_string_friendly()
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9629'>PHPBB3-9629</a>] - sid parameter forced for style.php makes caching difficult
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9659'>PHPBB3-9659</a>] - Default phpBB signature user_options need to be set for convertors
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9690'>PHPBB3-9690</a>] - MSN Bot will become Bing Bot
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9777'>PHPBB3-9777</a>] - Print useful error message in pre-commit hook when php is not installed.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9785'>PHPBB3-9785</a>] - Not able to recover a password when board disabled
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9825'>PHPBB3-9825</a>] - Run tests on sqlite if available and no test db configured
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9827'>PHPBB3-9827</a>] - IE9 Beta fixes IE8 textarea bug
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9830'>PHPBB3-9830</a>] - Awkward message when config.php is missing
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9850'>PHPBB3-9850</a>] - Allow version checker to display information on multiple releases
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9853'>PHPBB3-9853</a>] - Change default reCAPTCHA theme in Prosilver &amp; Subsilver2 to better coordinate with style color scheme
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9880'>PHPBB3-9880</a>] - Rename all mentions of CAPTCHA or visual confirmation to anti-bot
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9899'>PHPBB3-9899</a>] - Change the style in the ACP for the recaptcha to match that displayed on prosilver
+</li>
+</ul>
+
+<h4> New Feature
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9039'>PHPBB3-9039</a>] - Native SQL Server Support mssqlnative.php
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9511'>PHPBB3-9511</a>] - View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed.
+</li>
+</ul>
+
+<h4> Task
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9520'>PHPBB3-9520</a>] - Add web.config files for IIS
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9625'>PHPBB3-9625</a>] - Update database UNIT-test
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9701'>PHPBB3-9701</a>] - Enable notices in unit tests
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9768'>PHPBB3-9768</a>] - Create git commit-msg hook that verifies the commit message conforms to our standards
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9769'>PHPBB3-9769</a>] - Add install and uninstall scripts for the git hooks
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9770'>PHPBB3-9770</a>] - Git commit message should be prefilled with branch and ticket information
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9800'>PHPBB3-9800</a>] - Update tracker URL in docs/README.html
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9804'>PHPBB3-9804</a>] - Update docs/AUTHORS (DavidMJ &amp; igorw)
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9808'>PHPBB3-9808</a>] - Git commit message hook depends on GNU wc
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9816'>PHPBB3-9816</a>] - Remove config.php from git repository
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9848'>PHPBB3-9848</a>] - Add phpBB data files to .gitignore.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9849'>PHPBB3-9849</a>] - Create build script using phing
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9857'>PHPBB3-9857</a>] - Remove visible $Id$ from docs files.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9868'>PHPBB3-9868</a>] - Make the test suite run and pass using the mssqlnative driver
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9904'>PHPBB3-9904</a>] - Update WebPI Parameters.xml
+</li>
+</ul>
+
+<h4> Sub-task
+</h4>
+<ul>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9517'>PHPBB3-9517</a>] - Remote avatar upload does not check the filesize before and during transfer.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9562'>PHPBB3-9562</a>] - Advanced Search is inaccessible using the mssqlnative DBAL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9564'>PHPBB3-9564</a>] - Reported messages are not assigned the default report reason when a reason is removed from the ACP using the mssqlnative DBAL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9565'>PHPBB3-9565</a>] - It is impossible to create a custom profile field using the mssqlnative DBAL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9566'>PHPBB3-9566</a>] - Two debug notices are displayed when setting a custom profile field though the UCP using the mssqlnative DBAL
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9583'>PHPBB3-9583</a>] - MSSQL native backups cannot be restored
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9606'>PHPBB3-9606</a>] - Drop redundant SQL query for unreads fetching
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9613'>PHPBB3-9613</a>] - Implement a load switch for unreads search feature.
+</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9817'>PHPBB3-9817</a>] - Make build script create blank config.php
+</li>
+</ul>
+
+
+ <a name="v307"></a><h3>1.ii. 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.ii. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>1.iii. 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>
@@ -228,7 +657,7 @@
</ul>
- <a name="v305"></a><h3>1.iii. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>1.iv. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -450,7 +879,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.iv. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>1.v. 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>
@@ -539,7 +968,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.v. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>1.vi. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -571,7 +1000,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.vi. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>1.vii. 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>
@@ -670,7 +1099,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.vii. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>1.viii. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -718,7 +1147,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.viii Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>1.ix Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -789,7 +1218,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.ix. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>1.x. 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>
@@ -798,7 +1227,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.x. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>1.xi. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -833,7 +1262,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xi. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>1.xii. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -843,7 +1272,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xii. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>1.xiii. 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>
@@ -906,7 +1335,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xiii. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>1.xiv. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -957,7 +1386,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xiv. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>1.xv. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -1066,7 +1495,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xv. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>1.xvi. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -1112,7 +1541,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xvi. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>1.xvii. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 982c28571e..5857163759 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -273,7 +273,7 @@
<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 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.6</samp> you should select the phpBB-3.0.6_to_3.0.7-PL1.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 <samp>3.0.7-PL1</samp> you should select the phpBB-3.0.7-PL1_to_3.0.8.zip/tar.gz 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>
@@ -285,7 +285,7 @@
<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>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 3.0.5 you need the phpBB-3.0.6_to_3.0.7-PL1.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 3.0.5 you need the phpBB-3.0.7-PL1_to_3.0.8.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>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>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 3510bc448e..bb88fdc01f 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -242,7 +242,7 @@
<p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums, they will be locked. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
- <p><a href="http://www.phpbb.com/bugs/">http://www.phpbb.com/bugs/</a></p>
+ <p><a href="http://tracker.phpbb.com/">http://tracker.phpbb.com/</a></p>
<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>
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index c83aaadc2d..8973582bdb 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -61,6 +61,9 @@
<li><a href="#acl_getf">acl_getf</a></li>
<li><a href="#acl_getf_global">acl_getf_global</a></li>
<li><a href="#acl_cache">acl_cache</a></li>
+ <li><a href="#acl_clear_prefetch">acl_clear_prefetch</a></li>
+ <li><a href="#acl_get_list">acl_get_list</a></li>
+ <li><a href="#misc">Miscellaneous</a></li>
</ol>
</li>
<li><a href="#admin_related">Admin related functions</a></li>
@@ -176,7 +179,7 @@ array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <e
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
<div class="codebox"><pre>
-$result = acl_getf_global(<code>option</code>)
+$result = $auth-&gt;acl_getf_global(<code>option</code>)
</pre></div>
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
@@ -187,6 +190,49 @@ $result = acl_getf_global(<code>option</code>)
<p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p>
+ <a name="acl_clear_prefetch"></a><h3>2.vii. acl_clear_prefetch</h3>
+
+ <p>This method clears the user_permissions column in the users table for the given user. If the user ID passed is zero, the permissions cache is cleared for all users. This method should be called whenever permissions are set.</p>
+
+ <div class="codebox"><pre>
+// clear stored permissions for user 2
+$user_id = 2;
+$auth->acl_clear_prefetch($user_id);
+</pre></div>
+
+ <p>This method returns void.</p>
+
+ <a name="acl_get_list"></a><h3>2.viii. acl_get_list</h3>
+
+ <p>This method returns an an array describing which users have permissions in given fora. The resultant array contains an entry for permission that every user has in every forum when no arguments are passed.</p>
+
+ <div class="codebox"><pre>
+$user_id = array(2, 53);
+$permissions = array('f_list', 'f_read');
+$forum_id = array(1, 2, 3);
+$result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
+</pre></div>
+
+ <p>The parameters may be of the following legal types:</p>
+ <ul>
+ <li><strong>$user_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li>
+ <li><strong>$permissions</strong>: <code>false</code>, string, array(string, string, ...)</li>
+ <li><strong>$forum_id</strong>: <code>false</code>, int, array(int, int, int, ...)</li>
+ </ul>
+
+ <a name="misc"></a><h3>2.ix. Miscellaneous</h3>
+
+ <p>There are other methods defined in the auth class which serve mostly as private methods, but are available for use if needed. Each of them is used to pull data directly from the database tables. They are:</p>
+ <ul>
+ <li><pre>function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false)</pre></li>
+ <li><pre>function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li>
+ <li><pre>function acl_raw_data_single_user($user_id)</pre></li>
+ <li><pre>function acl_raw_data($user_id = false, $opts = false, $forum_id = false)</pre></li>
+ <li><pre>function acl_role_data($user_type, $role_type, $ug_id = false, $forum_id = false)</pre></li>
+ </ul>
+
+ <p>Of these, <code>acl_raw_data</code> is the most general, but the others will be faster if you need a smaller amount of data.</p>
+
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
@@ -241,7 +287,7 @@ $auth_admin = new auth_admin();
<!-- END DOCUMENT -->
<div id="page-footer">
- <div class="version"> $Id$ </div>
+ <div class="version">&nbsp;</div>
</div>
</div></div>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 7f747e09e2..5a73554741 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -90,10 +90,9 @@
<li><a href="#vcs">VCS Guidelines</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#repostruct">Repository structure</a></li>
- <li><a href="#commitmessage">Commit messages</a></li>
+ <li><a href="#commitmessage">Commit Messages and Repository Rules</a></li>
</ol>
</li>
- <li><a href="#changes">Guidelines Changelog</a></li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
@@ -288,7 +287,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<div class="content">
- <p>Please note that these Guidelines applies to all php, html, javascript and css files.</p>
+ <p>Please note that these guidelines apply to all php, html, javascript and css files.</p>
<a name="namingvars"></a><h3>2.i. Variable/Function Naming</h3>
@@ -2326,126 +2325,33 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="content">
- <p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.</p>
+ <p>The version control system for phpBB3 is git. The repository is available at <a href="http://github.com/phpbb/phpbb3" title="repository">http://github.com/phpbb/phpbb3</a>.</p>
<a name="repostruct"></a><h3>7.i. Repository Structure</h3>
<ul>
- <li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li>
- <li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release.
+ <li><strong>develop</strong><br />The latest unstable development version with new features etc.</li>
+ <li><strong>develop-*</strong><br />Development branches of stable phpBB releases. Branched off of <code>develop</code> at the time of feature freeze.
<ul>
- <li><strong>phpBB3.0</strong><code>/branches/phpBB-3_0_0/phpBB</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li>
- <li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li>
+ <li><strong>phpBB3.0</strong><code>develop-olympus</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li>
+ <li><strong>phpBB3.1</strong><code>develop-ascraeus</code><br />Development branch of the stable 3.1 line. Bug fixes are applied here.</li>
</ul>
</li>
- <li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release.
+ <li><strong>master</strong><br />A branch containing all stable phpBB3 release points</li>
+ <li><strong>tags</strong><br />Released versions. Stable ones get merged into the master branch.
<ul>
- <li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li>
- <li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li>
- <li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li>
- <li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li>
- <li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li>
+ <li><code>release-3.Y-BX</code><br />Beta release X of the 3.Y line.</li>
+ <li><code>release-3.Y-RCX</code><br />Release candidate X of the 3.Y line.</li>
+ <li><code>release-3.Y.Z-RCX</code><br />Release candidate X of the stable 3.Y.Z release.</li>
+ <li><code>release-3.0.X</code><br />Stable <strong>3.0.X</strong> release.</li>
+ <li><code>release-2.0.X</code><br />Old stable 2.0.X release.</li>
</ul>
</li>
</ul>
- <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3>
-
- <p>The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.</p>
-
- <p>Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:</p>
-
- <div class="codebox"><pre>
-Authorised by: developer1[, developer2[, ...]]
- </pre></div>
-
- </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="changes"></a><h2>8. Guidelines Changelog</h2>
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-<h3>Revision 10007</h3>
-
-<ul>
- <li>Added <a href="#constants">Special Constants</a> section.</li>
-</ul>
-
-<h3>Revision 9817</h3>
-
-<ul>
- <li>Added VCS section.</li>
-</ul>
-
-<h3>Revision 8732</h3>
-
-<ul>
- <li>Added cfg files.</li>
- <li>Added template <a href="#inheritance">inheritance</a>.</li>
-</ul>
-
-<h3>Revision 8596+</h3>
-
-<ul>
- <li>Removed sql_build_array('MULTI_INSERT'... statements.</li>
- <li>Added sql_multi_insert() explanation.</li>
-</ul>
-
-<h3>Revision 1.31</h3>
-
-<ul>
- <li>Added add_form_key and check_form_key. </li>
-</ul>
-
-<h3>Revision 1.24</h3>
-
-<ul>
- <li>Added <a href="#translation">5. Character Sets and Encodings</a> section to explain the recommended treatment of strings in phpBB.</li>
-</ul>
-
-<h3>Revision 1.16</h3>
-
-<ul>
- <li>Added <a href="#translation">6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a> section to explain expected format and authoring considerations for language packs that are to be created for phpBB.</li>
-</ul>
-
-<h3>Revision 1.11-1.15</h3>
-
-<ul>
- <li>Various document formatting, spelling, punctuation, grammar bugs.</li>
-</ul>
-
-<h3>Revision 1.9-1.10</h3>
-
-<ul>
- <li>Added sql_query_limit to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li>
-</ul>
-
-<h3>Revision 1.8</h3>
-
-<ul>
- <li>Some adjustements to wordings</li>
- <li>Updated paragraph <a href="#locations">1.iii. File Locations</a> to reflect recent changes</li>
- <li>Extended paragraph <a href="#codelayout">2.ii. Code Layout</a>.</li>
- <li>Added sql_in_set and sql_build_query explanation to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li>
- <li>Updated paragraph <a href="#styling">3. Styling</a>.</li>
- <li>Updated paragraph <a href="#templating">4. Templating</a> to explain loop checking, loop breaking and other changes we recently made.</li>
-</ul>
-
-<h3>Revision 1.5</h3>
-
-<ul>
- <li>Changed General function usage paragraph in <a href="#general">2.v. General Guidelines</a></li>
-</ul>
+ <a name="commitmessage"></a><h3>7.ii. Commit Messages and Repository Rules</h3>
+ <p>Information on repository rules, such as commit messages can be found at <a href="http://wiki.phpbb.com/display/DEV/Git" title="phpBB Git Information">http://wiki.phpbb.com/display/DEV/Git</a>.</p>
</div>
@@ -2475,7 +2381,7 @@ Authorised by: developer1[, developer2[, ...]]
<!-- END DOCUMENT -->
<div id="page-footer">
- <div class="version"> $Id$ </div>
+ <div class="version">&nbsp;</div>
</div>
</div></div>
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
index b23ebab869..34055c4661 100644
--- a/phpBB/docs/hook_system.html
+++ b/phpBB/docs/hook_system.html
@@ -380,6 +380,8 @@ a:active { color: #368AD2; }
<code>$template-&gt;display($handle, $include_once = true);</code> which is called directly before outputting the (not-yet-compiled) template.<br />
<code>exit_handler();</code> which is called at the very end of phpBB3's execution.</p>
+<p>Please note: The <code>$template-&gt;display</code> hook takes a third <code>$template</code> argument, which is the template instance being used, which should be used instead of the global.</p>
+
<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
<div class="codebox"><pre>
@@ -875,7 +877,7 @@ function phpbb_hook_register(&amp;$hook)
</div>
<div id="page-footer">
- <div class="version">$Id$</div>
+ <div class="version">&nbsp;</div>
</div>
</div></div>
diff --git a/phpBB/docs/lighttpd.sample.conf b/phpBB/docs/lighttpd.sample.conf
new file mode 100644
index 0000000000..5873d1c945
--- /dev/null
+++ b/phpBB/docs/lighttpd.sample.conf
@@ -0,0 +1,60 @@
+# Sample lighttpd configuration file for phpBB.
+# Global settings have been removed, copy them
+# from your system's lighttpd.conf.
+# Tested with lighttpd 1.4.26
+
+# Load moules
+server.modules += (
+ "mod_access",
+ "mod_fastcgi",
+ "mod_accesslog"
+)
+
+# If you have domains with and without www prefix,
+# redirect one to the other.
+$HTTP["host"] =~ "^(myforums\.com)$" {
+ url.redirect = (
+ ".*" => "http://www.%1$0"
+ )
+}
+
+$HTTP["host"] == "www.myforums.com" {
+ server.name = "www.myforums.com"
+ server.document-root = "/path/to/phpbb"
+ server.dir-listing = "disable"
+
+ index-file.names = ( "index.php", "index.htm", "index.html" )
+ accesslog.filename = "/var/log/lighttpd/access-www.myforums.com.log"
+
+ # Deny access to internal phpbb files.
+ $HTTP["url"] =~ "^/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload)" {
+ url.access-deny = ( "" )
+ }
+
+ # Deny access to version control system directories.
+ $HTTP["url"] =~ "/\.svn|/\.git" {
+ url.access-deny = ( "" )
+ }
+
+ # Deny access to apache configuration files.
+ $HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
+ url.access-deny = ( "" )
+ }
+
+ fastcgi.server = ( ".php" =>
+ ((
+ "bin-path" => "/usr/bin/php-cgi",
+ "socket" => "/tmp/php.socket",
+ "max-procs" => 4,
+ "idle-timeout" => 30,
+ "bin-environment" => (
+ "PHP_FCGI_CHILDREN" => "10",
+ "PHP_FCGI_MAX_REQUESTS" => "10000"
+ ),
+ "bin-copy-environment" => (
+ "PATH", "SHELL", "USER"
+ ),
+ "broken-scriptfilename" => "enable"
+ ))
+ )
+}
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 2154847865..5f45b88359 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -31,6 +31,12 @@ else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'
if (isset($_GET['avatar']))
{
+ if (!defined('E_DEPRECATED'))
+ {
+ define('E_DEPRECATED', 8192);
+ }
+ error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+
require($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
@@ -42,6 +48,7 @@ if (isset($_GET['avatar']))
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
+ require($phpbb_root_path . 'includes/functions.' . $phpEx);
$db = new $sql_db();
$cache = new cache();
@@ -61,7 +68,7 @@ if (isset($_GET['avatar']))
$avatar_group = false;
$exit = false;
- if ($filename[0] === 'g')
+ if (isset($filename[0]) && $filename[0] === 'g')
{
$avatar_group = true;
$filename = substr($filename, 1);
@@ -70,7 +77,7 @@ if (isset($_GET['avatar']))
// '==' is not a bug - . as the first char is as bad as no dot at all
if (strpos($filename, '.') == false)
{
- header('HTTP/1.0 403 Forbidden');
+ send_status_line(403, 'Forbidden');
$exit = true;
}
@@ -84,7 +91,7 @@ if (isset($_GET['avatar']))
if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
{
// no way such an avatar could exist. They are not following the rules, stop the show.
- header("HTTP/1.0 403 Forbidden");
+ send_status_line(403, 'Forbidden');
$exit = true;
}
@@ -94,7 +101,7 @@ if (isset($_GET['avatar']))
if (!$filename)
{
// no way such an avatar could exist. They are not following the rules, stop the show.
- header("HTTP/1.0 403 Forbidden");
+ send_status_line(403, 'Forbidden');
}
else
{
@@ -192,7 +199,7 @@ else
$row['forum_id'] = false;
if (!$auth->acl_get('u_pm_download'))
{
- header('HTTP/1.0 403 Forbidden');
+ send_status_line(403, 'Forbidden');
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
@@ -215,7 +222,7 @@ else
if (!$allowed)
{
- header('HTTP/1.0 403 Forbidden');
+ send_status_line(403, 'Forbidden');
trigger_error('ERROR_NO_ATTACHMENT');
}
}
@@ -230,7 +237,7 @@ else
if (!download_allowed())
{
- header('HTTP/1.0 403 Forbidden');
+ send_status_line(403, 'Forbidden');
trigger_error($user->lang['LINKAGE_FORBIDDEN']);
}
@@ -376,7 +383,7 @@ function send_avatar_to_browser($file, $browser)
}
else
{
- header('HTTP/1.0 404 Not Found');
+ send_status_line(404, 'Not Found');
}
}
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 88c30c5d4f..c4b71f3a26 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -276,8 +276,8 @@ function feed_generate_content($content, $uid, $bitfield, $options)
// Add newlines
$content = str_replace('<br />', '<br />' . "\n", $content);
- // Relative Path to Absolute path, Windows style
- $content = str_replace('./', $board_url . '/', $content);
+ // Convert smiley Relative paths to Absolute path, Windows style
+ $content = str_replace($phpbb_root_path . $config['smilies_path'], $board_url . '/' . $config['smilies_path'], $content);
// Remove "Select all" link and mouse events
$content = str_replace('<a href="#" onclick="selectCode(this); return false;">' . $user->lang['SELECT_ALL_CODE'] . '</a>', '', $content);
diff --git a/phpBB/includes/.htaccess b/phpBB/includes/.htaccess
new file mode 100644
index 0000000000..4128d345ab
--- /dev/null
+++ b/phpBB/includes/.htaccess
@@ -0,0 +1,4 @@
+<Files *>
+ Order Allow,Deny
+ Deny from All
+</Files>
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 5a758aa2bb..5c1876d006 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -78,8 +78,14 @@ class acm
if (!$this->_write('data_global'))
{
+ if (!function_exists('phpbb_is_writable'))
+ {
+ global $phpbb_root_path;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
// Now, this occurred how often? ... phew, just tell the user then...
- if (!@is_writable($this->cache_dir))
+ if (!phpbb_is_writable($this->cache_dir))
{
// We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
die($this->cache_dir . ' is NOT writable.');
@@ -707,7 +713,13 @@ class acm
*/
function remove_file($filename, $check = false)
{
- if ($check && !@is_writable($this->cache_dir))
+ if (!function_exists('phpbb_is_writable'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ if ($check && !phpbb_is_writable($this->cache_dir))
{
// E_USER_ERROR - not using language entry - intended.
trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
diff --git a/phpBB/includes/acm/acm_memory.php b/phpBB/includes/acm/acm_memory.php
index efbfd4dd62..2936ea0bae 100644
--- a/phpBB/includes/acm/acm_memory.php
+++ b/phpBB/includes/acm/acm_memory.php
@@ -407,7 +407,13 @@ class acm_memory
*/
function remove_file($filename, $check = false)
{
- if ($check && !@is_writable($this->cache_dir))
+ if (!function_exists('phpbb_is_writable'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
+ if ($check && !phpbb_is_writable($this->cache_dir))
{
// E_USER_ERROR - not using language entry - intended.
trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php
new file mode 100644
index 0000000000..0501ab74c5
--- /dev/null
+++ b/phpBB/includes/acm/acm_wincache.php
@@ -0,0 +1,84 @@
+<?php
+/**
+*
+* @package acm
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+// Include the abstract base
+if (!class_exists('acm_memory'))
+{
+ require("{$phpbb_root_path}includes/acm/acm_memory.$phpEx");
+}
+
+/**
+* ACM for WinCache
+* @package acm
+*/
+class acm extends acm_memory
+{
+ var $extension = 'wincache';
+
+ /**
+ * Purge cache data
+ *
+ * @return void
+ */
+ function purge()
+ {
+ wincache_ucache_clear();
+
+ parent::purge();
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ $success = false;
+ $result = wincache_ucache_get($this->key_prefix . $var, $success);
+
+ return ($success) ? $result : false;
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ return wincache_ucache_delete($this->key_prefix . $var);
+ }
+}
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 980558c830..fc5f44e14f 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1222,7 +1222,7 @@ class acp_attachments
return;
}
- if (!is_writable($phpbb_root_path . $upload_dir))
+ if (!phpbb_is_writable($phpbb_root_path . $upload_dir))
{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 3198376584..a7ea57b753 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -224,7 +224,7 @@ class acp_ban
$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
@@ -236,7 +236,7 @@ class acp_ban
$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 7680d8996c..a5e80e1f6d 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -58,7 +58,7 @@ class acp_board
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
- 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
+ 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -319,6 +319,7 @@ class acp_board
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'load_unreads_search' => array('lang' => 'YES_UNREAD_SEARCH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', '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 56a57e319c..1893eed14f 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -89,14 +89,14 @@ class acp_captcha
}
else
{
- trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
else if ($submit)
{
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link());
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link(), E_USER_WARNING);
}
else
{
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 0582d6204e..193dd001c0 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -1619,41 +1619,48 @@ class mssql_extractor extends base_extractor
function write_data_mssqlnative($table_name)
{
global $db;
- $ary_type = $ary_name = $meta_array = array();
+ $ary_type = $ary_name = array();
$ident_set = false;
$sql_data = '';
// Grab all of the data from current table.
$sql = "SELECT * FROM $table_name";
+ $db->mssqlnative_set_query_options(array('Scrollable' => SQLSRV_CURSOR_STATIC));
$result = $db->sql_query($sql);
- $retrieved_data = $db->mssqlnative_num_rows($result);
+ $retrieved_data = $db->mssqlnative_num_rows($result);
- $meta_array = sqlsrv_field_metadata($result);
- $i_num_fields = sqlsrv_num_fields($result);
-
+ if (!$retrieved_data)
+ {
+ $db->sql_freeresult($result);
+ return;
+ }
+
+ $sql = "SELECT * FROM $table_name";
+ $result_fields = $db->sql_query_limit($sql, 1);
+
+ $row = new result_mssqlnative($result_fields);
+ $i_num_fields = $row->num_fields();
+
for ($i = 0; $i < $i_num_fields; $i++)
{
- $info = $db->mssqlnative_fieldInfo($table_name, $meta_array[$i]['Name']);
- $ary_type[$i] = $info->type();
- $ary_name[$i] = $info->name();
+ $ary_type[$i] = $row->field_type($i);
+ $ary_name[$i] = $row->field_name($i);
}
+ $db->sql_freeresult($result_fields);
+
+ $sql = "SELECT 1 as has_identity
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
+ $result2 = $db->sql_query($sql);
+ $row2 = $db->sql_fetchrow($result2);
- if ($retrieved_data)
+ if (!empty($row2['has_identity']))
{
- $sql = "SELECT 1 as has_identity
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
- $result2 = $db->sql_query($sql);
- $row2 = $db->sql_fetchrow($result2);
-
- if (!empty($row2['has_identity']))
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
- $ident_set = true;
- }
- $db->sql_freeresult($result2);
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
+ $ident_set = true;
}
+ $db->sql_freeresult($result2);
while ($row = $db->sql_fetchrow($result))
{
@@ -1664,7 +1671,8 @@ class mssql_extractor extends base_extractor
{
$str_val = $row[$ary_name[$i]];
- if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
+ // defaults to type number - better quote just to be safe, so check for is_int too
+ if (is_int($ary_type[$i]) || preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = '';
$str_empty = "''";
@@ -1705,7 +1713,7 @@ class mssql_extractor extends base_extractor
}
$db->sql_freeresult($result);
- if ($retrieved_data && $ident_set)
+ if ($ident_set)
{
$sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 6261f866bb..4d9b9f01e0 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -983,7 +983,7 @@ class acp_forums
if (!$row)
{
- trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id), E_USER_WARNING);
+ trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
if ($row['forum_type'] == FORUM_LINK)
@@ -1642,6 +1642,9 @@ class acp_forums
delete_attachments('topic', $topic_ids, false);
+ // Delete shadow topics pointing to topics in this forum
+ delete_topic_shadows($forum_id);
+
// Before we remove anything we make sure we are able to adjust the post counts later. ;)
$sql = 'SELECT poster_id
FROM ' . POSTS_TABLE . '
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 3df61ff4e2..486616c33d 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -49,7 +49,7 @@ class acp_groups
// Clear some vars
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
$group_row = array();
// Grab basic data for group, if group_id is set and exists
@@ -394,6 +394,15 @@ 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))))
+ {
+ // Replace "error" string with its real, localised form
+ $error = array_merge($error, array_map(array(&$user, 'lang'), $max_recipients_error));
+ }
+
if (!sizeof($error))
{
// Only set the rank, colour, etc. if it's changed or if we're adding a new
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 9935c0466e..0499095004 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -35,9 +35,9 @@ class acp_php_info
$this->tpl_name = 'acp_php_info';
$this->page_title = 'ACP_PHP_INFO';
-
+
ob_start();
- @phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);
+ phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);
$phpinfo = ob_get_clean();
$phpinfo = trim($phpinfo);
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 7eeb37133f..ffe20f86f5 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -315,8 +315,8 @@ class acp_prune
'mode' => $mode,
'prune' => 1,
- 'users' => request_var('users', '', true),
- 'username' => request_var('username', '', true),
+ 'users' => utf8_normalize_nfc(request_var('users', '', true)),
+ 'username' => utf8_normalize_nfc(request_var('username', '', true)),
'email' => request_var('email', ''),
'joined_select' => request_var('joined_select', ''),
'joined' => request_var('joined', ''),
@@ -369,7 +369,7 @@ class acp_prune
{
global $user, $db;
- $users = request_var('users', '', true);
+ $users = utf8_normalize_nfc(request_var('users', '', true));
if ($users)
{
@@ -378,7 +378,7 @@ class acp_prune
}
else
{
- $username = request_var('username', '', true);
+ $username = utf8_normalize_nfc(request_var('username', '', true));
$email = request_var('email', '');
$joined_select = request_var('joined_select', 'lt');
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3310560c73..2ccc728031 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -748,7 +748,7 @@ parse_css_file = {PARSE_CSS_FILE}
$additional = '';
// If the template is stored on the filesystem try to write the file else store it in the database
- if (!$safe_mode && !$template_info['template_storedb'] && file_exists($file) && @is_writable($file))
+ if (!$safe_mode && !$template_info['template_storedb'] && file_exists($file) && phpbb_is_writable($file))
{
if (!($fp = @fopen($file, 'wb')))
{
@@ -1155,7 +1155,7 @@ parse_css_file = {PARSE_CSS_FILE}
$message = $user->lang['THEME_UPDATED'];
// If the theme is stored on the filesystem try to write the file else store it in the database
- if (!$safe_mode && !$theme_info['theme_storedb'] && file_exists($file) && @is_writable($file))
+ if (!$safe_mode && !$theme_info['theme_storedb'] && file_exists($file) && phpbb_is_writable($file))
{
if (!($fp = @fopen($file, 'wb')))
{
@@ -2040,23 +2040,18 @@ parse_css_file = {PARSE_CSS_FILE}
{
case 'tar':
$ext = '.tar';
- $mimetype = 'x-tar';
- $compress = 'compress_tar';
break;
case 'zip':
$ext = '.zip';
- $mimetype = 'zip';
break;
case 'tar.gz':
$ext = '.tar.gz';
- $mimetype = 'x-gzip';
break;
case 'tar.bz2':
$ext = '.tar.bz2';
- $mimetype = 'x-bzip2';
break;
default:
@@ -2246,7 +2241,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
// a rather elaborate check we have to do here once to avoid trouble later
$check = "{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
- if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !@is_writable($check)))
+ if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !phpbb_is_writable($check)))
{
$error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
$store_db = 1;
@@ -2326,7 +2321,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
$theme_data = $this->db_theme_data($style_row);
}
- else if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
+ else if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
{
$store_db = 1;
$theme_data = $style_row['theme_data'];
@@ -2357,7 +2352,7 @@ parse_css_file = {PARSE_CSS_FILE}
}
else
{
- if (!$store_db && !$safe_mode && @is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
+ if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
{
$err = $this->store_in_fs('template', $style_row['template_id']);
if ($err)
@@ -2531,13 +2526,21 @@ parse_css_file = {PARSE_CSS_FILE}
// Match CSS imports
$matches = array();
- preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
+ preg_match_all('/@import url\((["\'])(.*)\1\);/i', $stylesheet, $matches);
+
+ // remove commented stylesheets (very simple parser, allows only whitespace
+ // around an @import statement)
+ preg_match_all('#/\*\s*@import url\((["\'])(.*)\1\);\s\*/#i', $stylesheet, $commented);
+ $matches[2] = array_diff($matches[2], $commented[2]);
if (sizeof($matches))
{
foreach ($matches[0] as $idx => $match)
{
- $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
+ if (isset($matches[2][$idx]))
+ {
+ $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[2][$idx]), $stylesheet);
+ }
}
}
@@ -3728,7 +3731,7 @@ parse_css_file = {PARSE_CSS_FILE}
$store_db = 0;
$error = array();
- if (!$safe_mode && @is_writable("{$phpbb_root_path}styles/{$path}/template"))
+ if (!$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$path}/template"))
{
$sql = 'SELECT *
FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 3204e0204e..b0ce8f1084 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -51,6 +51,14 @@ class acp_update
$announcement_url = (strpos($announcement_url, '&amp;') === false) ? str_replace('&', '&amp;', $announcement_url) : $announcement_url;
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
+ // next feature release
+ $next_feature_version = $next_feature_announcement_url = false;
+ if (isset($info[2]) && trim($info[2]) !== '')
+ {
+ $next_feature_version = trim($info[2]);
+ $next_feature_announcement_url = trim($info[3]);
+ }
+
// Determine automatic update...
$sql = 'SELECT config_value
FROM ' . CONFIG_TABLE . "
@@ -74,8 +82,10 @@ class acp_update
'LATEST_VERSION' => $latest_version,
'CURRENT_VERSION' => $config['version'],
'AUTO_VERSION' => $version_update_from,
+ 'NEXT_FEATURE_VERSION' => $next_feature_version,
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link),
+ 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false,
));
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 7914edd056..6be0760be0 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -231,6 +231,11 @@ class acp_users
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
+ if ($user_id == ANONYMOUS)
+ {
+ trigger_error($user->lang['CANNOT_BAN_ANONYMOUS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
@@ -314,10 +319,7 @@ class acp_users
$server_url = generate_board_url();
- $user_actkey = gen_rand_string(10);
- $key_len = 54 - (strlen($server_url));
- $key_len = ($key_len > 6) ? $key_len : 6;
- $user_actkey = substr($user_actkey, 0, $key_len);
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
$email_template = ($user_row['user_type'] == USER_NORMAL) ? 'user_reactivate_account' : 'user_resend_inactive';
if ($user_row['user_type'] == USER_NORMAL)
@@ -1696,7 +1698,7 @@ class acp_users
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
if ($submit)
{
@@ -1706,7 +1708,7 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
- if (avatar_process_user($error, $user_row))
+ if (avatar_process_user($error, $user_row, $can_upload))
{
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_row['user_id']));
}
diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php
index 58b650650c..3e18f55940 100644
--- a/phpBB/includes/acp/info/acp_board.php
+++ b/phpBB/includes/acp/info/acp_board.php
@@ -24,7 +24,7 @@ class acp_board_info
'features' => array('title' => 'ACP_BOARD_FEATURES', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'avatar' => array('title' => 'ACP_AVATAR_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'message' => array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
- 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
+ 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
'signature' => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'feed' => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 73c4f92976..e04a6307e9 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -134,7 +134,8 @@ function login_db(&$username, &$password)
// increase login attempt count to make sure this cannot be exploited
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_login_attempts = user_login_attempts + 1
- WHERE user_id = ' . $row['user_id'];
+ WHERE user_id = ' . (int) $row['user_id'] . '
+ AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
$db->sql_query($sql);
return array(
@@ -194,7 +195,8 @@ function login_db(&$username, &$password)
// Password incorrect - increase login attempts
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_login_attempts = user_login_attempts + 1
- WHERE user_id = ' . $row['user_id'];
+ WHERE user_id = ' . (int) $row['user_id'] . '
+ AND user_login_attempts < ' . LOGIN_ATTEMPTS_MAX;
$db->sql_query($sql);
// Give status about wrong password...
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index 6b1e078ca4..b50fab4ca2 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -88,7 +88,14 @@ class cache extends acm
{
if ($unicode)
{
- $censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#iu';
+ // Unescape the asterisk to simplify further conversions
+ $row['word'] = str_replace('\*', '*', preg_quote($row['word'], '#'));
+
+ // Replace the asterisk inside the pattern, at the start and at the end of it with regexes
+ $row['word'] = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*(?=[\p{Nd}\p{L}_])#iu', '#^\*#', '#\*$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $row['word']);
+
+ // Generate the final substitution
+ $censors['match'][] = '#(?<![\p{Nd}\p{L}_-])(' . $row['word'] . ')(?![\p{Nd}\p{L}_-])#iu';
}
else
{
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php
index e7b8742b05..21cacd730c 100644
--- a/phpBB/includes/captcha/plugins/captcha_abstract.php
+++ b/phpBB/includes/captcha/plugins/captcha_abstract.php
@@ -59,7 +59,7 @@ class phpbb_default_captcha
{
global $user;
- $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10));
// compute $seed % 0x7fffffff
@@ -235,7 +235,7 @@ class phpbb_default_captcha
{
global $db, $user;
- $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->confirm_id = md5(unique_id($user->ip));
$this->seed = hexdec(substr(unique_id(), 4, 10));
$this->solved = 0;
@@ -259,7 +259,7 @@ class phpbb_default_captcha
{
global $db, $user;
- $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10));
$this->solved = 0;
// compute $seed % 0x7fffffff
@@ -281,7 +281,7 @@ class phpbb_default_captcha
{
global $db, $user;
- $this->code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
+ $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10));
$this->solved = 0;
// compute $seed % 0x7fffffff
diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
index 0f0bfc4156..ea171dbe2c 100644
--- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
+++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
@@ -314,10 +314,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
}
else
{
- if ($answers[1] === 'incorrect-captcha-sol')
- {
- return $user->lang['RECAPTCHA_INCORRECT'];
- }
+ return $user->lang['RECAPTCHA_INCORRECT'];
}
}
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index ff572869e2..90440f74b8 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.7-PL1');
+define('PHPBB_VERSION', '3.0.9-dev');
// QA-related
// define('PHPBB_QA', 1);
@@ -69,6 +69,10 @@ define('LOGIN_ERROR_ATTEMPTS', 13);
define('LOGIN_ERROR_EXTERNAL_AUTH', 14);
define('LOGIN_ERROR_PASSWORD_CONVERT', 15);
+// Maximum login attempts
+// The value is arbitrary, but it has to fit into the user_login_attempts field.
+define('LOGIN_ATTEMPTS_MAX', 100);
+
// Group settings
define('GROUP_OPEN', 0);
define('GROUP_CLOSED', 1);
@@ -271,4 +275,4 @@ define('ZEBRA_TABLE', $table_prefix . 'zebra');
// Additional tables
-?> \ No newline at end of file
+?>
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 819ef69c96..f4b181c6ad 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -611,7 +611,7 @@ class phpbb_db_tools
* drop_columns: Removing/Dropping columns
* add_primary_keys: adding primary keys
* add_unique_index: adding an unique index
- * add_index: adding an index
+ * add_index: adding an index (can be column:index_size if you need to provide size)
*
* The values are in this format:
* {TABLE NAME} => array(
@@ -1804,6 +1804,12 @@ class phpbb_db_tools
{
$statements = array();
+ // remove index length unless MySQL4
+ if ('mysql_40' != $this->sql_layer)
+ {
+ $column = preg_replace('#:.*$#', '', $column);
+ }
+
switch ($this->sql_layer)
{
case 'firebird':
@@ -1814,6 +1820,16 @@ class phpbb_db_tools
break;
case 'mysql_40':
+ // add index size to definition as required by MySQL4
+ foreach ($column as $i => $col)
+ {
+ if (false !== strpos($col, ':'))
+ {
+ list($col, $index_size) = explode(':', $col);
+ $column[$i] = "$col($index_size)";
+ }
+ }
+ // no break
case 'mysql_41':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
break;
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
index e554b0f2fb..6f60dd5dad 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/firebird.php
@@ -63,10 +63,19 @@ class dbal_firebird extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache forced to false for Interbase
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
+ /**
+ * force $use_cache false. I didn't research why the caching code there is no caching code
+ * but I assume its because the IB extension provides a direct method to access it
+ * without a query.
+ */
+
+ $use_cache = false;
+
if ($this->service_handle !== false && function_exists('ibase_server_info'))
{
return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION);
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index 7134574691..6899a73902 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -65,13 +65,14 @@ class dbal_mssql extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
@@ -84,7 +85,7 @@ class dbal_mssql extends dbal
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 14c4831010..75a080b1b7 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -76,13 +76,14 @@ class dbal_mssql_odbc extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
{
$result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
@@ -95,7 +96,7 @@ class dbal_mssql_odbc extends dbal
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssqlodbc_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 08ee70907c..7ed4146f27 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -51,7 +51,6 @@ class result_mssqlnative
}
$this->m_row_count = count($this->m_rows);
- sqlsrv_free_stmt($queryresult);
}
private function array_to_obj($array, &$obj)
@@ -199,6 +198,7 @@ class dbal_mssqlnative extends dbal
{
var $m_insert_id = NULL;
var $last_query_text = '';
+ var $query_options = array();
/**
* Connect to server
@@ -232,18 +232,19 @@ class dbal_mssqlnative extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$arr_server_info = sqlsrv_server_info($this->db_connect_id);
$this->sql_server_version = $arr_server_info['SQLServerVersion'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mssql_version', $this->sql_server_version);
}
@@ -307,10 +308,12 @@ class dbal_mssqlnative extends dbal
if ($this->query_result === false)
{
- if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query)) === false)
+ if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query, array(), $this->query_options)) === false)
{
$this->sql_error($query);
}
+ // reset options for next query
+ $this->query_options = array();
if (defined('DEBUG_EXTRA'))
{
@@ -346,7 +349,8 @@ class dbal_mssqlnative extends dbal
{
$this->query_result = false;
- if ($offset === false || $offset == 0)
+ // total == 0 means all results - not zero results
+ if ($offset == 0 && $total !== 0)
{
if (strpos($query, "SELECT") === false)
{
@@ -357,13 +361,21 @@ class dbal_mssqlnative extends dbal
$query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP '.$total, $query);
}
}
- else
+ else if ($offset > 0)
{
$query = preg_replace('/SELECT(\s*DISTINCT)?/Dsi', 'SELECT$1 TOP(10000000) ', $query);
$query = 'SELECT *
FROM (SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3
- FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3
- WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total);
+ FROM (SELECT 1 AS line2, sub1.* FROM (' . $query . ') AS sub1) as sub2) AS sub3';
+
+ if ($total > 0)
+ {
+ $query .= ' WHERE line3 BETWEEN ' . ($offset+1) . ' AND ' . ($offset + $total);
+ }
+ else
+ {
+ $query .= ' WHERE line3 > ' . $offset;
+ }
}
$result = $this->sql_query($query, $cache_ttl);
@@ -403,13 +415,18 @@ class dbal_mssqlnative extends dbal
$row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
- // I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
if ($row)
{
foreach ($row as $key => $value)
{
$row[$key] = ($value === ' ' || $value === NULL) ? '' : $value;
}
+
+ // remove helper values from LIMIT queries
+ if (isset($row['line2']))
+ {
+ unset($row['line2'], $row['line3']);
+ }
}
return $row;
}
@@ -502,6 +519,7 @@ class dbal_mssqlnative extends dbal
{
$errors = @sqlsrv_errors(SQLSRV_ERR_ERRORS);
$error_message = '';
+ $code = 0;
if ($errors != null)
{
@@ -509,6 +527,7 @@ class dbal_mssqlnative extends dbal
{
$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;
@@ -518,7 +537,11 @@ class dbal_mssqlnative extends dbal
{
$error = (isset($this->last_error_result) && $this->last_error_result) ? $this->last_error_result : array();
}
- return $error;
+
+ return array(
+ 'message' => $error,
+ 'code' => $code,
+ );
}
/**
@@ -591,20 +614,28 @@ class dbal_mssqlnative extends dbal
* Utility method used to retrieve number of rows
* Emulates mysql_num_rows
* Used in acp_database.php -> write_data_mssqlnative()
+ * Requires a static or keyset cursor to be definde via
+ * mssqlnative_set_query_options()
*/
function mssqlnative_num_rows($res)
{
if ($res !== false)
{
- $row = new result_mssqlnative($res);
- $num_rows = $row->num_rows();
- return $num_rows;
+ return sqlsrv_num_rows($res);
}
else
{
return false;
}
}
+
+ /**
+ * Allows setting mssqlnative specific query options passed to sqlsrv_query as 4th parameter.
+ */
+ function mssqlnative_set_query_options($options)
+ {
+ $this->query_options = $options;
+ }
}
-?> \ No newline at end of file
+?>
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 0487dfa6d2..1e24c79577 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -96,13 +96,14 @@ class dbal_mysql extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
{
$result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
$row = @mysql_fetch_assoc($result);
@@ -110,7 +111,7 @@ class dbal_mysql extends dbal
$this->sql_server_version = $row['version'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mysql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index f0e58fd148..862d62f4ba 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -80,14 +80,14 @@ class dbal_mysqli extends dbal
/**
* Version information about used database
- * @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
{
$result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
$row = @mysqli_fetch_assoc($result);
@@ -95,7 +95,7 @@ class dbal_mysqli extends dbal
$this->sql_server_version = $row['version'];
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('mysqli_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 55b3599800..c8a9a5f604 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -56,10 +56,18 @@ class dbal_oracle extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache forced to false for Oracle
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
+ /**
+ * force $use_cache false. I didn't research why the caching code below is commented out
+ * but I assume its because the Oracle extension provides a direct method to access it
+ * without a query.
+ */
+
+ $use_cache = false;
/*
global $cache;
@@ -261,6 +269,10 @@ class dbal_oracle extends dbal
{
$cols = explode(', ', $regs[2]);
+/* The code inside this comment block breaks clob handling, but does allow the
+ database restore script to work. If you want to allow no posts longer than 4KB
+ and/or need the db restore script, uncomment this.
+
preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
if (sizeof($cols) !== sizeof($vals))
@@ -310,6 +322,7 @@ class dbal_oracle extends dbal
$vals = array(0 => $vals);
}
+*/
$inserts = $vals[0];
unset($vals);
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index b3139b3d79..4360c790a1 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -46,7 +46,10 @@ class dbal_postgres extends dbal
if ($sqlserver)
{
- if (strpos($sqlserver, ':') !== false)
+ // $sqlserver can carry a port separated by : for compatibility reasons
+ // If $sqlserver has more than one : it's probably an IPv6 address.
+ // In this case we only allow passing a port via the $port variable.
+ if (substr_count($sqlserver, ':') === 1)
{
list($sqlserver, $port) = explode(':', $sqlserver);
}
@@ -105,13 +108,14 @@ class dbal_postgres extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache If true, it is safe to retrieve the value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
{
$query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
$row = @pg_fetch_assoc($query_id, null);
@@ -119,7 +123,7 @@ class dbal_postgres extends dbal
$this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
- if (!empty($cache))
+ if (!empty($cache) && $use_cache)
{
$cache->put('pgsql_version', $this->sql_server_version);
}
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 288f6e0992..8de72fd394 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -50,19 +50,24 @@ class dbal_sqlite extends dbal
/**
* Version information about used database
* @param bool $raw if true, only return the fetched sql_server_version
+ * @param bool $use_cache if true, it is safe to retrieve the stored value from the cache
* @return string sql server version
*/
- function sql_server_info($raw = false)
+ function sql_server_info($raw = false, $use_cache = true)
{
global $cache;
- if (empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
+ if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
{
$result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
$row = @sqlite_fetch_array($result, SQLITE_ASSOC);
$this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
- $cache->put('sqlite_version', $this->sql_server_version);
+
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
}
return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 3e80f93114..c7f19b709d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -195,10 +195,27 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
/**
* Generates an alphanumeric random string of given length
+*
+* @return string
*/
function gen_rand_string($num_chars = 8)
{
+ // [a, z] + [0, 9] = 36
+ return substr(strtoupper(base_convert(unique_id(), 16, 36)), 0, $num_chars);
+}
+
+/**
+* Generates a user-friendly alphanumeric random string of given length
+* We remove 0 and O so users cannot confuse those in passwords etc.
+*
+* @return string
+*/
+function gen_rand_string_friendly($num_chars = 8)
+{
$rand_str = unique_id();
+
+ // Remove Z and Y from the base_convert(), replace 0 with Z and O with Y
+ // [a, z] + [0, 9] - {z, y} = [a, z] + [0, 9] - {0, o} = 34
$rand_str = str_replace(array('0', 'O'), array('Z', 'Y'), strtoupper(base_convert($rand_str, 16, 34)));
return substr($rand_str, 0, $num_chars);
@@ -701,7 +718,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ)
clearstatcache();
- if (is_readable($filename) && is_writable($filename))
+ if (is_readable($filename) && phpbb_is_writable($filename))
{
break;
}
@@ -711,7 +728,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ)
clearstatcache();
- if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
+ if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || phpbb_is_writable($filename)))
{
break;
}
@@ -721,7 +738,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ)
clearstatcache();
- if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
+ if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || phpbb_is_writable($filename)))
{
break;
}
@@ -1035,7 +1052,7 @@ function phpbb_own_realpath($path)
// @todo If the file exists fine and open_basedir only has one path we should be able to prepend it
// because we must be inside that basedir, the question is where...
// @internal The slash in is_dir() gets around an open_basedir restriction
- if (!@file_exists($resolved) || (!is_dir($resolved . '/') && !is_file($resolved)))
+ if (!@file_exists($resolved) || (!@is_dir($resolved . '/') && !is_file($resolved)))
{
return false;
}
@@ -1660,10 +1677,11 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
* @param string $sql_extra Extra WHERE SQL statement
* @param string $sql_sort ORDER BY SQL sorting statement
* @param string $sql_limit Limits the size of unread topics list, 0 for unlimited query
+* @param string $sql_limit_offset Sets the offset of the first row to search, 0 to search from the start
*
* @return array[int][int] Topic ids as keys, mark_time of topic as value
*/
-function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001)
+function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;
@@ -1709,7 +1727,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
);
$sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query_limit($sql, $sql_limit);
+ $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
while ($row = $db->sql_fetchrow($result))
{
@@ -1742,7 +1760,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
WHERE t.topic_last_post_time > ' . $user_lastmark . "
$sql_extra
$sql_sort";
- $result = $db->sql_query_limit($sql, $sql_limit);
+ $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
while ($row = $db->sql_fetchrow($result))
{
@@ -2335,12 +2353,12 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Relative uri
$pathinfo = pathinfo($url);
- if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
+ if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
{
$url = str_replace('../', '', $url);
$pathinfo = pathinfo($url);
- if (!file_exists($pathinfo['dirname']))
+ if (!file_exists($pathinfo['dirname'] . '/'))
{
// fallback to "last known user page"
// at least this way we know the user does not leave the phpBB root
@@ -2518,6 +2536,11 @@ function build_url($strip_vars = false)
$key = $arguments[0];
unset($arguments[0]);
+ if ($key === '')
+ {
+ continue;
+ }
+
$query[$key] = implode('=', $arguments);
}
@@ -3354,7 +3377,9 @@ function get_preg_expression($mode)
switch ($mode)
{
case 'email':
- return '(?:[a-z0-9\'\.\-_\+\|]++|&amp;)+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+';
+ // Regex written by James Watts and Francisco Jose Martin Moreno
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
break;
case 'bbcode_htm':
@@ -3437,26 +3462,110 @@ function short_ipv6($ip, $length)
/**
* Wrapper for php's checkdnsrr function.
*
-* The windows failover is from the php manual
-* Please make sure to check the return value for === true and === false, since NULL could
-* be returned too.
+* @param string $host Fully-Qualified Domain Name
+* @param string $type Resource record type to lookup
+* Supported types are: MX (default), A, AAAA, NS, TXT, CNAME
+* Other types may work or may not work
+*
+* @return mixed true if entry found,
+* false if entry not found,
+* null if this function is not supported by this environment
*
-* @return true if entry found, false if not, NULL if this function is not supported by this environment
+* Since null can also be returned, you probably want to compare the result
+* with === true or === false,
+*
+* @author bantu
*/
-function phpbb_checkdnsrr($host, $type = '')
+function phpbb_checkdnsrr($host, $type = 'MX')
{
- $type = (!$type) ? 'MX' : $type;
+ // The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
+ if (substr($host, -1) == '.')
+ {
+ $host_fqdn = $host;
+ $host = substr($host, 0, -1);
+ }
+ else
+ {
+ $host_fqdn = $host . '.';
+ }
+ // $host has format some.host.example.com
+ // $host_fqdn has format some.host.example.com.
+
+ // If we're looking for an A record we can use gethostbyname()
+ if ($type == 'A' && function_exists('gethostbyname'))
+ {
+ return (@gethostbyname($host_fqdn) == $host_fqdn) ? false : true;
+ }
+
+ // checkdnsrr() is available on Windows since PHP 5.3,
+ // but until 5.3.3 it only works for MX records
+ // See: http://bugs.php.net/bug.php?id=51844
- // Call checkdnsrr() if available. This is also the case on Windows with PHP 5.3 or later.
- if (function_exists('checkdnsrr'))
+ // Call checkdnsrr() if
+ // we're looking for an MX record or
+ // we're not on Windows or
+ // we're running a PHP version where #51844 has been fixed
+
+ // checkdnsrr() supports AAAA since 5.0.0
+ // checkdnsrr() supports TXT since 5.2.4
+ if (
+ ($type == 'MX' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.3', '>=')) &&
+ ($type != 'AAAA' || version_compare(PHP_VERSION, '5.0.0', '>=')) &&
+ ($type != 'TXT' || version_compare(PHP_VERSION, '5.2.4', '>=')) &&
+ function_exists('checkdnsrr')
+ )
{
- // The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
- return checkdnsrr($host . '.', $type);
+ return checkdnsrr($host_fqdn, $type);
}
- else if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec'))
+
+ // dns_get_record() is available since PHP 5; since PHP 5.3 also on Windows,
+ // but on Windows it does not work reliable for AAAA records before PHP 5.3.1
+
+ // Call dns_get_record() if
+ // we're not looking for an AAAA record or
+ // we're not on Windows or
+ // we're running a PHP version where AAAA lookups work reliable
+ if (
+ ($type != 'AAAA' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.1', '>=')) &&
+ function_exists('dns_get_record')
+ )
{
- // @exec('nslookup -retry=1 -timout=1 -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
- @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host) . '.', $output);
+ // dns_get_record() expects an integer as second parameter
+ // We have to convert the string $type to the corresponding integer constant.
+ $type_constant = 'DNS_' . $type;
+ $type_param = (defined($type_constant)) ? constant($type_constant) : DNS_ANY;
+
+ // dns_get_record() might throw E_WARNING and return false for records that do not exist
+ $resultset = @dns_get_record($host_fqdn, $type_param);
+
+ if (empty($resultset) || !is_array($resultset))
+ {
+ return false;
+ }
+ else if ($type_param == DNS_ANY)
+ {
+ // $resultset is a non-empty array
+ return true;
+ }
+
+ foreach ($resultset as $result)
+ {
+ if (
+ isset($result['host']) && $result['host'] == $host &&
+ isset($result['type']) && $result['type'] == $type
+ )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // If we're on Windows we can still try to call nslookup via exec() as a last resort
+ if (DIRECTORY_SEPARATOR == '\\' && function_exists('exec'))
+ {
+ @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host_fqdn), $output);
// If output is empty, the nslookup failed
if (empty($output))
@@ -3466,15 +3575,66 @@ function phpbb_checkdnsrr($host, $type = '')
foreach ($output as $line)
{
- if (!trim($line))
+ $line = trim($line);
+
+ if (empty($line))
{
continue;
}
- // Valid records begin with host name:
- if (strpos($line, $host) === 0)
+ // Squash tabs and multiple whitespaces to a single whitespace.
+ $line = preg_replace('/\s+/', ' ', $line);
+
+ switch ($type)
{
- return true;
+ case 'MX':
+ if (stripos($line, "$host MX") === 0)
+ {
+ return true;
+ }
+ break;
+
+ case 'NS':
+ if (stripos($line, "$host nameserver") === 0)
+ {
+ return true;
+ }
+ break;
+
+ case 'TXT':
+ if (stripos($line, "$host text") === 0)
+ {
+ return true;
+ }
+ break;
+
+ case 'CNAME':
+ if (stripos($line, "$host canonical name") === 0)
+ {
+ return true;
+ }
+
+ default:
+ case 'A':
+ case 'AAAA':
+ if (!empty($host_matches))
+ {
+ // Second line
+ if (stripos($line, "Address: ") === 0)
+ {
+ return true;
+ }
+ else
+ {
+ $host_matches = false;
+ }
+ }
+ else if (stripos($line, "Name: $host") === 0)
+ {
+ // First line
+ $host_matches = true;
+ }
+ break;
}
}
@@ -3593,7 +3753,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
// Do not send 200 OK, but service unavailable on errors
- header('HTTP/1.1 503 Service Unavailable');
+ send_status_line(503, 'Service Unavailable');
garbage_collection();
@@ -4063,7 +4223,8 @@ function phpbb_http_login($param)
}
else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)
{
- header('HTTP/1.0 401 Unauthorized');
+ send_status_line(401, 'Unauthorized');
+
trigger_error('NOT_AUTHORISED');
}
}
@@ -4075,7 +4236,7 @@ function phpbb_http_login($param)
$param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']);
header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"');
- header('HTTP/1.0 401 Unauthorized');
+ send_status_line(401, 'Unauthorized');
trigger_error('NOT_AUTHORISED');
}
@@ -4305,6 +4466,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false,
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,
+ 'S_LOAD_UNREADS' => ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false,
+
'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',
'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template',
'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template',
@@ -4317,7 +4480,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
- 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'], true, $user->session_id),
+ 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang']),
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
'T_THEME_NAME' => $user->theme['theme_path'],
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 4cd2962e3b..2aa12adb2e 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -573,8 +573,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
while ($row = $db->sql_fetchrow($result))
{
- $forum_ids[] = $row['forum_id'];
- $topic_ids[] = $row['topic_id'];
+ $forum_ids[] = (int) $row['forum_id'];
+ $topic_ids[] = (int) $row['topic_id'];
}
$db->sql_freeresult($result);
@@ -591,7 +591,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
}
$sql = 'UPDATE ' . POSTS_TABLE . '
- SET forum_id = ' . $forum_row['forum_id'] . ", topic_id = $topic_id
+ SET forum_id = ' . (int) $forum_row['forum_id'] . ", topic_id = $topic_id
WHERE " . $db->sql_in_set('post_id', $post_ids);
$db->sql_query($sql);
@@ -602,7 +602,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
if ($auto_sync)
{
- $forum_ids[] = $forum_row['forum_id'];
+ $forum_ids[] = (int) $forum_row['forum_id'];
sync('topic_reported', 'topic_id', $topic_ids);
sync('topic_attachment', 'topic_id', $topic_ids);
@@ -1125,53 +1125,65 @@ function delete_attachments($mode, $ids, $resync = true)
}
/**
-* Remove topic shadows
+* Deletes shadow topics pointing to a specified forum.
+*
+* @param int $forum_id The forum id
+* @param string $sql_more Additional WHERE statement, e.g. t.topic_time < (time() - 1234)
+* @param bool $auto_sync Will call sync() if this is true
+*
+* @return array Array with affected forums
+*
+* @author bantu
*/
-function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true)
+function delete_topic_shadows($forum_id, $sql_more = '', $auto_sync = true)
{
- $where = (is_array($forum_id)) ? 'AND ' . $db->sql_in_set('t.forum_id', array_map('intval', $forum_id)) : (($forum_id) ? 'AND t.forum_id = ' . (int) $forum_id : '');
+ global $db;
- switch ($db->sql_layer)
+ if (!$forum_id)
{
- case 'mysql4':
- case 'mysqli':
- $sql = 'DELETE t.*
- FROM ' . TOPICS_TABLE . ' t, ' . TOPICS_TABLE . ' t2
- WHERE t.topic_moved_id = t2.topic_id
- AND t.topic_time < ' . (time() - $max_age)
- . $where;
- $db->sql_query($sql);
- break;
+ // Nothing to do.
+ return;
+ }
- default:
- $sql = 'SELECT t.topic_id
- FROM ' . TOPICS_TABLE . ' t, ' . TOPICS_TABLE . ' t2
- WHERE t.topic_moved_id = t2.topic_id
- AND t.topic_time < ' . (time() - $max_age)
- . $where;
- $result = $db->sql_query($sql);
+ // Set of affected forums we have to resync
+ $sync_forum_ids = array();
- $topic_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $topic_ids[] = $row['topic_id'];
- }
- $db->sql_freeresult($result);
+ // Amount of topics we select and delete at once.
+ $batch_size = 500;
- if (sizeof($topic_ids))
- {
- $sql = 'DELETE FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
- $db->sql_query($sql);
- }
- break;
+ do
+ {
+ $sql = 'SELECT t2.forum_id, t2.topic_id
+ FROM ' . TOPICS_TABLE . ' t2, ' . TOPICS_TABLE . ' t
+ WHERE t2.topic_moved_id = t.topic_id
+ AND t.forum_id = ' . (int) $forum_id . '
+ ' . (($sql_more) ? 'AND ' . $sql_more : '');
+ $result = $db->sql_query_limit($sql, $batch_size);
+
+ $topic_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topic_ids[] = (int) $row['topic_id'];
+
+ $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($topic_ids))
+ {
+ $sql = 'DELETE FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
+ }
}
+ while (sizeof($topic_ids) == $batch_size);
if ($auto_sync)
{
- $where_type = ($forum_id) ? 'forum_id' : '';
- sync('forum', $where_type, $forum_id, true, true);
+ sync('forum', 'forum_id', $sync_forum_ids, true, true);
}
+
+ return $sync_forum_ids;
}
/**
@@ -3287,7 +3299,7 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $
$errstr = '';
$errno = 0;
- $info = get_remote_file('www.phpbb.com', '/updatecheck',
+ $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/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index f422eaa8c1..455debd939 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -53,13 +53,18 @@ class compress
$filelist = filelist("$phpbb_root_path$src", '', '*');
krsort($filelist);
+ /**
+ * Commented out, as adding the folders produces corrupted archives
if ($src_path)
{
$this->data($src_path, '', true, stat("$phpbb_root_path$src"));
}
+ */
foreach ($filelist as $path => $file_ary)
{
+ /**
+ * Commented out, as adding the folders produces corrupted archives
if ($path)
{
// Same as for src_path
@@ -68,6 +73,7 @@ class compress
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
}
+ */
foreach ($file_ary as $file)
{
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 0fdae9b274..4a359dcade 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1025,6 +1025,9 @@ function set_user_options()
'bbcode' => array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),
+ 'sig_bbcode' => array('bit' => 15, 'default' => 1),
+ 'sig_smilies' => array('bit' => 16, 'default' => 1),
+ 'sig_links' => array('bit' => 17, 'default' => 1),
);
$option_field = 0;
@@ -1813,6 +1816,7 @@ function add_bots()
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'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/', ''),
@@ -2303,7 +2307,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
}
}
- if (!is_writable($path))
+ if (!phpbb_is_writable($path))
{
@chmod($path, 0777);
}
@@ -2338,7 +2342,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
@chmod($trg_path, 0777);
}
- if (!@is_writable($trg_path))
+ if (!phpbb_is_writable($trg_path))
{
$bad_dirs[] = path($config['script_path']) . $trg;
}
@@ -2405,7 +2409,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
@chmod($trg_path . $dir, 0777);
}
- if (!@is_writable($trg_path . $dir))
+ if (!phpbb_is_writable($trg_path . $dir))
{
$bad_dirs[] = $trg . $dir;
$bad_dirs[] = $trg_path . $dir;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index ec348138f5..acaef49fe8 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -396,7 +396,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
else
{
- $folder_alt = ($forum_unread) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
+ $folder_alt = ($forum_unread) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS';
}
// Create last post link information, if appropriate
@@ -425,7 +425,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$s_subforums_list = array();
foreach ($subforums_list as $subforum)
{
- $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
+ $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['UNREAD_POSTS'] : $user->lang['NO_UNREAD_POSTS']) . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
$catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
@@ -456,7 +456,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
- 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options'])) ? true : false,
+ 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false,
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
@@ -854,7 +854,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
$folder_img = ($unread_topic) ? $folder_new : $folder;
- $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
+ $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
// Posted image?
if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted'])
@@ -969,11 +969,16 @@ function display_user_activity(&$userdata)
$forum_ary = array_unique($forum_ary);
$forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
+ $fid_m_approve = $auth->acl_getf('m_approve', true);
+ $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', array_keys($fid_m_approve)) : '';
+
// Obtain active forum
$sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
+ AND (post_approved = 1
+ $sql_m_approve)
$forum_sql
GROUP BY forum_id
ORDER BY num_posts DESC";
@@ -996,6 +1001,8 @@ function display_user_activity(&$userdata)
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
+ AND (post_approved = 1
+ $sql_m_approve)
$forum_sql
GROUP BY topic_id
ORDER BY num_posts DESC";
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 99883cd9ca..b5c87094c0 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -632,6 +632,64 @@ class queue
}
/**
+ * Obtains exclusive lock on queue cache file.
+ * Returns resource representing the lock
+ */
+ function lock()
+ {
+ // For systems that can't have two processes opening
+ // one file for writing simultaneously
+ if (file_exists($this->cache_file . '.lock'))
+ {
+ $mode = 'rb';
+ }
+ else
+ {
+ $mode = 'wb';
+ }
+
+ $lock_fp = @fopen($this->cache_file . '.lock', $mode);
+
+ if ($mode == 'wb')
+ {
+ if (!$lock_fp)
+ {
+ // Two processes may attempt to create lock file at the same time.
+ // Have the losing process try opening the lock file again for reading
+ // on the assumption that the winning process created it
+ $mode = 'rb';
+ $lock_fp = @fopen($this->cache_file . '.lock', $mode);
+ }
+ else
+ {
+ // Only need to set mode when the lock file is written
+ @chmod($this->cache_file . '.lock', 0666);
+ }
+ }
+
+ if ($lock_fp)
+ {
+ @flock($lock_fp, LOCK_EX);
+ }
+
+ return $lock_fp;
+ }
+
+ /**
+ * Releases lock on queue cache file, using resource obtained from lock()
+ */
+ function unlock($lock_fp)
+ {
+ // lock() will return null if opening lock file, and thus locking, failed.
+ // Accept null values here so that client code does not need to check them
+ if ($lock_fp)
+ {
+ @flock($lock_fp, LOCK_UN);
+ fclose($lock_fp);
+ }
+ }
+
+ /**
* Process queue
* Using lock file
*/
@@ -639,24 +697,16 @@ class queue
{
global $db, $config, $phpEx, $phpbb_root_path, $user;
- set_config('last_queue_run', time(), true);
+ $lock_fp = $this->lock();
- // Delete stale lock file
- if (file_exists($this->cache_file . '.lock') && !file_exists($this->cache_file))
- {
- @unlink($this->cache_file . '.lock');
- return;
- }
+ set_config('last_queue_run', time(), true);
- if (!file_exists($this->cache_file) || (file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval']))
+ if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval'])
{
+ $this->unlock($lock_fp);
return;
}
- $fp = @fopen($this->cache_file . '.lock', 'wb');
- fclose($fp);
- @chmod($this->cache_file . '.lock', 0777);
-
include($this->cache_file);
foreach ($this->queue_data as $object => $data_ary)
@@ -671,11 +721,18 @@ class queue
$package_size = $data_ary['package_size'];
$num_items = (!$package_size || sizeof($data_ary['data']) < $package_size) ? sizeof($data_ary['data']) : $package_size;
+ /*
+ * This code is commented out because it causes problems on some web hosts.
+ * The core problem is rather restrictive email sending limits.
+ * This code is nly useful if you have no such restrictions from the
+ * web host and the package size setting is wrong.
+
// If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs...
if (sizeof($data_ary['data']) > $package_size * 2.5)
{
$num_items = sizeof($data_ary['data']);
}
+ */
switch ($object)
{
@@ -713,6 +770,7 @@ class queue
break;
default:
+ $this->unlock($lock_fp);
return;
}
@@ -738,8 +796,6 @@ class queue
if (!$result)
{
- @unlink($this->cache_file . '.lock');
-
messenger::error('EMAIL', $err_msg);
continue 2;
}
@@ -783,16 +839,14 @@ class queue
{
if ($fp = @fopen($this->cache_file, 'wb'))
{
- @flock($fp, LOCK_EX);
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
- @flock($fp, LOCK_UN);
fclose($fp);
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
}
}
- @unlink($this->cache_file . '.lock');
+ $this->unlock($lock_fp);
}
/**
@@ -805,6 +859,8 @@ class queue
return;
}
+ $lock_fp = $this->lock();
+
if (file_exists($this->cache_file))
{
include($this->cache_file);
@@ -824,13 +880,13 @@ class queue
if ($fp = @fopen($this->cache_file, 'w'))
{
- @flock($fp, LOCK_EX);
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
- @flock($fp, LOCK_UN);
fclose($fp);
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
}
+
+ $this->unlock($lock_fp);
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index f6f90575d4..6fd87db663 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -2537,7 +2537,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($mode == 'post' || $mode == 'reply' || $mode == 'quote')
{
// Mark this topic as posted to
- markread('post', $data['forum_id'], $data['topic_id'], $data['post_time']);
+ markread('post', $data['forum_id'], $data['topic_id']);
}
// Mark this topic as read
@@ -2583,7 +2583,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
// Send Notifications
- if ($mode != 'edit' && $mode != 'delete' && $post_approval)
+ 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']);
}
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4fc5034f7b..4c34bc92ca 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1380,6 +1380,9 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
}
}
+ // First of all make sure the subject are having the correct length.
+ $subject = truncate_string($subject);
+
$db->sql_transaction('begin');
$sql = '';
@@ -1751,6 +1754,8 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
return false;
}
+ $title = $row['message_subject'];
+
$rowset = array();
$bbcode_bitfield = '';
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&amp;folder=';
@@ -1774,8 +1779,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
- $title = $row['message_subject'];
-
if (sizeof($rowset) == 1 && !$in_post_mode)
{
return false;
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index fa1cc98e10..78fe049f40 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -543,8 +543,9 @@ class custom_profile
else if ($day && $month && $year)
{
global $user;
- // d/m/y 00:00 GMT isn't necessarily on the same d/m/y in the user's timezone, so add the timezone seconds
- return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) + $user->timezone + $user->dst, $user->lang['DATE_FORMAT'], true);
+ // Date should display as the same date for every user regardless of timezone, so remove offset
+ // to compensate for the offset added by user::format_date()
+ return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true);
}
return $value;
@@ -877,6 +878,11 @@ class custom_profile
$now = getdate();
$row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
}
+ else if ($row['field_default_value'] === '' && $row['field_type'] == FIELD_INT)
+ {
+ // We cannot insert an empty string into an integer column.
+ $row['field_default_value'] = NULL;
+ }
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
}
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 51fed45ebd..7f09cc1640 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -58,8 +58,9 @@ class filespec
$this->filename = $upload_ary['tmp_name'];
$this->filesize = $upload_ary['size'];
- $name = trim(utf8_htmlspecialchars(utf8_basename($upload_ary['name'])));
- $this->realname = $this->uploadname = (STRIP) ? stripslashes($name) : $name;
+ $name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name'];
+ $name = trim(utf8_htmlspecialchars(utf8_basename($name)));
+ $this->realname = $this->uploadname = $name;
$this->mimetype = $upload_ary['type'];
// Opera adds the name to the mime type
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 21e82030ee..f2c80705ba 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -297,6 +297,7 @@ function user_add($user_row, $cp_data = false)
if ($config['new_member_group_default'])
{
group_user_add($add_group_id, $user_id, false, false, true);
+ $user_row['group_id'] = $add_group_id;
}
else
{
@@ -527,7 +528,7 @@ function user_delete($mode, $user_id, $post_username = false)
$db->sql_transaction('begin');
- $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
+ $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);
foreach ($table_ary as $table)
{
@@ -765,7 +766,8 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) &&
(strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2))
{
- $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0]));
+ $time_offset = (isset($user->timezone) && isset($user->dst)) ? (int) $user->timezone + (int) $user->dst : 0;
+ $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0]) - $time_offset);
}
else
{
@@ -836,14 +838,15 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);
- // Do not allow banning yourself
+ // Do not allow banning yourself, the guest account, or founders.
+ $non_bannable = array($user->data['user_id'], ANONYMOUS);
if (sizeof($founder))
{
- $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true);
+ $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), $non_bannable), true);
}
else
{
- $sql .= ' AND user_id <> ' . $user->data['user_id'];
+ $sql .= ' AND ' . $db->sql_in_set('user_id', $non_bannable, true);
}
$result = $db->sql_query($sql);
@@ -1227,22 +1230,39 @@ function user_unban($mode, $ban)
}
/**
-* Whois facility
+* Internet Protocol Address Whois
+* RFC3912: WHOIS Protocol Specification
*
-* @link http://tools.ietf.org/html/rfc3912 RFC3912: WHOIS Protocol Specification
+* @param string $ip Ip address, either IPv4 or IPv6.
+*
+* @return string Empty string if not a valid ip address.
+* Otherwise make_clickable()'ed whois result.
*/
function user_ipwhois($ip)
{
- $ipwhois = '';
+ if (empty($ip))
+ {
+ return '';
+ }
- // Check IP
- // Only supporting IPv4 at the moment...
- if (empty($ip) || !preg_match(get_preg_expression('ipv4'), $ip))
+ if (preg_match(get_preg_expression('ipv4'), $ip))
+ {
+ // IPv4 address
+ $whois_host = 'whois.arin.net.';
+ }
+ else if (preg_match(get_preg_expression('ipv6'), $ip))
+ {
+ // IPv6 address
+ $whois_host = 'whois.sixxs.net.';
+ }
+ else
{
return '';
}
- if (($fsk = @fsockopen('whois.arin.net', 43)))
+ $ipwhois = '';
+
+ if (($fsk = @fsockopen($whois_host, 43)))
{
// CRLF as per RFC3912
fputs($fsk, "$ip\r\n");
@@ -1255,7 +1275,7 @@ function user_ipwhois($ip)
$match = array();
- // Test for referrals from ARIN to other whois databases, roll on rwhois
+ // Test for referrals from $whois_host to other whois databases, roll on rwhois
if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match))
{
if (strpos($match[1], ':') !== false)
@@ -1283,7 +1303,7 @@ function user_ipwhois($ip)
@fclose($fsk);
}
- // Use the result from ARIN if we don't get any result here
+ // Use the result from $whois_host if we don't get any result here
$ipwhois = (empty($buffer)) ? $ipwhois : $buffer;
}
@@ -2283,7 +2303,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
/**
* Uploading/Changing user avatar
*/
-function avatar_process_user(&$error, $custom_userdata = false)
+function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
{
global $config, $phpbb_root_path, $auth, $user, $db;
@@ -2322,7 +2342,10 @@ function avatar_process_user(&$error, $custom_userdata = false)
$avatar_select = basename(request_var('avatar_select', ''));
// Can we upload?
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ if (is_null($can_upload))
+ {
+ $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ }
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
{
@@ -2347,7 +2370,7 @@ function avatar_process_user(&$error, $custom_userdata = false)
}
else
{
- list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . $sql_ary['user_avatar']);
+ list($sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = getimagesize($phpbb_root_path . $config['avatar_gallery_path'] . '/' . $category . '/' . urldecode($sql_ary['user_avatar']));
$sql_ary['user_avatar'] = $category . '/' . $sql_ary['user_avatar'];
}
}
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 80c3559649..d5551f5114 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -1048,6 +1048,35 @@ function mcp_fork_topic($topic_ids)
$total_posts = 0;
$new_topic_id_list = array();
+ if ($topic_data['enable_indexing'])
+ {
+ // Select the search method and do some additional checks to ensure it can actually be utilised
+ $search_type = basename($config['search_type']);
+
+ if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ {
+ trigger_error('NO_SUCH_SEARCH_MODULE');
+ }
+
+ if (!class_exists($search_type))
+ {
+ include("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+ }
+
+ $error = false;
+ $search = new $search_type($error);
+ $search_mode = 'post';
+
+ if ($error)
+ {
+ trigger_error($error);
+ }
+ }
+ else
+ {
+ $search_type = false;
+ }
+
foreach ($topic_data as $topic_id => $topic_row)
{
$sql_ary = array(
@@ -1158,6 +1187,12 @@ function mcp_fork_topic($topic_ids)
// Copy whether the topic is dotted
markread('post', $to_forum_id, $new_topic_id, 0, $row['poster_id']);
+ if ($search_type)
+ {
+ $search->index($search_mode, $sql_ary['post_id'], $sql_ary['post_text'], $sql_ary['post_subject'], $sql_ary['poster_id'], ($topic_row['topic_type'] == POST_GLOBAL) ? 0 : $to_forum_id);
+ $search_mode = 'reply'; // After one we index replies
+ }
+
// Copy Attachments
if ($row['post_attachment'])
{
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index fa44e006dd..7098b4bbce 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -176,7 +176,7 @@ function mcp_post_details($id, $mode, $action)
}
$template->assign_vars(array(
- 'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1", // Use this for mode paramaters
+ 'U_MCP_ACTION' => "$url&amp;i=main&amp;quickmod=1&amp;mode=post_details", // Use this for mode paramaters
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f={$post_info['forum_id']}"),
@@ -200,7 +200,7 @@ function mcp_post_details($id, $mode, $action)
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 8d9ece5205..c419da5574 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -196,7 +196,7 @@ class mcp_queue
'U_VIEW_POST' => $post_url,
'U_VIEW_TOPIC' => $topic_url,
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
@@ -428,7 +428,7 @@ class mcp_queue
'POST_ID' => $row['post_id'],
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
- 'POST_SUBJECT' => $row['post_subject'],
+ 'POST_SUBJECT' => ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'TOPIC_TITLE' => $row['topic_title'],
'POST_TIME' => $user->format_date($row['post_time']))
);
@@ -691,16 +691,19 @@ function approve_post($post_id_list, $id, $mode)
{
$show_notify = false;
- foreach ($post_info as $post_data)
+ if ($config['email_enable'] || $config['jab_enable'])
{
- if ($post_data['poster_id'] == ANONYMOUS)
- {
- continue;
- }
- else
+ foreach ($post_info as $post_data)
{
- $show_notify = true;
- break;
+ if ($post_data['poster_id'] == ANONYMOUS)
+ {
+ continue;
+ }
+ else
+ {
+ $show_notify = true;
+ break;
+ }
}
}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index e19fe96963..39d9fbd4af 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -205,7 +205,7 @@ class mcp_reports
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 9779478330..76cd9beb92 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -237,7 +237,7 @@ function mcp_topic_view($id, $mode, $action)
'POST_ID' => $row['post_id'],
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'),
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 952b55cc8c..b2d0b6c566 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -352,6 +352,15 @@ class bbcode_firstpass extends bbcode
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
}
+ $in = str_replace(' ', '%20', $in);
+
+ // Make sure $in is a URL.
+ if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) &&
+ !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in))
+ {
+ return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
+ }
+
// Apply the same size checks on flash files as on images
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index da3833754e..29cdd8ee9a 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -122,7 +122,7 @@ class fulltext_mysql extends search_backend
if ($terms == 'all')
{
- $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#\+#', '#-#', '#\|#');
+ $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#');
$replace = array(' +', ' |', ' -', ' +', ' -', ' |');
$keywords = preg_replace($match, $replace, $keywords);
@@ -919,6 +919,14 @@ class fulltext_mysql extends search_backend
<dt><label>' . $user->lang['FULLTEXT_MYSQL_MBSTRING'] . '</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MBSTRING_EXPLAIN'] . '</span></dt>
<dd>' . (($this->mbstring_regex) ? $user->lang['YES'] : $user->lang['NO']). '</dd>
</dl>
+ <dl>
+ <dt><label>' . $user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd>' . $config['fulltext_mysql_min_word_len'] . '</dd>
+ </dl>
+ <dl>
+ <dt><label>' . $user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dd>' . $config['fulltext_mysql_max_word_len'] . '</dd>
+ </dl>
';
// These are fields required in the config table
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index c89e92711e..727e3aaffb 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -83,7 +83,9 @@ class fulltext_native extends search_backend
{
global $db, $user, $config;
- $keywords = trim($this->cleanup($keywords, '+-|()*'));
+ $tokens = '+-|()*';
+
+ $keywords = trim($this->cleanup($keywords, $tokens));
// allow word|word|word without brackets
if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false))
@@ -114,6 +116,15 @@ class fulltext_native extends search_backend
case ' ':
$keywords[$i] = '|';
break;
+ case '*':
+ if ($i === 0 || ($keywords[$i - 1] !== '*' && strcspn($keywords[$i - 1], $tokens) === 0))
+ {
+ if ($i === $n - 1 || ($keywords[$i + 1] !== '*' && strcspn($keywords[$i + 1], $tokens) === 0))
+ {
+ $keywords = substr($keywords, 0, $i) . substr($keywords, $i + 1);
+ }
+ }
+ break;
}
}
else
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 0a01b4e73b..5f5b39fe27 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -285,6 +285,17 @@ class session
break;
}
+ // Quick check for IPv4-mapped address in IPv6
+ if (stripos($ip, '::ffff:') === 0)
+ {
+ $ipv4 = substr($ip, 7);
+
+ if (preg_match(get_preg_expression('ipv4'), $ipv4))
+ {
+ $ip = $ipv4;
+ }
+ }
+
// Use the last in chain
$this->ip = $ip;
}
@@ -748,7 +759,7 @@ class session
if ((int) $row['sessions'] > (int) $config['active_sessions'])
{
- header('HTTP/1.1 503 Service Unavailable');
+ send_status_line(503, 'Service Unavailable');
trigger_error('BOARD_UNAVAILABLE');
}
}
@@ -1821,7 +1832,7 @@ class user extends session
{
if ($this->data['is_bot'])
{
- header('HTTP/1.1 503 Service Unavailable');
+ send_status_line(503, 'Service Unavailable');
}
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
@@ -1831,7 +1842,7 @@ class user extends session
// Is load exceeded?
if ($config['limit_load'] && $this->load !== false)
{
- if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN'))
+ if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))
{
// Set board disabled to true to let the admins/mods get the proper notification
$config['board_disable'] = '1';
@@ -1840,7 +1851,7 @@ class user extends session
{
if ($this->data['is_bot'])
{
- header('HTTP/1.1 503 Service Unavailable');
+ send_status_line(503, 'Service Unavailable');
}
trigger_error('BOARD_UNAVAILABLE');
}
@@ -2134,9 +2145,9 @@ class user extends session
// Zone offset
$zone_offset = $this->timezone + $this->dst;
- // Show date <= 1 hour ago as 'xx min ago'
+ // Show date <= 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
- if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
+ if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
}
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index f1c8094a9b..6347633b14 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -205,7 +205,7 @@ class template
{
global $user, $phpbb_hook;
- if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
+ if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
{
if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
{
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index 03a4c81f46..d19b80f4c0 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -22,7 +22,7 @@ class ucp_profile_info
'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')),
- 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => '', '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_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 423d9b718a..1c055a4823 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -490,7 +490,7 @@ class ucp_groups
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
+ $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
// Did we submit?
if ($update)
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 6ac2412ef0..a6f71669ce 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -119,7 +119,7 @@ class ucp_main
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$folder_img = ($unread_topic) ? $folder_new : $folder;
- $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
+ $folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
if ($row['topic_status'] == ITEM_LOCKED)
{
@@ -318,7 +318,7 @@ class ucp_main
else
{
$folder_image = ($unread_forum) ? 'forum_unread' : 'forum_read';
- $folder_alt = ($unread_forum) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
+ $folder_alt = ($unread_forum) ? 'UNREAD_POSTS' : 'NO_UNREAD_POSTS';
}
// Create last post link information, if appropriate
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 26968e1382..b91636a9c8 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -172,6 +172,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Number of "to" recipients
$num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
+ $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;
+
$template->assign_vars(array(
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
@@ -229,6 +231,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false,
'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
'S_PM_RECIPIENTS' => $num_recipients,
+ 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0,
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=print" : '',
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&amp;mode=compose&amp;action=forward&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '')
@@ -309,7 +312,7 @@ function get_user_information($user_id, $user_row)
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
- if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email'))
+ if ((!empty($user_row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
$user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']);
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index f4f4abad4a..c099e3b3fa 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -141,10 +141,7 @@ class ucp_profile
$server_url = generate_board_url();
- $user_actkey = gen_rand_string(10);
- $key_len = 54 - (strlen($server_url));
- $key_len = ($key_len > 6) ? $key_len : 6;
- $user_actkey = substr($user_actkey, 0, $key_len);
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
$messenger = new messenger(false);
@@ -564,7 +561,7 @@ class ucp_profile
$avatar_select = basename(request_var('avatar_select', ''));
$category = basename(request_var('category', ''));
- $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
add_form_key('ucp_avatar');
@@ -572,7 +569,7 @@ class ucp_profile
{
if (check_form_key('ucp_avatar'))
{
- if (avatar_process_user($error))
+ if (avatar_process_user($error, false, $can_upload))
{
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 9656a4a3af..7fd99da55a 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -286,11 +286,7 @@ class ucp_register
$config['require_activation'] == USER_ACTIVATION_SELF ||
$config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable'])
{
- $user_actkey = gen_rand_string(10);
- $key_len = 54 - (strlen($server_url));
- $key_len = ($key_len < 6) ? 6 : $key_len;
- $user_actkey = substr($user_actkey, 0, $key_len);
-
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
$user_type = USER_INACTIVE;
$user_inactive_reason = INACTIVE_REGISTER;
$user_inactive_time = time();
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index f9b792de20..cb89ad99be 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -79,10 +79,10 @@ class ucp_remind
// Make password at least 8 characters long, make it longer if admin wants to.
// gen_rand_string() however has a limit of 12 or 13.
- $user_password = gen_rand_string(max(8, rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
+ $user_password = gen_rand_string_friendly(max(8, mt_rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
// For the activation key a random length between 6 and 10 will do.
- $user_actkey = gen_rand_string(rand(6, 10));
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
diff --git a/phpBB/index.php b/phpBB/index.php
index c3dbbd346e..cc83641acd 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -115,10 +115,10 @@ $template->assign_vars(array(
'LEGEND' => $legend,
'BIRTHDAY_LIST' => $birthday_list,
- 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
- 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
- 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
- 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
+ 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'),
+ 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'),
+ 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
+ 'FORUM_UNREAD_LOCKED_IMG' => $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'),
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index dfade990d2..b6eee8d621 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -32,7 +32,7 @@ unset($dbpasswd);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
- 'phpbb_version' => '3.0.7-PL1',
+ 'phpbb_version' => '3.0.8',
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
@@ -134,7 +134,7 @@ $config_schema = array(
'avatar_filesize' => 'avatar_filesize',
'avatar_max_width' => 'avatar_max_width',
'avatar_max_height' => 'avatar_max_height',
- 'default_dateformat' => 'default_dateformat',
+ 'default_dateformat' => 'phpbb_set_encoding(default_dateformat)',
'board_timezone' => 'board_timezone',
'allow_privmsg' => 'not(privmsg_disable)',
'gzip_compress' => 'gzip_compress',
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index b80c7673e3..78224dd5da 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1239,9 +1239,9 @@ function phpbb_prepare_message($message)
// Already the new user id ;)
$user_id = $convert->row['poster_id'];
+ $message = str_replace('<br />', "\n", $message);
$message = str_replace('<', '&lt;', $message);
$message = str_replace('>', '&gt;', $message);
- $message = str_replace('<br />', "\n", $message);
// make the post UTF-8
$message = phpbb_set_encoding($message);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 47d261dc46..10308826e0 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.8-dev';
+$updates_to_version = '3.0.9-dev';
// Enter any version to update from to test updates. The version within the db will not be updated.
$debug_from_version = false;
@@ -119,6 +119,7 @@ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
unset($dbpasswd);
$user->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
+$user->ip = (stripos($user->ip, '::ffff:') === 0) ? substr($user->ip, 7) : $user->ip;
$sql = "SELECT config_value
FROM " . CONFIG_TABLE . "
@@ -476,7 +477,7 @@ else
<p><?php echo ((isset($lang['INLINE_UPDATE_SUCCESSFUL'])) ? $lang['INLINE_UPDATE_SUCCESSFUL'] : 'The database update was successful. Now you need to continue the update process.'); ?></p>
- <p><a href="<?php echo append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode=update&amp;sub=file_check&amp;lang=$language"); ?>" class="button1"><?php echo (isset($lang['CONTINUE_UPDATE_NOW'])) ? $lang['CONTINUE_UPDATE_NOW'] : 'Continue the update process now'; ?></a></p>
+ <p><a href="<?php echo append_sid("{$phpbb_root_path}install/index.{$phpEx}", "mode=update&amp;sub=file_check&amp;language=$language"); ?>" class="button1"><?php echo (isset($lang['CONTINUE_UPDATE_NOW'])) ? $lang['CONTINUE_UPDATE_NOW'] : 'Continue the update process now'; ?></a></p>
<?php
}
@@ -684,9 +685,7 @@ function _add_modules($modules_to_install)
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($module_data['class']) . "'
AND parent_id = {$parent_id}
- AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}
- GROUP BY left_id
- ORDER BY left_id";
+ AND left_id BETWEEN {$first_left_id} AND {$module_row['left_id']}";
$result = $db->sql_query($sql);
$steps = (int) $db->sql_fetchfield('num_modules');
$db->sql_freeresult($result);
@@ -881,7 +880,7 @@ function database_update_info()
'pm_id' => array('pm_id'),
),
POSTS_TABLE => array(
- 'post_username' => array('post_username'),
+ 'post_username' => array('post_username:255'),
),
),
),
@@ -915,6 +914,8 @@ function database_update_info()
'3.0.7' => array(),
// No changes from 3.0.7-PL1 to 3.0.8-RC1
'3.0.7-PL1' => array(),
+ // No changes from 3.0.8-RC1 to 3.0.8
+ '3.0.8-RC1' => array(),
);
}
@@ -925,7 +926,7 @@ function database_update_info()
*****************************************************************************/
function change_database_data(&$no_updates, $version)
{
- global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $user;
+ global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx;
switch ($version)
{
@@ -1653,40 +1654,210 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.0.7-PL1 to 3.0.8-RC1
case '3.0.7-PL1':
- $user->add_lang('acp/attachments');
- $extension_groups = array(
- $user->lang['EXT_GROUP_ARCHIVES'] => 'ARCHIVES',
- $user->lang['EXT_GROUP_DOCUMENTS'] => 'DOCUMENTS',
- $user->lang['EXT_GROUP_DOWNLOADABLE_FILES'] => 'DOWNLOADABLE_FILES',
- $user->lang['EXT_GROUP_FLASH_FILES'] => 'FLASH_FILES',
- $user->lang['EXT_GROUP_IMAGES'] => 'IMAGES',
- $user->lang['EXT_GROUP_PLAIN_TEXT'] => 'PLAIN_TEXT',
- $user->lang['EXT_GROUP_QUICKTIME_MEDIA'] => 'QUICKTIME_MEDIA',
- $user->lang['EXT_GROUP_REAL_MEDIA'] => 'REAL_MEDIA',
- $user->lang['EXT_GROUP_WINDOWS_MEDIA'] => 'WINDOWS_MEDIA',
+ // Update file extension group names to use language strings.
+ $sql = 'SELECT lang_dir
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+
+ $extension_groups_updated = array();
+ while ($lang_dir = $db->sql_fetchfield('lang_dir'))
+ {
+ $lang_dir = basename($lang_dir);
+
+ // The language strings we need are either in language/.../acp/attachments.php
+ // in the update package if we're updating to 3.0.8-RC1 or later,
+ // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier.
+ // On an already updated board, they can also already be in language/.../acp/attachments.php
+ // in the board root.
+ $lang_files = array(
+ "{$phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.$phpEx",
+ "{$phpbb_root_path}language/$lang_dir/install.$phpEx",
+ "{$phpbb_root_path}language/$lang_dir/acp/attachments.$phpEx",
+ );
+
+ foreach ($lang_files as $lang_file)
+ {
+ if (!file_exists($lang_file))
+ {
+ continue;
+ }
+
+ $lang = array();
+ include($lang_file);
+
+ foreach($lang as $lang_key => $lang_val)
+ {
+ if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
+ {
+ continue;
+ }
+
+ $sql_ary = array(
+ 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_'
+ );
+
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE group_name = '" . $db->sql_escape($lang_val) . "'";
+ _sql($sql, $errored, $error_ary);
+
+ $extension_groups_updated[$lang_key] = true;
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ // Install modules
+ $modules_to_install = array(
+ 'post' => array(
+ 'base' => 'board',
+ 'class' => 'acp',
+ 'title' => 'ACP_POST_SETTINGS',
+ 'auth' => 'acl_a_board',
+ 'cat' => 'ACP_MESSAGES',
+ 'after' => array('message', 'ACP_MESSAGE_SETTINGS')
+ ),
);
- $sql = 'SELECT group_id, group_name
- FROM ' . EXTENSION_GROUPS_TABLE;
+ _add_modules($modules_to_install);
+
+ // update
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\'
+ WHERE module_class = \'ucp\'
+ AND module_basename = \'profile\'
+ AND module_mode = \'avatar\'';
+ _sql($sql, $errored, $error_ary);
+
+ // add Bing Bot
+ $bot_name = 'Bing [Bot]';
+ $bot_name_clean = utf8_clean_string($bot_name);
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'";
$result = $db->sql_query($sql);
+ $bing_already_added = (bool) $db->sql_fetchfield('user_id');
+ $db->sql_freeresult($result);
- while ($row = $db->sql_fetchrow($result))
+ if (!$bing_already_added)
{
- if (isset($extension_groups[$row['group_name']]))
+ $bot_agent = 'bingbot/';
+ $bot_ip = '';
+ $sql = 'SELECT group_id, group_colour
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $db->sql_query($sql);
+ $group_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$group_row)
{
- $sql_ary = array(
- 'group_name' => $extension_groups[$row['group_name']],
- );
- $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE group_id = ' . (int) $row['group_id'];
- _sql($sql, $errored, $error_ary);
+ // default fallback, should never get here
+ $group_row['group_id'] = 6;
+ $group_row['group_colour'] = '9E8DA7';
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
+
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_row['group_id'],
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => $group_row['group_colour'],
+ 'user_email' => '',
+ 'user_lang' => $config['default_lang'],
+ 'user_style' => $config['default_style'],
+ 'user_timezone' => 0,
+ 'user_dateformat' => $config['default_dateformat'],
+ 'user_allow_massemail' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'bot_active' => 1,
+ 'bot_name' => (string) $bot_name,
+ 'user_id' => (int) $user_id,
+ 'bot_agent' => (string) $bot_agent,
+ 'bot_ip' => (string) $bot_ip,
+ ));
+
+ _sql($sql, $errored, $error_ary);
+ }
+ // end Bing Bot addition
+
+ // Delete shadow topics pointing to not existing topics
+ $batch_size = 500;
+
+ // Set of affected forums we have to resync
+ $sync_forum_ids = array();
+
+ do
+ {
+ $sql_array = array(
+ 'SELECT' => 't1.topic_id, t1.forum_id',
+ 'FROM' => array(
+ TOPICS_TABLE => 't1',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(TOPICS_TABLE => 't2'),
+ 'ON' => 't1.topic_moved_id = t2.topic_id',
+ ),
+ ),
+ 'WHERE' => 't1.topic_moved_id <> 0
+ AND t2.topic_id IS NULL',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query_limit($sql, $batch_size);
+
+ $topic_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topic_ids[] = (int) $row['topic_id'];
+
+ $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!empty($topic_ids))
+ {
+ $sql = 'DELETE FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
+ $db->sql_query($sql);
+ }
+ }
+ while (sizeof($topic_ids) == $batch_size);
+
+ // Sync the forums we have deleted shadow topics from.
+ sync('forum', 'forum_id', $sync_forum_ids, true, true);
+
+ // Unread posts search load switch
+ set_config('load_unreads_search', '1');
+
+ // Reduce queue interval to 60 seconds, email package size to 20
+ if ($config['queue_interval'] == 600)
+ {
+ set_config('queue_interval', '60');
}
- $db->sql_freeresult($result);
+ if ($config['email_package_size'] == 50)
+ {
+ set_config('email_package_size', '20');
+ }
$no_updates = false;
break;
+
+ // No changes from 3.0.8-RC1 to 3.0.8
+ case '3.0.8-RC1':
+ break;
}
}
@@ -1833,7 +2004,7 @@ class updater_db_tools
'VCHAR_CI' => '[varchar] (255)',
'VARBINARY' => '[varchar] (255)',
),
-
+
'mssqlnative' => array(
'INT:' => '[int]',
'BINT' => '[float]',
@@ -1863,7 +2034,7 @@ class updater_db_tools
'VCHAR_CI' => '[varchar] (255)',
'VARBINARY' => '[varchar] (255)',
),
-
+
'oracle' => array(
'INT:' => 'number(%d)',
'BINT' => 'number(20)',
@@ -2010,7 +2181,7 @@ class updater_db_tools
case 'mssql_odbc':
$this->sql_layer = 'mssql';
break;
-
+
case 'mssqlnative':
$this->sql_layer = 'mssqlnative';
break;
@@ -2031,7 +2202,7 @@ class updater_db_tools
* drop_columns: Removing/Dropping columns
* add_primary_keys: adding primary keys
* add_unique_index: adding an unique index
- * add_index: adding an index
+ * add_index: adding an index (can be column:index_size if you need to provide size)
*
* The values are in this format:
* {TABLE NAME} => array(
@@ -3410,6 +3581,12 @@ class updater_db_tools
{
$statements = array();
+ // remove index length unless MySQL4
+ if ('mysql_40' != $this->sql_layer)
+ {
+ $column = preg_replace('#:.*$#', '', $column);
+ }
+
switch ($this->sql_layer)
{
case 'firebird':
@@ -3420,6 +3597,16 @@ class updater_db_tools
break;
case 'mysql_40':
+ // add index size to definition as required by MySQL4
+ foreach ($column as $i => $col)
+ {
+ if (false !== strpos($col, ':'))
+ {
+ list($col, $index_size) = explode(':', $col);
+ $column[$i] = "$col($index_size)";
+ }
+ }
+ // no break
case 'mysql_41':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
break;
@@ -3616,4 +3803,4 @@ class updater_db_tools
}
}
-?> \ No newline at end of file
+?>
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 06c3a8b4a6..814b50cf68 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -685,7 +685,7 @@ class install_convert extends module
// Thanks MySQL, for silently converting...
case 'mysql':
case 'mysql4':
- if (version_compare($src_db->sql_server_info(true), '4.1.3', '>='))
+ if (version_compare($src_db->sql_server_info(true, false), '4.1.3', '>='))
{
$convert->mysql_convert = true;
}
@@ -835,7 +835,7 @@ class install_convert extends module
$this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__);
}
- if (!$local_path || !@is_writable($phpbb_root_path . $local_path))
+ if (!$local_path || !phpbb_is_writable($phpbb_root_path . $local_path))
{
if (!$local_path)
{
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index f4989b5bd7..2dd58584f4 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -486,7 +486,7 @@ class install_install extends module
$write = $exists = true;
if (file_exists($phpbb_root_path . $dir))
{
- if (!@is_writable($phpbb_root_path . $dir))
+ if (!phpbb_is_writable($phpbb_root_path . $dir))
{
$write = false;
}
@@ -906,7 +906,7 @@ class install_install extends module
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
- if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) || is_writable($phpbb_root_path))
+ if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
{
// Assume it will work ... if nothing goes wrong below
$written = true;
@@ -1236,6 +1236,7 @@ class install_install extends module
$current_time = time();
$user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
+ $user_ip = (stripos($user_ip, '::ffff:') === 0) ? substr($user_ip, 7) : $user_ip;
if ($data['script_path'] !== '/')
{
@@ -2108,6 +2109,7 @@ class install_install extends module
'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'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/', ''),
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index e717fe3dd4..ec76f2a407 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -192,6 +192,17 @@ class install_update extends module
return;
}
+ // Check if the update files are actually meant to update from the current version
+ if ($this->current_version != $this->update_info['version']['from'])
+ {
+ $this->unequal_version = true;
+
+ $template->assign_vars(array(
+ 'S_ERROR' => true,
+ 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $this->current_version, $this->update_info['version']['from'], $this->update_info['version']['to']),
+ ));
+ }
+
// Check if the update files stored are for the latest version...
if ($this->latest_version != $this->update_info['version']['to'])
{
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index e815615eef..355af802ef 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -94,7 +94,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1');
@@ -168,6 +168,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_unreads_search', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1');
@@ -208,7 +209,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '600');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1');
@@ -241,7 +242,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.8-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.9-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
@@ -828,4 +829,4 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm');
-# POSTGRES COMMIT # \ No newline at end of file
+# POSTGRES COMMIT #
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 52389d85b9..5293b835d6 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -50,7 +50,8 @@ $lang = array_merge($lang, array(
'SITE_DESC' => 'Site description',
'SITE_NAME' => 'Site name',
'SYSTEM_DST' => 'Enable Summer Time/<abbr title="Daylight Saving Time">DST</abbr>',
- 'SYSTEM_TIMEZONE' => 'System timezone',
+ '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.',
));
@@ -176,8 +177,8 @@ $lang = array_merge($lang, array(
'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message.',
'POSTING' => 'Posting',
'POSTS_PER_PAGE' => 'Posts per page',
- 'QUOTE_DEPTH_LIMIT' => 'Maximum nested quotes per post',
- 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Maximum number of nested quotes in a post. Set to 0 for unlimited depth.',
+ 'QUOTE_DEPTH_LIMIT' => 'Maximum nesting depth for quotes',
+ 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Maximum quote nesting depth in a post. Set to 0 for unlimited depth.',
'SMILIES_LIMIT' => 'Maximum smilies per post',
'SMILIES_LIMIT_EXPLAIN' => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.',
'SMILIES_PER_PAGE' => 'Smilies per page',
@@ -232,7 +233,7 @@ $lang = array_merge($lang, array(
'PASSWORD_LENGTH' => 'Password length',
'PASSWORD_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in passwords.',
'REG_LIMIT' => 'Registration attempts',
- 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.',
+ 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at solving the anti-spambot task before being locked out of that session.',
'USERNAME_ALPHA_ONLY' => 'Alphanumeric only',
'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers',
'USERNAME_ASCII' => 'ASCII (no international unicode)',
@@ -287,44 +288,44 @@ $lang = array_merge($lang, array(
// Visual Confirmation Settings
$lang = array_merge($lang, array(
- 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you can select and configure CAPTCHA plugins, which implement various ways to reject registration attempts from so-called spambots.',
+ 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you can select and configure plugins, which are designed to block automated form submissions by spambots. These plugins typically work by challenging the user with a <em>CAPTCHA</em>, a test which is designed to be difficult for computers to solve.',
'AVAILABLE_CAPTCHAS' => 'Available plugins',
- 'CAPTCHA_UNAVAILABLE' => 'The CAPTCHA cannot be selected as its requirements are not met.',
- 'CAPTCHA_GD' => 'GD CAPTCHA',
- 'CAPTCHA_GD_3D' => 'GD 3D Captcha',
- 'CAPTCHA_GD_FOREGROUND_NOISE' => 'GD CAPTCHA foreground noise',
- 'CAPTCHA_GD_EXPLAIN' => 'Use GD to make a more advanced CAPTCHA.',
- 'CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN' => 'Use foreground noise to make the GD based CAPTCHA harder.',
- 'CAPTCHA_GD_X_GRID' => 'GD CAPTCHA background noise x-axis',
- 'CAPTCHA_GD_X_GRID_EXPLAIN' => 'Use lower settings of this to make the GD based CAPTCHA harder. 0 will disable x-axis background noise.',
- 'CAPTCHA_GD_Y_GRID' => 'GD CAPTCHA background noise y-axis',
- 'CAPTCHA_GD_Y_GRID_EXPLAIN' => 'Use lower settings of this to make the GD based CAPTCHA harder. 0 will disable y-axis background noise.',
- 'CAPTCHA_GD_WAVE' => 'GD CAPTCHA wave distortion',
- 'CAPTCHA_GD_WAVE_EXPLAIN' => 'This applies a wave distortion to the CAPTCHA.',
+ 'CAPTCHA_UNAVAILABLE' => 'The plugin cannot be selected as its requirements are not met.',
+ 'CAPTCHA_GD' => 'GD image',
+ 'CAPTCHA_GD_3D' => 'GD 3D image',
+ 'CAPTCHA_GD_FOREGROUND_NOISE' => 'Foreground noise',
+ 'CAPTCHA_GD_EXPLAIN' => 'Uses GD to make a more advanced anti-spambot image.',
+ 'CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN' => 'Use foreground noise to make the image harder to read.',
+ 'CAPTCHA_GD_X_GRID' => 'Background noise x-axis',
+ 'CAPTCHA_GD_X_GRID_EXPLAIN' => 'Use lower settings of this to make the image harder to read. 0 will disable x-axis background noise.',
+ 'CAPTCHA_GD_Y_GRID' => 'Background noise y-axis',
+ 'CAPTCHA_GD_Y_GRID_EXPLAIN' => 'Use lower settings of this to make the image harder to read. 0 will disable y-axis background noise.',
+ 'CAPTCHA_GD_WAVE' => 'Wave distortion',
+ 'CAPTCHA_GD_WAVE_EXPLAIN' => 'This applies a wave distortion to the image.',
'CAPTCHA_GD_3D_NOISE' => 'Add 3D-noise objects',
- 'CAPTCHA_GD_3D_NOISE_EXPLAIN' => 'This adds additional objects to the CAPTCHA, over the letters.',
+ 'CAPTCHA_GD_3D_NOISE_EXPLAIN' => 'This adds additional objects to the image, over the letters.',
'CAPTCHA_GD_FONTS' => 'Use different fonts',
'CAPTCHA_GD_FONTS_EXPLAIN' => 'This setting controls how many different letter shapes are used. You can just use the default shapes or introduce altered letters. Adding lowercase letters is also possible.',
'CAPTCHA_FONT_DEFAULT' => 'Default',
'CAPTCHA_FONT_NEW' => 'New Shapes',
'CAPTCHA_FONT_LOWER' => 'Also use lowercase',
- 'CAPTCHA_NO_GD' => 'CAPTCHA without GD',
- 'CAPTCHA_PREVIEW_MSG' => 'Your changes to the visual confirmation setting were not saved. This is just a preview.',
- 'CAPTCHA_PREVIEW_EXPLAIN' => 'The CAPTCHA as it would look like using the current selection.',
-
- 'CAPTCHA_SELECT' => 'Installed CAPTCHA plugins',
- 'CAPTCHA_SELECT_EXPLAIN' => 'The dropdown holds the CAPTCHA plugins recognized by the board. Gray entries are not available right now and might need configuration prior to use.',
- 'CAPTCHA_CONFIGURE' => 'Configure CAPTCHAs',
- 'CAPTCHA_CONFIGURE_EXPLAIN' => 'Change the settings for the selected CAPTCHA.',
+ 'CAPTCHA_NO_GD' => 'Simple image',
+ 'CAPTCHA_PREVIEW_MSG' => 'Your changes have not been saved, this is just a preview.',
+ 'CAPTCHA_PREVIEW_EXPLAIN' => 'The plugin as it would look like using the current selection.',
+
+ 'CAPTCHA_SELECT' => 'Installed plugins',
+ 'CAPTCHA_SELECT_EXPLAIN' => 'The dropdown holds the plugins recognised by the board. Grey entries are not available right now and might need configuration prior to use.',
+ 'CAPTCHA_CONFIGURE' => 'Configure plugins',
+ 'CAPTCHA_CONFIGURE_EXPLAIN' => 'Change the settings for the selected plugin.',
'CONFIGURE' => 'Configure',
- 'CAPTCHA_NO_OPTIONS' => 'This CAPTCHA has no configuration options.',
-
- 'VISUAL_CONFIRM_POST' => 'Enable visual confirmation for guest postings',
- 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.',
- 'VISUAL_CONFIRM_REG' => 'Enable visual confirmation for registrations',
- 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to enter a random code matching an image to help prevent mass registrations.',
- 'VISUAL_CONFIRM_REFRESH' => 'Enable users to refresh the confirmation image',
- 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request new confirmation codes, if they are unable to solve the VC during registration. Some plugins might not support this option.',
+ 'CAPTCHA_NO_OPTIONS' => 'This plugin has no configuration options.',
+
+ 'VISUAL_CONFIRM_POST' => 'Enable spambot countermeasures for guest postings',
+ 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires guest users to pass the anti-spambot task to help prevent automated postings.',
+ 'VISUAL_CONFIRM_REG' => 'Enable spambot countermeasures for registrations',
+ 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to pass the anti-spambot task to help prevent automated registrations.',
+ 'VISUAL_CONFIRM_REFRESH' => 'Allow users to refresh the anti-spambot task',
+ 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the current task during registration. Some plugins might not support this option.',
));
// Cookie Settings
@@ -359,7 +360,7 @@ $lang = array_merge($lang, array(
'RECOMPILE_STYLES' => 'Recompile stale style components',
'RECOMPILE_STYLES_EXPLAIN' => 'Check for updated style components on filesystem and recompile.',
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
- 'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled posts are always read for guests.',
+ 'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled, posts are always marked read for guests.',
'YES_BIRTHDAYS' => 'Enable birthday listing',
'YES_BIRTHDAYS_EXPLAIN' => 'If disabled the birthday listing is no longer displayed. To let this setting take effect the birthday feature needs to be enabled too.',
'YES_JUMPBOX' => 'Enable display of jumpbox',
@@ -374,6 +375,7 @@ $lang = array_merge($lang, array(
'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.',
'YES_READ_MARKING' => 'Enable server-side topic marking',
'YES_READ_MARKING_EXPLAIN' => 'Stores read/unread status information in the database rather than a cookie.',
+ 'YES_UNREAD_SEARCH' => 'Enable search for unread posts',
));
// Auth settings
@@ -392,7 +394,7 @@ $lang = array_merge($lang, array(
'LDAP_NO_EMAIL' => 'The specified e-mail attribute does not exist.',
'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.',
'LDAP_PASSWORD' => 'LDAP password',
- 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
+ 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding, otherwise fill in the password for the above user. Required for Active Directory Servers.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
'LDAP_PORT' => 'LDAP server port',
'LDAP_PORT_EXPLAIN' => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.',
'LDAP_SERVER' => 'LDAP server name',
@@ -461,7 +463,7 @@ $lang = array_merge($lang, array(
'IP_VALID' => 'Session IP validation',
'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; <samp>All</samp> compares the complete address, <samp>A.B.C</samp> the first x.x.x, <samp>A.B</samp> the first x.x, <samp>None</samp> disables checking. On IPv6 addresses <samp>A.B.C</samp> compares the first 4 blocks and <samp>A.B</samp> the first 3 blocks.',
'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts',
- 'MAX_LOGIN_ATTEMPTS_EXPLAIN' => 'After this number of failed logins the user needs to additionally confirm his login visually (visual confirmation).',
+ 'MAX_LOGIN_ATTEMPTS_EXPLAIN' => 'After this number of failed logins the user needs to additionally solve the anti-spambot task.',
'NO_IP_VALIDATION' => 'None',
'NO_REF_VALIDATION' => 'None',
'PASSWORD_TYPE' => 'Password complexity',
@@ -504,7 +506,7 @@ $lang = array_merge($lang, array(
'SMTP_DIGEST_MD5' => 'DIGEST-MD5',
'SMTP_LOGIN' => 'LOGIN',
'SMTP_PASSWORD' => 'SMTP password',
- 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
+ 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
'SMTP_PLAIN' => 'PLAIN',
'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP',
'SMTP_PORT' => 'SMTP server port',
@@ -527,7 +529,7 @@ $lang = array_merge($lang, array(
'JAB_PACKAGE_SIZE' => 'Jabber package size',
'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
'JAB_PASSWORD' => 'Jabber password',
- 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
+ 'JAB_PASSWORD_EXPLAIN' => '<em><strong>Warning:</strong> This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.</em>',
'JAB_PORT' => 'Jabber port',
'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.',
'JAB_SERVER' => 'Jabber server',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index bca19c7f12..8c71e936b3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -190,7 +190,7 @@ $lang = array_merge($lang, array(
'ACP_USER_SIG' => 'Signature',
'ACP_USER_WARNINGS' => 'Warnings',
- 'ACP_VC_SETTINGS' => 'CAPTCHA module settings',
+ 'ACP_VC_SETTINGS' => 'Spambot countermeasures',
'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview',
'ACP_VERSION_CHECK' => 'Check for updates',
'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions',
@@ -255,7 +255,7 @@ $lang = array_merge($lang, array(
'MOVE_UP' => 'Move up',
'NOTIFY' => 'Notification',
- 'NO_ADMIN' => 'You are not authorised to administrate this board.',
+ 'NO_ADMIN' => 'You are not authorised to administer this board.',
'NO_EMAILS_DEFINED' => 'No valid e-mail addresses found.',
'NO_PASSWORD_SUPPLIED' => 'You need to enter your password to access the Administration Control Panel.',
@@ -503,7 +503,7 @@ $lang = array_merge($lang, array(
'LOG_CONFIG_SERVER' => '<strong>Altered server settings</strong>',
'LOG_CONFIG_SETTINGS' => '<strong>Altered board settings</strong>',
'LOG_CONFIG_SIGNATURE' => '<strong>Altered signature settings</strong>',
- 'LOG_CONFIG_VISUAL' => '<strong>Altered antibot settings</strong>',
+ 'LOG_CONFIG_VISUAL' => '<strong>Altered anti-spambot settings</strong>',
'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s',
'LOG_BUMP_TOPIC' => '<strong>User bumped topic</strong><br />» %s',
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index e8c1a3c494..3444b98303 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -36,7 +36,7 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
- 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
+ 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
'ADD_USERS' => 'Add users',
'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.',
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index 88eed9d948..a7d687d7c2 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -59,6 +59,8 @@ $lang = array_merge($lang, array(
'FULLTEXT_MYSQL_PCRE' => 'Support for non-latin UTF-8 characters using PCRE:',
'FULLTEXT_MYSQL_MBSTRING_EXPLAIN' => 'If PCRE does not have unicode character properties, the search backend will try to use mbstring’s regular expression engine.',
'FULLTEXT_MYSQL_PCRE_EXPLAIN' => 'This search backend requires PCRE unicode character properties, only available in PHP 4.4, 5.1 and above, if you want to search for non-latin characters.',
+ 'FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
+ 'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index 247d8a4140..f161a7e6e6 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -76,13 +76,13 @@ $lang = array_merge($lang, array(
'DEACTIVATE_DEFAULT' => 'You cannot deactivate the default style.',
'DELETE_FROM_FS' => 'Delete from filesystem',
'DELETE_IMAGESET' => 'Delete imageset',
- 'DELETE_IMAGESET_EXPLAIN' => 'Here you can remove the selected imageset from the database. Additionally, if you have permission you can elect to remove the set from the filesystem. Please note that there is no undo capability. When the imageset is deleted it is gone for good. It is recommended that you first export your set for possible future use.',
+ 'DELETE_IMAGESET_EXPLAIN' => 'Here you can remove the selected imageset from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.',
'DELETE_STYLE' => 'Delete style',
- 'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. You cannot remove all the style elements from here. These must be deleted individually via their respective forms. Take care in deleting styles there is no undo facility.',
+ 'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. You cannot remove all the style elements from here. These must be deleted individually via their respective forms. Take care when deleting styles, there is no undo facility.',
'DELETE_TEMPLATE' => 'Delete template',
- 'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Additionally, if you have permission you can elect to remove the set from the filesystem. Please note that there is no undo capability. When the templates are deleted they are gone for good. It is recommended that you first export your set for possible future use.',
+ 'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.',
'DELETE_THEME' => 'Delete theme',
- 'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Additionally, if you have permission you can elect to remove the theme from the filesystem. Please note that there is no undo capability. When the theme is deleted it is gone for good. It is recommended that you first export your theme for possible future use.',
+ 'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Please note that there is no undo capability. It is recommended that you first export your theme for possible future use.',
'DETAILS' => 'Details',
'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.',
@@ -165,11 +165,11 @@ $lang = array_merge($lang, array(
'IMG_FORUM_READ' => 'Forum',
'IMG_FORUM_READ_LOCKED' => 'Forum locked',
'IMG_FORUM_READ_SUBFORUM' => 'Subforum',
- 'IMG_FORUM_UNREAD' => 'Forum new posts',
- 'IMG_FORUM_UNREAD_LOCKED' => 'Forum new posts locked',
- 'IMG_FORUM_UNREAD_SUBFORUM' => 'Subforum new posts',
+ 'IMG_FORUM_UNREAD' => 'Forum unread posts',
+ 'IMG_FORUM_UNREAD_LOCKED' => 'Forum unread posts locked',
+ 'IMG_FORUM_UNREAD_SUBFORUM' => 'Subforum unread posts',
'IMG_SUBFORUM_READ' => 'Legend subforum',
- 'IMG_SUBFORUM_UNREAD' => 'Legend subforum new posts',
+ 'IMG_SUBFORUM_UNREAD' => 'Legend subforum unread posts',
'IMG_TOPIC_MOVED' => 'Topic moved',
@@ -180,39 +180,39 @@ $lang = array_merge($lang, array(
'IMG_TOPIC_READ_LOCKED' => 'Topic locked',
'IMG_TOPIC_READ_LOCKED_MINE' => 'Topic locked posted to',
- 'IMG_TOPIC_UNREAD' => 'Topic new posts',
- 'IMG_TOPIC_UNREAD_MINE' => 'Topic posted to new',
- 'IMG_TOPIC_UNREAD_HOT' => 'Topic popular new posts',
- 'IMG_TOPIC_UNREAD_HOT_MINE' => 'Topic popular posted to new',
- 'IMG_TOPIC_UNREAD_LOCKED' => 'Topic locked new',
- 'IMG_TOPIC_UNREAD_LOCKED_MINE' => 'Topic locked posted to new',
+ 'IMG_TOPIC_UNREAD' => 'Topic unread posts',
+ 'IMG_TOPIC_UNREAD_MINE' => 'Topic posted to unread',
+ 'IMG_TOPIC_UNREAD_HOT' => 'Topic popular unread posts',
+ 'IMG_TOPIC_UNREAD_HOT_MINE' => 'Topic popular posted to unread',
+ 'IMG_TOPIC_UNREAD_LOCKED' => 'Topic locked unread',
+ 'IMG_TOPIC_UNREAD_LOCKED_MINE' => 'Topic locked posted to unread',
'IMG_STICKY_READ' => 'Sticky topic',
'IMG_STICKY_READ_MINE' => 'Sticky topic posted to',
'IMG_STICKY_READ_LOCKED' => 'Sticky topic locked',
'IMG_STICKY_READ_LOCKED_MINE' => 'Sticky topic locked posted to',
- 'IMG_STICKY_UNREAD' => 'Sticky topic new posts',
- 'IMG_STICKY_UNREAD_MINE' => 'Sticky topic posted to new',
- 'IMG_STICKY_UNREAD_LOCKED' => 'Sticky topic locked new posts',
- 'IMG_STICKY_UNREAD_LOCKED_MINE' => 'Sticky topic locked posted to new',
+ 'IMG_STICKY_UNREAD' => 'Sticky topic unread posts',
+ 'IMG_STICKY_UNREAD_MINE' => 'Sticky topic posted to unread',
+ 'IMG_STICKY_UNREAD_LOCKED' => 'Sticky topic locked unread posts',
+ 'IMG_STICKY_UNREAD_LOCKED_MINE' => 'Sticky topic locked posted to unread',
'IMG_ANNOUNCE_READ' => 'Announcement',
'IMG_ANNOUNCE_READ_MINE' => 'Announcement posted to',
'IMG_ANNOUNCE_READ_LOCKED' => 'Announcement locked',
'IMG_ANNOUNCE_READ_LOCKED_MINE' => 'Announcement locked posted to',
- 'IMG_ANNOUNCE_UNREAD' => 'Announcement new posts',
- 'IMG_ANNOUNCE_UNREAD_MINE' => 'Announcement posted to new',
- 'IMG_ANNOUNCE_UNREAD_LOCKED' => 'Announcement locked new posts',
- 'IMG_ANNOUNCE_UNREAD_LOCKED_MINE' => 'Announcement locked posted to new',
+ 'IMG_ANNOUNCE_UNREAD' => 'Announcement unread posts',
+ 'IMG_ANNOUNCE_UNREAD_MINE' => 'Announcement posted to unread',
+ 'IMG_ANNOUNCE_UNREAD_LOCKED' => 'Announcement locked unread posts',
+ 'IMG_ANNOUNCE_UNREAD_LOCKED_MINE' => 'Announcement locked posted to unread',
'IMG_GLOBAL_READ' => 'Global',
'IMG_GLOBAL_READ_MINE' => 'Global posted to',
'IMG_GLOBAL_READ_LOCKED' => 'Global locked',
'IMG_GLOBAL_READ_LOCKED_MINE' => 'Global locked posted to',
- 'IMG_GLOBAL_UNREAD' => 'Global new posts',
- 'IMG_GLOBAL_UNREAD_MINE' => 'Global posted to new',
- 'IMG_GLOBAL_UNREAD_LOCKED' => 'Global locked new posts',
- 'IMG_GLOBAL_UNREAD_LOCKED_MINE' => 'Global locked posted to new',
+ 'IMG_GLOBAL_UNREAD' => 'Global unread posts',
+ 'IMG_GLOBAL_UNREAD_MINE' => 'Global posted to unread',
+ 'IMG_GLOBAL_UNREAD_LOCKED' => 'Global locked unread posts',
+ 'IMG_GLOBAL_UNREAD_LOCKED_MINE' => 'Global locked posted to unread',
'IMG_PM_READ' => 'Read private message',
'IMG_PM_UNREAD' => 'Unread private message',
diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php
index 8d9bf0d486..eda9659795 100644
--- a/phpBB/language/en/acp/users.php
+++ b/phpBB/language/en/acp/users.php
@@ -42,6 +42,7 @@ $lang = array_merge($lang, array(
'BAN_ALREADY_ENTERED' => 'The ban had been previously entered successfully. The ban list has not been updated.',
'BAN_SUCCESSFUL' => 'Ban entered successfully.',
+ 'CANNOT_BAN_ANONYMOUS' => 'You are not allowed to ban the anonymous account. Permissions for anonymous users can be set under the Permissions tab.',
'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.',
'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.',
'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot within the bots page instead.',
diff --git a/phpBB/language/en/captcha_qa.php b/phpBB/language/en/captcha_qa.php
index 5cd822b3c4..42c8df2d6d 100644
--- a/phpBB/language/en/captcha_qa.php
+++ b/phpBB/language/en/captcha_qa.php
@@ -36,9 +36,9 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
- 'CAPTCHA_QA' => 'Q&amp;A CAPTCHA',
- 'CONFIRM_QUESTION_EXPLAIN' => 'This question is a means of identifying and preventing automated submissions.',
- 'CONFIRM_QUESTION_WRONG' => 'You have provided an invalid answer to the confirmation question.',
+ 'CAPTCHA_QA' => 'Q&amp;A',
+ 'CONFIRM_QUESTION_EXPLAIN' => 'This question is a means of preventing automated form submissions by spambots.',
+ 'CONFIRM_QUESTION_WRONG' => 'You have provided an invalid answer to the question.',
'QUESTION_ANSWERS' => 'Answers',
'ANSWERS_EXPLAIN' => 'Please enter valid answers to the question, one per line.',
@@ -47,15 +47,15 @@ $lang = array_merge($lang, array(
'ANSWER' => 'Answer',
'EDIT_QUESTION' => 'Edit Question',
'QUESTIONS' => 'Questions',
- 'QUESTIONS_EXPLAIN' => 'During registration, users will be asked one of the questions specified here. To use this plugin, at least one question must be set in the default language. These questions should be easy for your target audience to answer, but beyond the ability of a bot capable of running a Google™ search. Using a large and regulary changed set of questions will yield the best results. Enable the strict setting if your question relies on punctuation or capitalisation.',
+ 'QUESTIONS_EXPLAIN' => 'For every form submission where you have enabled the Q&amp;A plugin, users will be asked one of the questions specified here. To use this plugin at least one question must be set in the default language. These questions should be easy for your target audience to answer but beyond the ability of a bot capable of running a Google™ search. Using a large and regularly changed set of questions will yield the best results. Enable the strict setting if your question relies on mixed case, punctuation or whitespace.',
'QUESTION_DELETED' => 'Question deleted',
'QUESTION_LANG' => 'Language',
- 'QUESTION_LANG_EXPLAIN' => 'The language that this question and its answers are written in.',
+ 'QUESTION_LANG_EXPLAIN' => 'The language this question and its answers are written in.',
'QUESTION_STRICT' => 'Strict check',
- 'QUESTION_STRICT_EXPLAIN' => 'If enabled, capitalisation and whitespace will also be enforced.',
+ 'QUESTION_STRICT_EXPLAIN' => 'Enable to enforce mixed case, punctuation and whitespace.',
'QUESTION_TEXT' => 'Question',
- 'QUESTION_TEXT_EXPLAIN' => 'The question that will be asked on registration.',
+ 'QUESTION_TEXT_EXPLAIN' => 'The question presented to the user.',
'QA_ERROR_MSG' => 'Please fill in all fields and enter at least one answer.',
'QA_LAST_QUESTION' => 'You cannot delete all questions while the plugin is active.',
diff --git a/phpBB/language/en/captcha_recaptcha.php b/phpBB/language/en/captcha_recaptcha.php
index 897e8a4979..463bfffe0d 100644
--- a/phpBB/language/en/captcha_recaptcha.php
+++ b/phpBB/language/en/captcha_recaptcha.php
@@ -46,7 +46,7 @@ $lang = array_merge($lang, array(
'RECAPTCHA_PRIVATE' => 'Private reCaptcha key',
'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://recaptcha.net">reCaptcha.net</a>.',
- 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed below into the text field underneath.',
+ 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.',
));
?> \ No newline at end of file
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 03986c0361..db60cbf227 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -304,8 +304,8 @@ $lang = array_merge($lang, array(
'LOGIN' => 'Login',
'LOGIN_CHECK_PM' => 'Log in to check your private messages.',
'LOGIN_CONFIRMATION' => 'Confirmation of login',
- 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
- 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to enter the confirm code from the image you see below.',
+ 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', // unused
+ 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to solve the CAPTCHA below.',
'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by Apache.',
'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.',
'LOGIN_ERROR_PASSWORD_CONVERT' => 'It was not possible to convert your password when updating this bulletin board’s software. Please %srequest a new password%s. If you continue to have problems please contact the %sBoard Administrator%s.',
@@ -347,8 +347,8 @@ $lang = array_merge($lang, array(
'NEW_MESSAGES' => 'New messages',
'NEW_PM' => '<strong>%d</strong> new message',
'NEW_PMS' => '<strong>%d</strong> new messages',
- 'NEW_POST' => 'New post',
- 'NEW_POSTS' => 'New posts',
+ 'NEW_POST' => 'New post', // Not used anymore
+ 'NEW_POSTS' => 'New posts', // Not used anymore
'NEXT' => 'Next', // Used in pagination
'NEXT_STEP' => 'Next',
'NEVER' => 'Never',
@@ -381,7 +381,7 @@ $lang = array_merge($lang, array(
'NO_MODERATORS' => 'There are no moderators.',
'NO_NEW_MESSAGES' => 'No new messages',
'NO_NEW_PM' => '<strong>0</strong> new messages',
- 'NO_NEW_POSTS' => 'No new posts',
+ 'NO_NEW_POSTS' => 'No new posts', // Not used anymore
'NO_ONLINE_USERS' => 'No registered users',
'NO_POSTS' => 'No posts',
'NO_POSTS_TIME_FRAME' => 'No posts exist inside this topic for the selected time frame.',
@@ -395,6 +395,7 @@ $lang = array_merge($lang, array(
'NO_TOPICS' => 'There are no topics or posts in this forum.',
'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.',
'NO_UNREAD_PM' => '<strong>0</strong> unread messages',
+ 'NO_UNREAD_POSTS' => 'No unread posts',
'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.',
'NO_USER' => 'The requested user does not exist.',
'NO_USERS' => 'The requested users do not exist.',
@@ -565,6 +566,9 @@ $lang = array_merge($lang, array(
'TEST_CONNECTION' => 'Test connection',
'THE_TEAM' => 'The team',
'TIME' => 'Time',
+
+ 'TOO_LARGE' => 'The value you entered is too large.',
+ 'TOO_LARGE_MAX_RECIPIENTS' => 'The value of <strong>Maximum number of allowed recipients per private message</strong> setting you entered is too large.',
'TOO_LONG' => 'The value you entered is too long.',
@@ -607,6 +611,9 @@ $lang = array_merge($lang, array(
'TOO_SHORT_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too short.',
'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.',
'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.',
+
+ 'TOO_SMALL' => 'The value you entered is too small.',
+ 'TOO_SMALL_MAX_RECIPIENTS' => 'The value of <strong>Maximum number of allowed recipients per private message</strong> setting you entered is too small.',
'TOPIC' => 'Topic',
'TOPICS' => 'Topics',
@@ -641,6 +648,8 @@ $lang = array_merge($lang, array(
'UNREAD_MESSAGES' => 'Unread messages',
'UNREAD_PM' => '<strong>%d</strong> unread message',
'UNREAD_PMS' => '<strong>%d</strong> unread messages',
+ 'UNREAD_POST' => 'Unread post',
+ 'UNREAD_POSTS' => 'Unread posts',
'UNWATCHED_FORUMS' => 'You are no longer subscribed to the selected forums.',
'UNWATCHED_TOPICS' => 'You are no longer subscribed to the selected topics.',
'UNWATCHED_FORUMS_TOPICS' => 'You are no longer subscribed to the selected entries.',
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index c76c281df5..3b7dc02d3f 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -128,7 +128,7 @@ $help = array(
),
array(
0 => 'Why can’t I add more poll options?',
- 1 => 'The limit for poll options is set by the board administrator. If you feel you need to add more options to your poll then the allowed amount, contact the board administrator.'
+ 1 => 'The limit for poll options is set by the board administrator. If you feel you need to add more options to your poll than the allowed amount, contact the board administrator.'
),
array(
0 => 'How do I edit or delete a poll?',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 4e58de8d90..11c5d78359 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -128,7 +128,7 @@ $lang = array_merge($lang, array(
'DB_ERR_QUERY_FIRST_TABLE' => 'Error while executing <var>query_first</var>, %s (“%s”).',
'DB_ERR_SELECT' => 'Error while running <code>SELECT</code> query.',
'DB_HOST' => 'Database server hostname or DSN',
- 'DB_HOST_EXPLAIN' => 'DSN stands for Data Source Name and is relevant only for ODBC installs. On PostgreSQL, use localhost to connect to the local server via UNIX domain socket and 127.0.0.1 to connect via TCP.',
+ 'DB_HOST_EXPLAIN' => 'DSN stands for Data Source Name and is relevant only for ODBC installs. On PostgreSQL, use localhost to connect to the local server via UNIX domain socket and 127.0.0.1 to connect via TCP. For SQLite, enter the full path to your database file.',
'DB_NAME' => 'Database name',
'DB_PASSWORD' => 'Database password',
'DB_PORT' => 'Database server port',
@@ -370,7 +370,7 @@ $lang = array_merge($lang, array(
// Updater
$lang = array_merge($lang, array(
- 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.',
+ 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.',
'ARCHIVE_FILE' => 'Source file within archive',
'BACK' => 'Back',
@@ -559,6 +559,7 @@ $lang = array_merge($lang, array(
'UPDATING_DATA' => 'Updating data',
'UPDATING_TO_LATEST_STABLE' => 'Updating database to latest stable release',
'UPDATED_VERSION' => 'Updated version',
+ 'UPGRADE_INSTRUCTIONS' => 'A new feature release <strong>%1$s</strong> is available. Please read <a href="%2$s" title="%2$s"><strong>the release announcement</strong></a> to learn about what it has to offer, and how to upgrade.',
'UPLOAD_METHOD' => 'Upload method',
'UPDATE_DB_SUCCESS' => 'Database update was successful.',
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index e7a9c6b88d..213f766610 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -131,7 +131,7 @@ $lang = array_merge($lang, array(
'SORT_POST_COUNT' => 'Post count',
'USERNAME_BEGINS_WITH' => 'Username begins with',
- 'USER_ADMIN' => 'Administrate user',
+ 'USER_ADMIN' => 'Administer user',
'USER_BAN' => 'Banning',
'USER_FORUM' => 'User statistics',
'USER_LAST_REMINDED' => array(
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index be92391a4e..cd38cd615f 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -54,6 +54,7 @@ $lang = array_merge($lang, array(
'LOGIN_EXPLAIN_EGOSEARCH' => 'The board requires you to be registered and logged in to view your own posts.',
'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
+ 'LOGIN_EXPLAIN_NEWPOSTS' => 'The board requires you to be registered and logged in to view new posts since your last visit.',
'MAX_NUM_SEARCH_KEYWORDS_REFINE' => 'You specified too many words to search for. Please do not enter more than %1$d words.',
@@ -62,6 +63,7 @@ $lang = array_merge($lang, array(
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.',
+ 'NO_SEARCH_UNREADS' => 'Sorry but searching for unread posts has been disabled on this board.',
'WORD_IN_NO_POST' => 'No posts were found because the word <strong>%s</strong> is not contained in any post.',
'WORDS_IN_NO_POST' => 'No posts were found because the words <strong>%s</strong> are not contained in any post.',
diff --git a/phpBB/language/en/search_synonyms.php b/phpBB/language/en/search_synonyms.php
index 1618c292d3..e544456226 100644
--- a/phpBB/language/en/search_synonyms.php
+++ b/phpBB/language/en/search_synonyms.php
@@ -77,7 +77,7 @@ $synonyms = array(
'foriegn' => 'foreign',
'fourty' => 'forty',
- 'gage' => 'guage',
+ 'gage' => 'gauge',
'geneology' => 'genealogy',
'grammer' => 'grammar',
'gray' => 'grey',
@@ -98,7 +98,7 @@ $synonyms = array(
'irrevelant' => 'irrelevant',
'jeweler' => 'jeweller',
- 'judgement' => 'judgment',
+ 'judgment' => 'judgement',
'labeled' => 'labelled',
'labor' => 'labour',
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index 546f91587d..d2fae20c62 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -48,16 +48,21 @@ $lang = array_merge($lang, array(
'MARK_TOPICS_READ' => 'Mark topics read',
- 'NEW_POSTS_HOT' => 'New posts [ Popular ]',
- 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]',
- 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]',
- 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]',
+ 'NEW_POSTS_HOT' => 'New posts [ Popular ]', // Not used anymore
+ 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', // Not used anymore
+ 'NO_NEW_POSTS_HOT' => 'No new posts [ Popular ]', // Not used anymore
+ 'NO_NEW_POSTS_LOCKED' => 'No new posts [ Locked ]', // Not used anymore
'NO_READ_ACCESS' => 'You do not have the required permissions to read topics within this forum.',
+ 'NO_UNREAD_POSTS_HOT' => 'No unread posts [ Popular ]',
+ 'NO_UNREAD_POSTS_LOCKED' => 'No unread posts [ Locked ]',
'POST_FORUM_LOCKED' => 'Forum is locked',
'TOPICS_MARKED' => 'The topics for this forum have now been marked read.',
+ 'UNREAD_POSTS_HOT' => 'Unread posts [ Popular ]',
+ 'UNREAD_POSTS_LOCKED' => 'Unread posts [ Locked ]',
+
'VIEW_FORUM' => 'View forum',
'VIEW_FORUM_TOPIC' => '1 topic',
'VIEW_FORUM_TOPICS' => '%d topics',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index b46230b10a..2fa2d11ee1 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1607,7 +1607,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
$rank_title = $rank_img = $rank_img_src = '';
get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
- if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user'))
+ if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user'))
{
$email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&amp;u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']);
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index df063ef391..7368026136 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -402,6 +402,19 @@ if ($post_data['poll_start'])
$db->sql_freeresult($result);
}
+if ($mode == 'edit')
+{
+ $original_poll_data = array(
+ 'poll_title' => $post_data['poll_title'],
+ 'poll_length' => $post_data['poll_length'],
+ 'poll_max_options' => $post_data['poll_max_options'],
+ 'poll_option_text' => implode("\n", $post_data['poll_options']),
+ 'poll_start' => $post_data['poll_start'],
+ 'poll_last_vote' => $post_data['poll_last_vote'],
+ 'poll_vote_change' => $post_data['poll_vote_change'],
+ );
+}
+
$orig_poll_options_size = sizeof($post_data['poll_options']);
$message_parser = new parse_message();
@@ -848,11 +861,18 @@ if ($submit || $preview || $refresh)
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ $user->add_lang('ucp');
+
if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)
{
- $user->add_lang('ucp');
$error[] = $user->lang[$result . '_USERNAME'];
}
+
+ if (($result = validate_string($post_data['username'], false, $config['min_name_chars'], $config['max_name_chars'])) !== false)
+ {
+ $min_max_amount = ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars'];
+ $error[] = sprintf($user->lang['FIELD_' . $result], $user->lang['USERNAME'], $min_max_amount);
+ }
}
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
@@ -912,6 +932,22 @@ if ($submit || $preview || $refresh)
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
}*/
}
+ else if (!$auth->acl_get('f_poll', $forum_id) && ($mode == 'edit') && ($post_id == $post_data['topic_first_post_id']) && ($original_poll_data['poll_title'] != ''))
+ {
+ // We have a poll but the editing user is not permitted to create/edit it.
+ // So we just keep the original poll-data.
+ $poll = array_merge($original_poll_data, array(
+ 'enable_bbcode' => $post_data['enable_bbcode'],
+ 'enable_urls' => $post_data['enable_urls'],
+ 'enable_smilies' => $post_data['enable_smilies'],
+ 'img_status' => $img_status,
+ ));
+
+ $message_parser->parse_poll($poll);
+
+ $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
+ $post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
+ }
else
{
$poll = array();
@@ -1271,7 +1307,7 @@ $attachment_data = $message_parser->attachment_data;
$filename_data = $message_parser->filename_data;
$post_data['post_text'] = $message_parser->message;
-if (sizeof($post_data['poll_options']) && $post_data['poll_title'])
+if (sizeof($post_data['poll_options']) || !empty($post_data['poll_title']))
{
$message_parser->message = $post_data['poll_title'];
$message_parser->bbcode_uid = $post_data['bbcode_uid'];
diff --git a/phpBB/search.php b/phpBB/search.php
index 7a9ab82f93..2aa61401cf 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -47,24 +47,44 @@ $sort_dir = request_var('sd', 'd');
$return_chars = request_var('ch', ($topic_id) ? -1 : 300);
$search_forum = request_var('fid', array(0));
-// We put login boxes for the case if search_id is egosearch or unreadposts
+// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
-// Egosearch is an author search
-if ($search_id == 'egosearch')
+switch ($search_id)
{
- $author_id = $user->data['user_id'];
-
- if ($user->data['user_id'] == ANONYMOUS)
- {
- login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
- }
-}
+ // Egosearch is an author search
+ case 'egosearch':
+ $author_id = $user->data['user_id'];
+ if ($user->data['user_id'] == ANONYMOUS)
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
+ }
+ break;
-// Search for unread posts needs user to be logged in if topics tracking for guests is disabled
-if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
-{
- login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+ // Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
+ case 'unreadposts':
+ if (!$config['load_unreads_search'])
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_UNREADS');
+ }
+ else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+ }
+ break;
+
+ // The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
+ case 'newposts':
+ if ($user->data['user_id'] == ANONYMOUS)
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
+ }
+ break;
+
+ default:
+ // There's nothing to do here for now ;)
+ break;
}
// Is user able to search? Has search been disabled?
@@ -81,9 +101,10 @@ if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($con
trigger_error('NO_SEARCH_TIME');
}
-// Check flood limit ... if applicable
+// It is applicable if the configuration setting is non-zero, and the user cannot
+// ignore the flood setting, and the search is a keyword search.
$interval = ($user->data['user_id'] == ANONYMOUS) ? $config['search_anonymous_interval'] : $config['search_interval'];
-if ($interval && !$auth->acl_get('u_ignoreflood'))
+if ($interval && !in_array($search_id, array('unreadposts', 'unanswered', 'active_topics', 'egosearch')) && !$auth->acl_get('u_ignoreflood'))
{
if ($user->data['user_last_search'] > time() - $interval)
{
@@ -387,18 +408,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
$s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
-
- $unread_list = array();
- $unread_list = get_unread_topics($user->data['user_id'], $sql_where, $sql_sort);
-
- if (!empty($unread_list))
- {
- $sql = 'SELECT t.topic_id
- FROM ' . TOPICS_TABLE . ' t
- WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . "
- $sql_sort";
- $field = 'topic_id';
- }
break;
case 'newposts':
@@ -476,6 +485,13 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$total_match_count = sizeof($id_ary) + $start;
$id_ary = array_slice($id_ary, 0, $per_page);
}
+ else if ($search_id == 'unreadposts')
+ {
+ $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001 - $start, $start));
+
+ $total_match_count = sizeof($id_ary) + $start;
+ $id_ary = array_slice($id_ary, 0, $per_page);
+ }
else
{
$search_id = '';
@@ -896,7 +912,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'S_TOPIC_GLOBAL' => (!$forum_id) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'],
- 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false,
+ 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
diff --git a/phpBB/style.php b/phpBB/style.php
index fa77815670..8ca1751391 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -45,15 +45,8 @@ if (!empty($load_extensions) && function_exists('dl'))
}
}
-
-$sid = (isset($_GET['sid']) && !is_array($_GET['sid'])) ? htmlspecialchars($_GET['sid']) : '';
$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
-if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
-{
- $sid = '';
-}
-
// This is a simple script to grab and output the requested CSS data stored in the DB
// We include a session_id check to try and limit 3rd party linking ... unless they
// happen to have a current session it will output nothing. We will also cache the
@@ -81,6 +74,20 @@ if ($id)
$config = $cache->obtain_config();
$user = false;
+ // try to get a session ID from REQUEST array
+ $sid = request_var('sid', '');
+
+ if (!$sid)
+ {
+ // if that failed, then look in the cookies
+ $sid = request_var($config['cookie_name'] . '_sid', '', false, true);
+ }
+
+ if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
+ {
+ $sid = '';
+ }
+
if ($sid)
{
$sql = 'SELECT u.user_id, u.user_lang
diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg
index 7fc8274ad2..bbafe5e26d 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.7
+version = 3.0.8
# Images
img_site_logo = site_logo.gif*52*139
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index 8b660c969e..7f7e677993 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.7 \ No newline at end of file
+version = 3.0.8 \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html
index 97d2cda28e..51a1615bd5 100644
--- a/phpBB/styles/prosilver/template/captcha_recaptcha.html
+++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html
@@ -16,6 +16,7 @@
// <![CDATA[
var RecaptchaOptions = {
lang : '{LA_RECAPTCHA_LANG}',
+ theme : 'clean',
tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
};
// ]]>
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
index c4c3483766..ddc862bb8c 100644
--- a/phpBB/styles/prosilver/template/editor.js
+++ b/phpBB/styles/prosilver/template/editor.js
@@ -200,6 +200,12 @@ function addquote(post_id, username, l_wrote)
var theSelection = '';
var divarea = false;
+ if (l_wrote === undefined)
+ {
+ // Backwards compatibility
+ l_wrote = 'wrote';
+ }
+
if (document.all)
{
divarea = document.all[message_name];
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 6fb3778952..4a85858df5 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -98,16 +98,21 @@ function viewableArea(e, itself)
/**
* Set display of page element
* s[-1,0,1] = hide,toggle display,show
+* type = string: inline, block, inline-block or other CSS "display" type
*/
-function dE(n, s)
+function dE(n, s, type)
{
- var e = document.getElementById(n);
+ if (!type)
+ {
+ type = 'block';
+ }
+ var e = document.getElementById(n);
if (!s)
{
- s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
+ s = (e.style.display == '' || e.style.display == type) ? -1 : 1;
}
- e.style.display = (s == 1) ? 'block' : 'none';
+ e.style.display = (s == 1) ? type : 'none';
}
/**
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index 17790eb78a..d4d50a11c0 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -6,7 +6,7 @@
<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
<ul class="linklist">
<!-- IF S_DISPLAY_SEARCH -->
- <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
+ <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
<!-- ENDIF -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
</ul>
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index fe111aaa45..36c2eae349 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -1,5 +1,11 @@
<!-- INCLUDE overall_header.html -->
+<script type="text/javascript">
+// <![CDATA[
+ onload_functions.push('document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus();');
+// ]]>
+</script>
+
<form action="{S_LOGIN_ACTION}" method="post" id="login">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
@@ -32,11 +38,11 @@
</dl>
<!-- ENDIF -->
+ {S_LOGIN_REDIRECT}
<dl>
<dt>&nbsp;</dt>
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd>
</dl>
- {S_LOGIN_REDIRECT}
</fieldset>
</div>
<span class="corners-bottom"><span></span></span></div>
diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html
index 0265d7ce12..04e24cd1f9 100644
--- a/phpBB/styles/prosilver/template/mcp_post.html
+++ b/phpBB/styles/prosilver/template/mcp_post.html
@@ -54,6 +54,8 @@
</ul>
<!-- ENDIF -->
+ <span class="right-box" id="expand"><a href="#post_details" onclick="viewableArea(getElementById('post_details'), true); var rev_text = getElementById('expand').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'}; return false;">{L_EXPAND_VIEW}</a></span>
+
<h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
<!-- IF S_PM -->
<p class="author">
@@ -84,7 +86,7 @@
</p>
<!-- ENDIF -->
- <div class="content">
+ <div class="content" id="post_details">
{POST_PREVIEW}
</div>
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 4da1308e14..aeb6dc9ba3 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -30,7 +30,7 @@
The phpBB Group : 2006
//-->
- <div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group
+ <div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; phpBB Group
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
<!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 8f4ac19fb8..44857dbc41 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -11,7 +11,7 @@
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 4d866681f0..5d21229611 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -79,7 +79,7 @@
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
- <input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
+ <input type="button" class="button2" accesskey="y" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 9476242d11..5f7fb8408e 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -187,8 +187,8 @@
<fieldset class="submit-buttons">
{S_HIDDEN_ADDRESS_FIELD}
{S_HIDDEN_FIELDS}
- <!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
- <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE}" class="button2" />&nbsp; <!-- ENDIF -->
+ <!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD_DRAFT}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
+ <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE_DRAFT}" class="button2" />&nbsp; <!-- ENDIF -->
<input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;
<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1 default-submit-action" />&nbsp;
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index 879e6bb7fc..a05f057e21 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -24,7 +24,7 @@
<div class="postbody" id="pr{topic_review_row.POST_ID}">
<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
<ul class="profile-icons">
- <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{L_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
+ <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
</ul>
<!-- ENDIF -->
<!-- IF topic_review_row.U_MCP_DETAILS --><div class="right-box"><a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a></div><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html
index 612641b141..6616b95a73 100644
--- a/phpBB/styles/prosilver/template/search_body.html
+++ b/phpBB/styles/prosilver/template/search_body.html
@@ -1,5 +1,11 @@
<!-- INCLUDE overall_header.html -->
+<script type="text/javascript">
+// <![CDATA[
+ onload_functions.push('document.getElementById("keywords").focus();');
+// ]]>
+</script>
+
<h2 class="solo">{L_SEARCH}</h2>
<form method="get" action="{S_SEARCH_ACTION}">
@@ -119,4 +125,4 @@
</div>
<!-- ENDIF -->
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg
index 03b61e1003..0dd4150266 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.7
+version = 3.0.8
# Defining a different template bitfield
template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index 32b8072082..9051eb2ee0 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -1,7 +1,7 @@
<h3 id="review">
<span class="right-box"><a href="#review" onclick="viewableArea(getElementById('topicreview'), true); var rev_text = getElementById('review').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'};">{L_EXPAND_VIEW}</a></span>
- {L_MESSAGE_HISTORY}: {HISTORY_TITLE}
+ {L_MESSAGE_HISTORY}:
</h3>
<div id="topicreview">
@@ -17,7 +17,7 @@
<div class="postbody" id="pr{history_row.MSG_ID}">
<!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
<ul class="profile-icons">
- <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{L_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
+ <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_signature.html b/phpBB/styles/prosilver/template/ucp_profile_signature.html
index 5d25d2d9f4..ab23b84076 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_signature.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_signature.html
@@ -4,7 +4,7 @@
<h2>{L_TITLE}</h2>
-<!-- IF SIGNATURE_PREVIEW -->
+<!-- IF SIGNATURE_PREVIEW != '' -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_SIGNATURE_PREVIEW}</h3>
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index cc38ed9d2b..12073a39d2 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -39,7 +39,7 @@
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div>
+ <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF --></a></div>
</div>
<!-- ENDIF -->
@@ -122,12 +122,12 @@
<!-- ENDIF -->
<!-- IF topicrow.S_FIRST_ROW or not topicrow.S_TOPIC_TYPE_SWITCH -->
- <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH --> announcement<!-- ENDIF -->">
+ <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) --> announcement<!-- ENDIF -->">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
- <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and topicrow.S_TOPIC_TYPE gt 1 -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
+ <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and (topicrow.S_POST_ANNOUNCE or topicrow.S_POST_GLOBAL) -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -137,7 +137,7 @@
<ul class="topiclist topics">
<!-- ENDIF -->
- <li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
+ <li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_GLOBAL --> global-announce<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
<dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 109312ac1b..f441784d85 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -236,6 +236,7 @@
}
.rtl a.top2 {
+ background-position: 100% 50%;
padding-left: 0;
padding-right: 15px;
}
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 417537e660..64beb97a37 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -298,6 +298,20 @@ div[class].topic-actions {
display: none;
}
+/* MCP Post details
+----------------------------------------*/
+#post_details
+{
+ /* This will only work in IE7+, plus the others */
+ overflow: auto;
+ max-height: 300px;
+}
+
+#expand
+{
+ clear: both;
+}
+
/* Content container styles
----------------------------------------*/
.content {
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 4db342661c..4e48a93a55 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -96,6 +96,11 @@ fieldset.fields1 div {
margin-bottom: 3px;
}
+/* Set it back to 0px for the reCaptcha divs: PHPBB3-9587 */
+fieldset.fields1 #recaptcha_widget_div div {
+ margin-bottom: 0;
+}
+
/* Specific layout 2 */
fieldset.fields2 dt {
width: 15em;
diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css
index 6dfb5c4726..68600b030b 100644
--- a/phpBB/styles/prosilver/theme/print.css
+++ b/phpBB/styles/prosilver/theme/print.css
@@ -140,3 +140,5 @@ div.spacer { clear: both; }
/* Accessibility tweaks: Mozilla.org */
.skip_link { display: none; }
+
+dl.codebox dt { display: none; } \ No newline at end of file
diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg
index 8b7916a144..83f3120829 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.7
+version = 3.0.8
# Some configuration options
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 782e682b9d..30fe5fb986 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -90,3 +90,12 @@ dl.icon {
* html .forumbg table.table1 {
margin: 0 -2px 0px -1px;
}
+
+/* Headerbar height fix for IE7 and below */
+* html #site-description p {
+ margin-bottom: 1.0em;
+}
+
+*:first-child+html #site-description p {
+ margin-bottom: 1.0em;
+} \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/imageset/imageset.cfg b/phpBB/styles/subsilver2/imageset/imageset.cfg
index 7709070734..ce0c859193 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.7
+version = 3.0.8
# Images
img_site_logo = site_logo.gif*94*170
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 86b5b8a4e8..b8ddd6deec 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.7
+version = 3.0.8
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index d54994fe67..833bd4d55f 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -58,13 +58,13 @@
<!-- ELSEIF _file.S_FLASH_FILE -->
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}">
- <param name="movie" value="{_file.U_DOWNLOAD_LINK}" />
+ <param name="movie" value="{_file.U_VIEW_LINK}" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="quality" value="high" />
<param name="allowScriptAccess" value="never" />
<param name="allowNetworking" value="internal" />
- <embed src="{_file.U_DOWNLOAD_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
+ <embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
</object>
<!-- ELSEIF _file.S_QUICKTIME_FILE -->
<object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="0" height="16">
diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html
index e0116ae42c..4c65f81643 100644
--- a/phpBB/styles/subsilver2/template/captcha_default.html
+++ b/phpBB/styles/subsilver2/template/captcha_default.html
@@ -1,9 +1,11 @@
<tr>
<th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
</tr>
+ <!-- IF S_TYPE == 1 -->
<tr>
<td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
</tr>
+ <!-- ENDIF -->
<tr>
<td class="row1" colspan="2" align="center"><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" />
<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td>
diff --git a/phpBB/styles/subsilver2/template/captcha_recaptcha.html b/phpBB/styles/subsilver2/template/captcha_recaptcha.html
index 3776c77ea4..ec09b28ef5 100644
--- a/phpBB/styles/subsilver2/template/captcha_recaptcha.html
+++ b/phpBB/styles/subsilver2/template/captcha_recaptcha.html
@@ -9,6 +9,7 @@
// <![CDATA[
var RecaptchaOptions = {
lang : '{LA_RECAPTCHA_LANG}',
+ theme : 'clean',
tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
};
// ]]>
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js
index 54bd3450d0..cd22812bab 100644
--- a/phpBB/styles/subsilver2/template/editor.js
+++ b/phpBB/styles/subsilver2/template/editor.js
@@ -202,6 +202,12 @@ function addquote(post_id, username, l_wrote)
var theSelection = '';
var divarea = false;
+ if (l_wrote === undefined)
+ {
+ // Backwards compatibility
+ l_wrote = 'wrote';
+ }
+
if (document.all)
{
divarea = document.all[message_name];
@@ -234,6 +240,7 @@ function addquote(post_id, username, l_wrote)
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');
+ theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
}
else if (document.all)
{
@@ -381,8 +388,8 @@ function colorPalette(dir, width, height)
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
- document.write('<td bgcolor="#' + color + '">');
- document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');" onmouseout="helpline(\'tip\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
+ document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
+ document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index 863e4f7bee..8faf76e9ee 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -89,11 +89,11 @@
<table class="legend">
<tr>
- <td width="20" align="center">{FORUM_NEW_IMG}</td>
- <td><span class="gensmall">{L_NEW_POSTS}</span></td>
+ <td width="20" align="center">{FORUM_UNREAD_IMG}</td>
+ <td><span class="gensmall">{L_UNREAD_POSTS}</span></td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center">{FORUM_IMG}</td>
- <td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
+ <td><span class="gensmall">{L_NO_UNREAD_POSTS}</span></td>
<td>&nbsp;&nbsp;</td>
<td width="20" align="center">{FORUM_LOCKED_IMG}</td>
<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html
index 51f7068b5f..262341e0c0 100644
--- a/phpBB/styles/subsilver2/template/login_body.html
+++ b/phpBB/styles/subsilver2/template/login_body.html
@@ -72,12 +72,12 @@
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
+{S_LOGIN_REDIRECT}
<tr>
<td class="cat" <!-- IF not S_ADMIN_AUTH or S_CONFIRM_CODE -->colspan="2"<!-- ENDIF --> align="center">{S_HIDDEN_FIELDS}<input type="submit" name="login" class="btnmain" value="{L_LOGIN}" tabindex="5" /></td>
</tr>
</table>
{S_FORM_TOKEN}
-{S_LOGIN_REDIRECT}
</form>
<br clear="all" />
@@ -88,4 +88,21 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<script type="text/javascript">
+// <![CDATA[
+ (function()
+ {
+ var elements = document.getElementsByName("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->");
+ for (var i = 0; i < elements.length; ++i)
+ {
+ if (elements[i].tagName.toLowerCase() == 'input')
+ {
+ elements[i].focus();
+ break;
+ }
+ }
+ })();
+// ]]>
+</script>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
index 64201ff2b9..187d0f4366 100644
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ b/phpBB/styles/subsilver2/template/overall_footer.html
@@ -14,7 +14,7 @@
<div id="wrapfooter">
<!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF -->
- <span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group
+ <span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; phpBB Group
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span>
</div>
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index 963f5160dd..874beb8e2b 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -11,7 +11,7 @@
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
@@ -201,8 +201,8 @@ function marklist(id, name, state)
<!-- IF S_DISPLAY_SEARCH -->
<p class="searchbar">
<span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
- <!-- IF S_USER_LOGGED_IN -->
- <span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
+ <!-- IF S_USER_LOGGED_IN or S_LOAD_UNREADS -->
+ <span style="float: {S_CONTENT_FLOW_END};"><!-- IF S_LOAD_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- IF S_USER_LOGGED_IN --> | <!-- ENDIF --><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><!-- ENDIF --></span>
<!-- ENDIF -->
</p>
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
index 963e6fe966..0021cd2eb3 100644
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ b/phpBB/styles/subsilver2/template/posting_body.html
@@ -342,8 +342,8 @@
<td class="cat" colspan="2" align="center">
<input class="btnlite" type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" />
&nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />
- <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE}" /><!-- ENDIF -->
- <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD}" /><!-- ENDIF -->
+ <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE_DRAFT}" /><!-- ENDIF -->
+ <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD_DRAFT}" /><!-- ENDIF -->
&nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="9" name="cancel" value="{L_CANCEL}" />
</td>
</tr>
@@ -365,8 +365,8 @@
<input class="btnlite" type="submit" tabindex="10" name="preview" value="{L_PREVIEW}" />
&nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="11" name="post" value="{L_SUBMIT}" />
<!-- IF not S_SHOW_ATTACH_BOX and not S_SHOW_POLL_BOX -->
- <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE}" /><!-- ENDIF -->
- <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD}" /><!-- ENDIF -->
+ <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE_DRAFT}" /><!-- ENDIF -->
+ <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD_DRAFT}" /><!-- ENDIF -->
<!-- ENDIF -->
&nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="14" name="cancel" value="{L_CANCEL}" />
</td>
diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
index 0aab79b7aa..621fa87fd4 100644
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ b/phpBB/styles/subsilver2/template/posting_buttons.html
@@ -19,6 +19,7 @@
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
+ a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
@@ -44,7 +45,7 @@
<input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
<input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
<input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
+ <input type="button" class="btnbbcode" accesskey="y" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html
index 5456ad09b6..54bbf6e553 100644
--- a/phpBB/styles/subsilver2/template/posting_topic_review.html
+++ b/phpBB/styles/subsilver2/template/posting_topic_review.html
@@ -36,7 +36,7 @@
<td>&nbsp;</td>
<td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td>
- <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{L_WROTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td>
+ <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td>
</tr>
</table>
</td>
diff --git a/phpBB/styles/subsilver2/template/search_body.html b/phpBB/styles/subsilver2/template/search_body.html
index a0ec30e9ba..763a229c83 100644
--- a/phpBB/styles/subsilver2/template/search_body.html
+++ b/phpBB/styles/subsilver2/template/search_body.html
@@ -75,4 +75,21 @@
<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<script type="text/javascript">
+// <![CDATA[
+ (function()
+ {
+ var elements = document.getElementsByName("keywords");
+ for (var i = 0; i < elements.length; ++i)
+ {
+ if (elements[i].tagName.toLowerCase() == 'input')
+ {
+ elements[i].focus();
+ break;
+ }
+ }
+ })();
+// ]]>
+</script>
+
+<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg
index b6765268bc..edfc2d43f2 100644
--- a/phpBB/styles/subsilver2/template/template.cfg
+++ b/phpBB/styles/subsilver2/template/template.cfg
@@ -19,5 +19,5 @@
# General Information about this template
name = subsilver2
copyright = &copy; phpBB Group, 2003
-version = 3.0.7
+version = 3.0.8
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
index d11822cc39..8754acaaa2 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_history.html
@@ -6,7 +6,7 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
- <th align="center">{L_MESSAGE_HISTORY} - {HISTORY_TITLE}</th>
+ <th align="center">{L_MESSAGE_HISTORY}</th>
</tr>
<tr>
<td class="row1"><div style="overflow: auto; width: 100%; height: 300px;">
@@ -59,7 +59,7 @@
<!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td class="gensmall"><a href="{history_row.U_VIEW_MESSAGE}">{L_VIEW_PM}</a></td>
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{L_WROTE}'); return false;"<!-- ENDIF -->>{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
+ <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}'); return false;"<!-- ENDIF -->>{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
</tr>
<tr>
<td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_signature.html b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
index 2b396ea0df..a33726e166 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_signature.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
@@ -93,7 +93,7 @@
</td>
</tr>
-<!-- IF SIGNATURE_PREVIEW -->
+<!-- IF SIGNATURE_PREVIEW != '' -->
<tr>
<th colspan="2" valign="middle">{L_SIGNATURE_PREVIEW}</th>
</tr>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index 387a749e24..6511fa5349 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -281,31 +281,31 @@
<td align="{S_CONTENT_FLOW_BEGIN}" valign="top">
<table cellspacing="3" cellpadding="0" border="0">
<tr>
- <td width="20" style="text-align: center;">{FOLDER_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS}</td>
+ <td width="20" style="text-align: center;">{FOLDER_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" style="text-align: center;">{FOLDER_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS}</td>
<td>&nbsp;&nbsp;</td>
<td width="20" style="text-align: center;">{FOLDER_ANNOUNCE_IMG}</td>
<td class="gensmall">{L_ICON_ANNOUNCEMENT}</td>
</tr>
<tr>
- <td style="text-align: center;">{FOLDER_HOT_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS_HOT}</td>
+ <td style="text-align: center;">{FOLDER_HOT_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_HOT_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS_HOT}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS_HOT}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_STICKY_IMG}</td>
<td class="gensmall">{L_ICON_STICKY}</td>
</tr>
<tr>
- <td style="text-align: center;">{FOLDER_LOCKED_NEW_IMG}</td>
- <td class="gensmall">{L_NEW_POSTS_LOCKED}</td>
+ <td style="text-align: center;">{FOLDER_LOCKED_UNREAD_IMG}</td>
+ <td class="gensmall">{L_UNREAD_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_LOCKED_IMG}</td>
- <td class="gensmall">{L_NO_NEW_POSTS_LOCKED}</td>
+ <td class="gensmall">{L_NO_UNREAD_POSTS_LOCKED}</td>
<td>&nbsp;&nbsp;</td>
<td style="text-align: center;">{FOLDER_MOVED_IMG}</td>
<td class="gensmall">{L_TOPIC_MOVED}</td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 8f01c64c0e..bba00ce685 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -238,7 +238,7 @@
<span class="gensmall error"><br /><br />{L_DOWNLOAD_NOTICE}</span>
<!-- ENDIF -->
<!-- IF postrow.SIGNATURE -->
- <span class="postbody"><br />_________________<br />{postrow.SIGNATURE}</span>
+ <div class="postbody"><br />_________________<br />{postrow.SIGNATURE}</div>
<!-- ENDIF -->
<!-- IF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg
index 7f6bfd9a12..a6ac5f337c 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.7
+version = 3.0.8
# Some configuration options
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 994fe064a1..f5a2ec9648 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -22,7 +22,7 @@ require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
$id = request_var('i', '');
$mode = request_var('mode', '');
-if ($mode == 'login' || $mode == 'logout' || $mode == 'confirm')
+if (in_array($mode, array('login', 'logout', 'confirm', 'sendpassword', 'activate')))
{
define('IN_LOGIN', true);
}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index d18508ccbc..9cfa93f880 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -273,16 +273,16 @@ $template->assign_vars(array(
'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt),
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
- 'FOLDER_IMG' => $user->img('topic_read', 'NO_NEW_POSTS'),
- 'FOLDER_NEW_IMG' => $user->img('topic_unread', 'NEW_POSTS'),
- 'FOLDER_HOT_IMG' => $user->img('topic_read_hot', 'NO_NEW_POSTS_HOT'),
- 'FOLDER_HOT_NEW_IMG' => $user->img('topic_unread_hot', 'NEW_POSTS_HOT'),
- 'FOLDER_LOCKED_IMG' => $user->img('topic_read_locked', 'NO_NEW_POSTS_LOCKED'),
- 'FOLDER_LOCKED_NEW_IMG' => $user->img('topic_unread_locked', 'NEW_POSTS_LOCKED'),
+ 'FOLDER_IMG' => $user->img('topic_read', 'NO_UNREAD_POSTS'),
+ 'FOLDER_UNREAD_IMG' => $user->img('topic_unread', 'UNREAD_POSTS'),
+ 'FOLDER_HOT_IMG' => $user->img('topic_read_hot', 'NO_UNREAD_POSTS_HOT'),
+ 'FOLDER_HOT_UNREAD_IMG' => $user->img('topic_unread_hot', 'UNREAD_POSTS_HOT'),
+ 'FOLDER_LOCKED_IMG' => $user->img('topic_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
+ 'FOLDER_LOCKED_UNREAD_IMG' => $user->img('topic_unread_locked', 'UNREAD_POSTS_LOCKED'),
'FOLDER_STICKY_IMG' => $user->img('sticky_read', 'POST_STICKY'),
- 'FOLDER_STICKY_NEW_IMG' => $user->img('sticky_unread', 'POST_STICKY'),
+ 'FOLDER_STICKY_UNREAD_IMG' => $user->img('sticky_unread', 'POST_STICKY'),
'FOLDER_ANNOUNCE_IMG' => $user->img('announce_read', 'POST_ANNOUNCEMENT'),
- 'FOLDER_ANNOUNCE_NEW_IMG' => $user->img('announce_unread', 'POST_ANNOUNCEMENT'),
+ 'FOLDER_ANNOUNCE_UNREAD_IMG'=> $user->img('announce_unread', 'POST_ANNOUNCEMENT'),
'FOLDER_MOVED_IMG' => $user->img('topic_moved', 'TOPIC_MOVED'),
'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
@@ -508,6 +508,7 @@ if (sizeof($shadow_topic_list))
'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
'topic_status' => $rowset[$orig_topic_id]['topic_status'],
'topic_type' => $rowset[$orig_topic_id]['topic_type'],
+ 'topic_title' => $rowset[$orig_topic_id]['topic_title'],
));
// Shadow topics are never reported
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 8e0521522d..498088c5c8 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1146,7 +1146,7 @@ while ($row = $db->sql_fetchrow($result))
get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
- if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))
+ if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
$user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&amp;u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']);
}
@@ -1513,7 +1513,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'EDIT_REASON' => $row['post_edit_reason'],
'BUMPED_MESSAGE' => $l_bumped_by,
- 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'NEW_POST') : $user->img('icon_post_target', 'POST'),
+ 'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'POST_ICON_IMG' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '',
'POST_ICON_IMG_WIDTH' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '',
'POST_ICON_IMG_HEIGHT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '',
diff --git a/tests/RUNNING_TESTS.txt b/tests/RUNNING_TESTS.txt
new file mode 100644
index 0000000000..74a0635c1a
--- /dev/null
+++ b/tests/RUNNING_TESTS.txt
@@ -0,0 +1,57 @@
+Running Tests
+=============
+
+Prerequisites
+=============
+
+PHPUnit
+-------
+
+phpBB unit tests use PHPUnit framework. Version 3.3 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';
+
+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 all_tests.php
+
+Running
+=======
+
+Once the prerequisites are installed, run the tests from tests directory:
+
+ $ phpunit all_tests.php
+
+More Information
+================
+
+Further information is available on phpbb wiki:
+http://wiki.phpbb.com/display/DEV/Unit+Tests
diff --git a/tests/all_tests.php b/tests/all_tests.php
index e693427809..d1d711c4d7 100644
--- a/tests/all_tests.php
+++ b/tests/all_tests.php
@@ -23,9 +23,19 @@ require_once 'security/all_tests.php';
require_once 'template/all_tests.php';
require_once 'text_processing/all_tests.php';
require_once 'dbal/all_tests.php';
+require_once 'regex/all_tests.php';
+require_once 'network/all_tests.php';
+require_once 'random/all_tests.php';
// exclude the test directory from code coverage reports
-PHPUnit_Util_Filter::addDirectoryToFilter('./');
+if (version_compare(PHPUnit_Runner_Version::id(), '3.5.0') >= 0)
+{
+ PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist('./');
+}
+else
+{
+ PHPUnit_Util_Filter::addDirectoryToFilter('./');
+}
class phpbb_all_tests
{
@@ -44,6 +54,9 @@ class phpbb_all_tests
$suite->addTest(phpbb_template_all_tests::suite());
$suite->addTest(phpbb_text_processing_all_tests::suite());
$suite->addTest(phpbb_dbal_all_tests::suite());
+ $suite->addTest(phpbb_regex_all_tests::suite());
+ $suite->addTest(phpbb_network_all_tests::suite());
+ $suite->addTest(phpbb_random_all_tests::suite());
return $suite;
}
diff --git a/tests/dbal/all_tests.php b/tests/dbal/all_tests.php
index 7aee0f6b16..cfa8176246 100644
--- a/tests/dbal/all_tests.php
+++ b/tests/dbal/all_tests.php
@@ -15,7 +15,8 @@ if (!defined('PHPUnit_MAIN_METHOD'))
require_once 'test_framework/framework.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
-require_once 'dbal/dbal.php';
+require_once 'dbal/select.php';
+require_once 'dbal/write.php';
class phpbb_dbal_all_tests
{
@@ -28,7 +29,8 @@ class phpbb_dbal_all_tests
{
$suite = new PHPUnit_Framework_TestSuite('phpBB Database Abstraction Layer');
- $suite->addTestSuite('phpbb_dbal_test');
+ $suite->addTestSuite('phpbb_dbal_select_test');
+ $suite->addTestSuite('phpbb_dbal_write_test');
return $suite;
}
diff --git a/tests/dbal/fixtures/config.xml b/tests/dbal/fixtures/config.xml
new file mode 100644
index 0000000000..019f582a91
--- /dev/null
+++ b/tests/dbal/fixtures/config.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config">
+ <column>config_name</column>
+ <column>config_value</column>
+ <column>is_dynamic</column>
+ <row>
+ <value>config1</value>
+ <value>foo</value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>config2</value>
+ <value>bar</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/dbal/dbal.php b/tests/dbal/select.php
index f90b5efeb5..70f27549d2 100644
--- a/tests/dbal/dbal.php
+++ b/tests/dbal/select.php
@@ -10,7 +10,7 @@
require_once 'test_framework/framework.php';
require_once '../phpBB/includes/functions.php';
-class phpbb_dbal_test extends phpbb_database_test_case
+class phpbb_dbal_select_test extends phpbb_database_test_case
{
public function getDataSet()
{
@@ -21,10 +21,7 @@ class phpbb_dbal_test extends phpbb_database_test_case
{
return array(
array('phpbb_users', "username_clean = 'bertie'", array(array('username_clean' => 'bertie'))),
- array('phpbb_users', "username_clean = 'phpBB'", array()),
array('phpbb_users', 'username_clean syntax_error', false),
- array('phpbb_users', 'column_not_exists = 2', false),
- array('table_not_exists', 'column_not_exists = 2', false),
);
}
@@ -103,7 +100,6 @@ class phpbb_dbal_test extends phpbb_database_test_case
return array(
array('', array('barfoo', 'foobar', 'bertie')),
array('user_id = 2', array('foobar')),
- array("username_clean = 'bertie'", array('bertie')),
);
}
@@ -138,7 +134,6 @@ class phpbb_dbal_test extends phpbb_database_test_case
array(0, 1, array(array('username_clean' => 'foobar'),
array('username_clean' => 'bertie'))),
array(1, 0, array(array('username_clean' => 'barfoo'))),
- array(1, 1, array(array('username_clean' => 'foobar'))),
array(1, 2, array(array('username_clean' => 'bertie'))),
array(2, 0, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'))),
@@ -180,9 +175,6 @@ class phpbb_dbal_test extends phpbb_database_test_case
array('bar*', array(array('username_clean' => 'barfoo'))),
array('*bar*', array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'))),
- array('*b*', array(array('username_clean' => 'barfoo'),
- array('username_clean' => 'foobar'),
- array('username_clean' => 'bertie'))),
array('b*r', array()),
array('b*e', array(array('username_clean' => 'bertie'))),
array('#b*e', array()),
@@ -220,11 +212,11 @@ class phpbb_dbal_test extends phpbb_database_test_case
array('username_clean' => 'foobar'))),
array('user_id', 3, true, true, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'))),
- array('user_id', '3', false, false, array(array('username_clean' => 'bertie'))),
- array('user_id', '3', false, true, array(array('username_clean' => 'bertie'))),
- array('user_id', '3', true, false, array(array('username_clean' => 'barfoo'),
+ array('username_clean', 'bertie', false, false, array(array('username_clean' => 'bertie'))),
+ array('username_clean', 'bertie', false, true, array(array('username_clean' => 'bertie'))),
+ array('username_clean', 'bertie', true, false, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'))),
- array('user_id', '3', true, true, array(array('username_clean' => 'barfoo'),
+ array('username_clean', 'bertie', true, true, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'))),
array('user_id', array(3), false, false, array(array('username_clean' => 'bertie'))),
array('user_id', array(3), false, true, array(array('username_clean' => 'bertie'))),
@@ -238,12 +230,12 @@ class phpbb_dbal_test extends phpbb_database_test_case
array('username_clean' => 'bertie'))),
array('user_id', array(1, 3), true, false, array(array('username_clean' => 'foobar'))),
array('user_id', array(1, 3), true, true, array(array('username_clean' => 'foobar'))),
- array('user_id', '', false, false, array()),
- array('user_id', '', false, true, array()),
- array('user_id', '', true, false, array(array('username_clean' => 'barfoo'),
+ array('username_clean', '', false, false, array()),
+ array('username_clean', '', false, true, array()),
+ array('username_clean', '', true, false, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'),
array('username_clean' => 'bertie'))),
- array('user_id', '', true, true, array(array('username_clean' => 'barfoo'),
+ array('username_clean', '', true, true, array(array('username_clean' => 'barfoo'),
array('username_clean' => 'foobar'),
array('username_clean' => 'bertie'))),
array('user_id', array(), false, true, array()),
@@ -252,8 +244,9 @@ class phpbb_dbal_test extends phpbb_database_test_case
array('username_clean' => 'bertie'))),
// These here would throw errors and therefor $result should be false.
- array('user_id', array(), false, false, false, true),
- array('user_id', array(), true, false, false, true),
+ // Removing for now because SQLite accepts empty IN() syntax
+ /*array('user_id', array(), false, false, false, true),
+ array('user_id', array(), true, false, false, true),*/
);
}
@@ -310,10 +303,11 @@ class phpbb_dbal_test extends phpbb_database_test_case
$db->sql_return_on_error(true);
}
- $result = $db->sql_query('SELECT username_clean
+ $sql = 'SELECT username_clean
FROM phpbb_users
WHERE ' . $db->sql_build_array('SELECT', $assoc_ary) . '
- ORDER BY user_id ASC');
+ ORDER BY user_id ASC';
+ $result = $db->sql_query($sql);
if ($catch_error)
{
@@ -325,4 +319,3 @@ class phpbb_dbal_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
}
-
diff --git a/tests/dbal/write.php b/tests/dbal/write.php
new file mode 100644
index 0000000000..01deacda69
--- /dev/null
+++ b/tests/dbal/write.php
@@ -0,0 +1,172 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2008 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_dbal_write_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/config.xml');
+ }
+
+ public static function build_array_insert_data()
+ {
+ return array(
+ array(array(
+ 'config_name' => 'test_version',
+ 'config_value' => '0.0.0',
+ 'is_dynamic' => 1,
+ )),
+ array(array(
+ 'config_name' => 'second config',
+ 'config_value' => '10',
+ 'is_dynamic' => 0,
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider build_array_insert_data
+ */
+ public function test_build_array_insert($sql_ary)
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'INSERT INTO phpbb_config ' . $db->sql_build_array('INSERT', $sql_ary);
+ $result = $db->sql_query($sql);
+
+ $sql = "SELECT *
+ FROM phpbb_config
+ WHERE config_name = '" . $sql_ary['config_name'] . "'";
+ $result = $db->sql_query_limit($sql, 1);
+
+ $this->assertEquals($sql_ary, $db->sql_fetchrow($result));
+
+ $db->sql_freeresult($result);
+ }
+
+ public function test_delete()
+ {
+ $db = $this->new_dbal();
+
+ $sql = "DELETE FROM phpbb_config
+ WHERE config_name = 'config1'";
+ $result = $db->sql_query($sql);
+
+ $sql = 'SELECT *
+ FROM phpbb_config';
+ $result = $db->sql_query($sql);
+ $rows = $db->sql_fetchrowset($result);
+
+ $this->assertEquals(1, sizeof($rows));
+ $this->assertEquals('config2', $rows[0]['config_name']);
+
+ $db->sql_freeresult($result);
+ }
+
+ public function test_multiple_insert()
+ {
+ $db = $this->new_dbal();
+
+ // empty the table
+ $sql = 'DELETE FROM phpbb_config';
+ $db->sql_query($sql);
+
+ $batch_ary = array(
+ array(
+ 'config_name' => 'batch one',
+ 'config_value' => 'b1',
+ 'is_dynamic' => 0,
+ ),
+ array(
+ 'config_name' => 'batch two',
+ 'config_value' => 'b2',
+ 'is_dynamic' => 1,
+ ),
+ );
+
+ $result = $db->sql_multi_insert('phpbb_config', $batch_ary);
+
+ $sql = 'SELECT *
+ FROM phpbb_config
+ ORDER BY config_name ASC';
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals($batch_ary, $db->sql_fetchrowset($result));
+
+ $db->sql_freeresult($result);
+ }
+
+ public static function update_data()
+ {
+ return array(
+ array(
+ array(
+ 'config_value' => '23',
+ 'is_dynamic' => 0,
+ ),
+ " WHERE config_name = 'config1'",
+ array(
+ array(
+ 'config_name' => 'config1',
+ 'config_value' => '23',
+ 'is_dynamic' => 0,
+ ),
+ array(
+ 'config_name' => 'config2',
+ 'config_value' => 'bar',
+ 'is_dynamic' => 1,
+ ),
+ ),
+ ),
+ array(
+ array(
+ 'config_value' => '0',
+ 'is_dynamic' => 1,
+ ),
+ '',
+ array(
+ array(
+ 'config_name' => 'config1',
+ 'config_value' => '0',
+ 'is_dynamic' => 1,
+ ),
+ array(
+ 'config_name' => 'config2',
+ 'config_value' => '0',
+ 'is_dynamic' => 1,
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider update_data
+ */
+ public function test_update($sql_ary, $where, $expected)
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'UPDATE phpbb_config
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . $where;
+ $result = $db->sql_query($sql);
+
+ $sql = 'SELECT *
+ FROM phpbb_config
+ ORDER BY config_name ASC';
+ $result = $db->sql_query($sql);
+
+ $this->assertEquals($expected, $db->sql_fetchrowset($result));
+
+ $db->sql_freeresult($result);
+ }
+}
diff --git a/tests/network/all_tests.php b/tests/network/all_tests.php
new file mode 100644
index 0000000000..b500647f81
--- /dev/null
+++ b/tests/network/all_tests.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+if (!defined('PHPUnit_MAIN_METHOD'))
+{
+ define('PHPUnit_MAIN_METHOD', 'phpbb_network_all_tests::main');
+}
+
+require_once 'test_framework/framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+require_once 'network/checkdnsrr.php';
+
+class phpbb_network_all_tests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('phpBB Network Functions');
+
+ $suite->addTestSuite('phpbb_network_checkdnsrr_test');
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'phpbb_network_all_tests::main')
+{
+ phpbb_network_all_tests::main();
+}
diff --git a/tests/network/checkdnsrr.php b/tests/network/checkdnsrr.php
new file mode 100644
index 0000000000..57fe2761cc
--- /dev/null
+++ b/tests/network/checkdnsrr.php
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_network_checkdnsrr_test extends phpbb_test_case
+{
+ public function data_provider()
+ {
+ return array(
+ // Existing MX record
+ array('phpbb.com', 'MX', true),
+
+ // Non-existing MX record
+ array('does-not-exist.phpbb.com', 'MX', false),
+
+ // Existing A record
+ array('www.phpbb.com', 'A', true),
+
+ // Non-existing A record
+ array('does-not-exist.phpbb.com', 'A', false),
+
+ // Existing AAAA record
+ array('www.six.heise.de', 'AAAA', true),
+
+ // Non-existing AAAA record
+ array('does-not-exist.phpbb.com', 'AAAA', false),
+
+ // Existing CNAME record
+ array('news.cnet.com', 'CNAME', true),
+
+ // Non-existing CNAME record
+ array('does-not-exist.phpbb.com', 'CNAME', false),
+
+ // Existing NS record
+ array('phpbb.com', 'NS', true),
+
+ // Non-existing NS record
+ array('does-not-exist', 'NS', false),
+
+ // Existing TXT record
+ array('phpbb.com', 'TXT', true),
+
+ // Non-existing TXT record
+ array('does-not-exist', 'TXT', false),
+ );
+ }
+
+ /**
+ * @dataProvider data_provider
+ */
+ public function test_checkdnsrr($host, $type, $expected)
+ {
+ $this->assertEquals($expected, phpbb_checkdnsrr($host, $type));
+ }
+}
diff --git a/tests/random/all_tests.php b/tests/random/all_tests.php
new file mode 100644
index 0000000000..c6ffe78024
--- /dev/null
+++ b/tests/random/all_tests.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+if (!defined('PHPUnit_MAIN_METHOD'))
+{
+ define('PHPUnit_MAIN_METHOD', 'phpbb_random_all_tests::main');
+}
+
+require_once 'test_framework/framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+require_once 'random/gen_rand_string.php';
+
+class phpbb_random_all_tests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('phpBB Random Functions');
+
+ $suite->addTestSuite('phpbb_random_gen_rand_string_test');
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'phpbb_random_all_tests::main')
+{
+ phpbb_random_all_tests::main();
+}
diff --git a/tests/random/gen_rand_string.php b/tests/random/gen_rand_string.php
new file mode 100644
index 0000000000..cd58d14ed3
--- /dev/null
+++ b/tests/random/gen_rand_string.php
@@ -0,0 +1,63 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_random_gen_rand_string_test extends phpbb_test_case
+{
+ const TEST_COUNT = 100;
+ const MIN_STRING_LENGTH = 1;
+ const MAX_STRING_LENGTH = 15;
+
+ public function setUp()
+ {
+ global $config;
+
+ if (!is_array($config))
+ {
+ $config = array();
+ }
+
+ $config['rand_seed'] = '';
+ $config['rand_seed_last_update'] = time() + 600;
+ }
+
+ public function test_gen_rand_string()
+ {
+ for ($tests = 0; $tests <= self::TEST_COUNT; ++$tests)
+ {
+ for ($num_chars = self::MIN_STRING_LENGTH; $num_chars <= self::MAX_STRING_LENGTH; ++$num_chars)
+ {
+ $random_string = gen_rand_string($num_chars);
+ $random_string_length = strlen($random_string);
+
+ $this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
+ $this->assertTrue($random_string_length <= $num_chars);
+ $this->assertRegExp('#^[A-Z0-9]+$#', $random_string);
+ }
+ }
+ }
+
+ public function test_gen_rand_string_friendly()
+ {
+ for ($tests = 0; $tests <= self::TEST_COUNT; ++$tests)
+ {
+ for ($num_chars = self::MIN_STRING_LENGTH; $num_chars <= self::MAX_STRING_LENGTH; ++$num_chars)
+ {
+ $random_string = gen_rand_string_friendly($num_chars);
+ $random_string_length = strlen($random_string);
+
+ $this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
+ $this->assertTrue($random_string_length <= $num_chars);
+ $this->assertRegExp('#^[A-NP-Z1-9]+$#', $random_string);
+ }
+ }
+ }
+}
diff --git a/tests/regex/all_tests.php b/tests/regex/all_tests.php
new file mode 100644
index 0000000000..316a9d4a58
--- /dev/null
+++ b/tests/regex/all_tests.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+if (!defined('PHPUnit_MAIN_METHOD'))
+{
+ define('PHPUnit_MAIN_METHOD', 'phpbb_regex_all_tests::main');
+}
+
+require_once 'test_framework/framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
+
+require_once 'regex/email.php';
+require_once 'regex/ipv4.php';
+require_once 'regex/ipv6.php';
+require_once 'regex/url.php';
+
+class phpbb_regex_all_tests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('phpBB Regular Expressions');
+
+ $suite->addTestSuite('phpbb_regex_email_test');
+ $suite->addTestSuite('phpbb_regex_ipv4_test');
+ $suite->addTestSuite('phpbb_regex_ipv6_test');
+ $suite->addTestSuite('phpbb_regex_url_test');
+
+ return $suite;
+ }
+}
+
+if (PHPUnit_MAIN_METHOD == 'phpbb_regex_all_tests::main')
+{
+ phpbb_regex_all_tests::main();
+}
diff --git a/tests/regex/email.php b/tests/regex/email.php
new file mode 100644
index 0000000000..8658b8af36
--- /dev/null
+++ b/tests/regex/email.php
@@ -0,0 +1,119 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_regex_email_test extends phpbb_test_case
+{
+ protected $regex;
+
+ public function setUp()
+ {
+ $this->regex = '#^' . get_preg_expression('email') . '$#i';
+ }
+
+ public function positive_match_data()
+ {
+ return array(
+ array('nobody@phpbb.com'),
+ array('Nobody@sub.phpbb.com'),
+ array('alice.bob@foo.phpbb.com'),
+ array('alice-foo@bar.phpbb.com'),
+ array('alice_foo@bar.phpbb.com'),
+ array('alice+tag@foo.phpbb.com'),
+ array('alice&amp;tag@foo.phpbb.com'),
+
+ //array('"John Doe"@example.com'),
+ //array('Alice@[192.168.2.1]'), // IPv4
+ //array('Bob@[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'), // IPv6
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('l3tt3rsAndNumb3rs@domain.com'),
+ array('has-dash@domain.com'),
+ array('hasApostrophe.o\'leary@domain.org'),
+ array('uncommonTLD@domain.museum'),
+ array('uncommonTLD@domain.travel'),
+ array('uncommonTLD@domain.mobi'),
+ array('countryCodeTLD@domain.uk'),
+ array('countryCodeTLD@domain.rw'),
+ array('numbersInDomain@911.com'),
+ array('underscore_inLocal@domain.net'),
+ array('IPInsteadOfDomain@127.0.0.1'),
+ array('IPAndPort@127.0.0.1:25'),
+ array('subdomain@sub.domain.com'),
+ array('local@dash-inDomain.com'),
+ array('dot.inLocal@foo.com'),
+ array('a@singleLetterLocal.org'),
+ array('singleLetterDomain@x.org'),
+ array('&amp;*=?^+{}\'~@validCharsInLocal.net'),
+ array('foor@bar.newTLD'),
+ );
+ }
+
+ public function negative_match_data()
+ {
+ return array(
+ array('foo.example.com'), // @ is missing
+ array('.foo.example.com'), // . as first character
+ array('Foo.@example.com'), // . is last in local part
+ array('foo..123@example.com'), // . doubled
+ array('a@b@c@example.com'), // @ doubled
+
+ array('()[]\;:,<>@example.com'), // invalid characters
+ array('abc(def@example.com'), // invalid character (
+ array('abc)def@example.com'), // invalid character )
+ array('abc[def@example.com'), // invalid character [
+ array('abc]def@example.com'), // invalid character ]
+ array('abc\def@example.com'), // invalid character \
+ array('abc;def@example.com'), // invalid character ;
+ array('abc:def@example.com'), // invalid character :
+ array('abc,def@example.com'), // invalid character ,
+ array('abc<def@example.com'), // invalid character <
+ array('abc>def@example.com'), // invalid character >
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('missingDomain@.com'),
+ array('@missingLocal.org'),
+ array('missingatSign.net'),
+ array('missingDot@com'),
+ array('two@@signs.com'),
+ array('colonButNoPort@127.0.0.1:'),
+ array(''),
+ array('someone-else@127.0.0.1.26'),
+ array('.localStartsWithDot@domain.com'),
+ array('localEndsWithDot.@domain.com'),
+ array('two..consecutiveDots@domain.com'),
+ array('domainStartsWithDash@-domain.com'),
+ array('domainEndsWithDash@domain-.com'),
+ array('numbersInTLD@domain.c0m'),
+ array('missingTLD@domain.'),
+ array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'),
+ array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'),
+ array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'),
+ );
+ }
+
+ /**
+ * @dataProvider positive_match_data
+ */
+ public function test_positive_match($email)
+ {
+ $this->assertEquals(1, preg_match($this->regex, $email));
+ }
+
+ /**
+ * @dataProvider negative_match_data
+ */
+ public function test_negative_match($email)
+ {
+ $this->assertEquals(0, preg_match($this->regex, $email));
+ }
+}
+
diff --git a/tests/regex/ipv4.php b/tests/regex/ipv4.php
new file mode 100644
index 0000000000..9d131ad0ca
--- /dev/null
+++ b/tests/regex/ipv4.php
@@ -0,0 +1,72 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_regex_ipv4_test extends phpbb_test_case
+{
+ protected $regex;
+
+ public function setUp()
+ {
+ $this->regex = get_preg_expression('ipv4');
+ }
+
+ public function positive_match_data()
+ {
+ return array(
+ array('0.0.0.0'),
+ array('127.0.0.1'),
+ array('192.168.0.1'),
+ array('255.255.255.255'),
+ );
+ }
+
+ public function negative_match_data()
+ {
+ return array(
+ // IPv6 addresses
+ array('2001:0db8:85a3:0000:0000:8a2e:0370:1337'),
+ array('2001:db8:85a3:c:d:8a2e:370:1337'),
+ array('2001:db8:85a3::8a2e:370:1337'),
+ array('2001:db8:0:1::192.168.0.2'),
+ array('0:0:0:0:0:0:0:1'),
+ array('0:0::0:0:1'),
+ array('::1'),
+
+ // Out of scope
+ array('255.255.255.256'),
+
+ // Other tests
+ array('a.b.c.d'),
+ array('11.22.33.'),
+ array('11.22.33'),
+ array('11.22'),
+ array('11'),
+ );
+ }
+
+ /**
+ * @dataProvider positive_match_data
+ */
+ public function test_positive_match($address)
+ {
+ $this->assertEquals(1, preg_match($this->regex, $address));
+ }
+
+ /**
+ * @dataProvider negative_match_data
+ */
+ public function test_negative_match($address)
+ {
+ $this->assertEquals(0, preg_match($this->regex, $address));
+ }
+}
+
diff --git a/tests/regex/ipv6.php b/tests/regex/ipv6.php
new file mode 100644
index 0000000000..3d7a72e492
--- /dev/null
+++ b/tests/regex/ipv6.php
@@ -0,0 +1,143 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_regex_ipv6_test extends phpbb_test_case
+{
+ protected $regex;
+
+ public function setUp()
+ {
+ $this->regex = get_preg_expression('ipv6');
+ }
+
+ public function positive_match_data()
+ {
+ return array(
+ // Full length IPv6 address
+ array('2001:0db8:85a3:0000:0000:8a2e:0370:1337'),
+ array('0000:0000:0000:0000:0000:0000:0000:0001'),
+ array('3FFE:0b00:0000:0000:0001:0000:0000:000a'),
+ array('3ffe:0b00:0000:0000:0001:0000:0000:000a'),
+ array('2002:0db8:0000:0000:0000:dead:1337:d00d'),
+
+ // No leading zeroes in the group
+ array('2001:db8:85a3:0:0:8a2e:370:1337'),
+ array('2001:db8:85a3:c:d:8a2e:370:1337'),
+
+ // Consecutive all-zero groups
+ array('2001:db8:85a3::8a2e:370:1337'),
+ array('1::2:3:4:5:6:7'),
+ array('1::2:3:4:5:6'),
+ array('1::2:3:4:5'),
+ array('1::2:3:4'),
+ array('1::2:3'),
+ array('1::2'),
+
+ // Last 32bit in dotted quad notation
+ array('2001:db8:0:1::192.168.0.2'),
+
+ // IPv4-compatible IPv6 address
+ array('::13.1.68.3'),
+ array('0:0:0:0:0:0:13.1.68.3'),
+
+ // IPv4-mapped IPv6 address
+ array('::ffff:c000:280'),
+ array('::ffff:c000:0280'),
+ array('::ffff:192.0.2.128'),
+ array('0:0:0:0:0:ffff:c000:280'),
+ array('0:0:0:0:0:ffff:c000:0280'),
+ array('0:0:0:0:0:ffff:192.0.2.128'),
+ array('0000:0000:0000:0000:0000:ffff:c000:280'),
+ array('0000:0000:0000:0000:0000:ffff:c000:0280'),
+ array('0000:0000:0000:0000:0000:ffff:192.0.2.128'),
+
+ // No trailing zeroes
+ array('fe80::'),
+ array('2002::'),
+ array('2001:db8::'),
+ array('2001:0db8:1234::'),
+ array('1:2:3:4:5:6::'),
+ array('1:2:3:4:5::'),
+ array('1:2:3:4::'),
+ array('1:2:3::'),
+ array('1:2::'),
+
+ // No leading zeroes
+ array('::2:3:4:5:6:7:8'),
+ array('::2:3:4:5:6:7'),
+ array('::2:3:4:5:6'),
+ array('::2:3:4:5'),
+ array('::2:3:4'),
+ array('::2:3'),
+ array('::1'),
+ array('::8'),
+ array('::c'),
+ array('::abcd'),
+
+ // All zeroes
+ array('::'),
+ array('0:0:0:0:0:0:0:0'),
+ array('0000:0000:0000:0000:0000:0000:0000:0000'),
+
+ // More tests
+ array('2::10'),
+ array('0:0::0:0:1'),
+ array('0:0:0:0:0:0:0:1'),
+ array('::ffff:0:0'),
+ );
+ }
+
+ public function negative_match_data()
+ {
+ return array(
+ // Empty address
+ array(''),
+
+ // IPv4 address
+ array('192.168.0.2'),
+
+ // Out of scope
+ array('abcd:efgh:0000::0'),
+ array('::ffff:192.168.255.256'),
+
+ // Double ::
+ array('2001::23de::2002'),
+ array('3ffe:b00::1::b'),
+ array('::1111:2222:3333:4444:5555:6666::'),
+
+ // Too many blocks
+ array('2001:0db8:85a3:08d3:1319:8a2e:0370:1337:4430'),
+
+ // More tests
+ array('02001:0000:1234:0000:0000:C1C0:ABCD:9876'),
+ array('2001:0000:1234: 0000:0000:C1C0:ABCD:9876'),
+ array('::ffff:192x168.255.255'),
+ );
+ }
+
+ /**
+ * @dataProvider positive_match_data
+ */
+ public function test_positive_match($address)
+ {
+ $this->assertEquals(1, preg_match($this->regex, $address));
+ }
+
+ /**
+ * @dataProvider negative_match_data
+ */
+ public function test_negative_match($address)
+ {
+ $this->assertEquals(0, preg_match($this->regex, $address));
+ }
+}
+
diff --git a/tests/regex/url.php b/tests/regex/url.php
new file mode 100644
index 0000000000..678b7d108f
--- /dev/null
+++ b/tests/regex/url.php
@@ -0,0 +1,34 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/functions.php';
+
+class phpbb_regex_url_test extends phpbb_test_case
+{
+ public function url_test_data()
+ {
+ return array(
+ array('http://www.phpbb.com/community/', 1),
+ array('http://www.phpbb.com/path/file.ext#section', 1),
+ array('ftp://ftp.phpbb.com/', 1),
+ array('sip://bantu@phpbb.com', 1),
+
+ array('www.phpbb.com/community/', 0),
+ );
+ }
+
+ /**
+ * @dataProvider url_test_data
+ */
+ public function test_url($url, $expected)
+ {
+ $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#i', $url));
+ }
+}
diff --git a/tests/template/template.php b/tests/template/template.php
index 145fe8de61..0c2ca8a032 100644
--- a/tests/template/template.php
+++ b/tests/template/template.php
@@ -26,12 +26,25 @@ class phpbb_template_template_test extends phpbb_test_case
error_reporting($error_level & ~E_NOTICE);
ob_start();
- $this->assertTrue($this->template->display($handle, false));
+
+ try
+ {
+ $this->assertTrue($this->template->display($handle, false));
+ }
+ catch (Exception $exception)
+ {
+ // reset the error level even when an error occured
+ // PHPUnit turns trigger_error into exceptions as well
+ error_reporting($error_level);
+ ob_end_clean();
+ throw $exception;
+ }
+
+ $result = self::trim_template_result(ob_get_clean());
// reset error level
error_reporting($error_level);
-
- return self::trim_template_result(ob_get_clean());
+ return $result;
}
private static function trim_template_result($result)
@@ -368,9 +381,15 @@ class phpbb_template_template_test extends phpbb_test_case
$this->template->destroy_block_vars($block);
}
+ $error_level = error_reporting();
+ error_reporting($error_level & ~E_NOTICE);
+
$this->assertEquals($expected, self::trim_template_result($this->template->assign_display('test')), "Testing assign_display($file)");
$this->template->assign_display('test', 'VARIABLE', false);
+
+ error_reporting($error_level);
+
$this->assertEquals($expected, $this->display('container'), "Testing assign_display($file)");
}
diff --git a/tests/test_framework/framework.php b/tests/test_framework/framework.php
index abdcd1ad79..3a11cc6df9 100644
--- a/tests/test_framework/framework.php
+++ b/tests/test_framework/framework.php
@@ -32,8 +32,12 @@ if (version_compare(PHPUnit_Runner_Version::id(), '3.3.0', '<'))
trigger_error('PHPUnit >= 3.3.0 required');
}
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/Extensions/Database/TestCase.php';
+if (version_compare(PHPUnit_Runner_Version::id(), '3.5.0', '<'))
+{
+ require_once 'PHPUnit/Framework.php';
+ require_once 'PHPUnit/Extensions/Database/TestCase.php';
+}
+
require_once 'test_framework/phpbb_test_case_helpers.php';
require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index d558874c6f..a64bae8c57 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -9,17 +9,21 @@
abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_TestCase
{
+ private static $already_connected;
+
protected $test_case_helpers;
- public function init_test_case_helpers()
+ public function get_test_case_helpers()
{
if (!$this->test_case_helpers)
{
$this->test_case_helpers = new phpbb_test_case_helpers($this);
}
+
+ return $this->test_case_helpers;
}
- function get_dbms_data($dbms)
+ public function get_dbms_data($dbms)
{
$available_dbms = array(
'firebird' => array(
@@ -50,7 +54,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
'mssqlnative' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
- 'PDO' => 'odbc',
+ 'PDO' => 'sqlsrv',
),
'oracle' => array(
'SCHEMA' => 'oracle',
@@ -65,7 +69,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
'sqlite' => array(
'SCHEMA' => 'sqlite',
'DELIM' => ';',
- 'PDO' => 'sqlite',
+ 'PDO' => 'sqlite2',
),
);
@@ -79,10 +83,57 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
}
}
- function split_sql_file($sql, $delimiter)
+ public function get_database_config()
{
+ if (isset($_SERVER['PHPBB_TEST_DBMS']))
+ {
+ return array(
+ 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $_SERVER['PHPBB_TEST_DBMS'] : '',
+ 'dbhost' => isset($_SERVER['PHPBB_TEST_DBHOST']) ? $_SERVER['PHPBB_TEST_DBHOST'] : '',
+ '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'] : '',
+ );
+ }
+ else if (file_exists('test_config.php'))
+ {
+ include('test_config.php');
+
+ return array(
+ 'dbms' => $dbms,
+ 'dbhost' => $dbhost,
+ 'dbport' => $dbport,
+ 'dbname' => $dbname,
+ 'dbuser' => $dbuser,
+ 'dbpasswd' => $dbpasswd,
+ );
+ }
+ else if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
+ {
+ // Silently use sqlite
+ return array(
+ 'dbms' => 'sqlite',
+ 'dbhost' => 'phpbb_unit_tests.sqlite2', // filename
+ 'dbport' => '',
+ 'dbname' => '',
+ 'dbuser' => '',
+ 'dbpasswd' => '',
+ );
+ }
+ else
+ {
+ $this->markTestSkipped('Missing test_config.php: See first error.');
+ }
+ }
+
+ // NOTE: This function is not the same as split_sql_file from functions_install
+ public function split_sql_file($sql, $dbms)
+ {
+ $dbms_data = $this->get_dbms_data($dbms);
+
$sql = str_replace("\r" , '', $sql);
- $data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql);
+ $data = preg_split('/' . preg_quote($dbms_data['DELIM'], '/') . '$/m', $sql);
$data = array_map('trim', $data);
@@ -94,61 +145,211 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
unset($data[key($data)]);
}
+ if ($dbms == 'sqlite')
+ {
+ // remove comment lines starting with # - they are not proper sqlite
+ // syntax and break sqlite2
+ foreach ($data as $i => $query)
+ {
+ $data[$i] = preg_replace('/^#.*$/m', "\n", $query);
+ }
+ }
+
return $data;
}
- public function getConnection()
+ /**
+ * Retrieves a list of all tables from the database.
+ *
+ * @param PDO $pdo
+ * @param string $dbms
+ * @return array(string)
+ */
+ function get_tables($pdo, $dbms)
{
- static $already_connected;
+ switch ($pdo)
+ {
+ case 'mysql':
+ case 'mysql4':
+ case 'mysqli':
+ $sql = 'SHOW TABLES';
+ break;
- $this->init_test_case_helpers();
- $database_config = $this->test_case_helpers->get_database_config();
+ case 'sqlite':
+ $sql = 'SELECT name
+ FROM sqlite_master
+ WHERE type = "table"';
+ break;
+
+ case 'mssql':
+ case 'mssql_odbc':
+ case 'mssqlnative':
+ $sql = "SELECT name
+ FROM sysobjects
+ WHERE type='U'";
+ break;
+
+ case 'postgres':
+ $sql = 'SELECT relname
+ FROM pg_stat_user_tables';
+ break;
+
+ case 'firebird':
+ $sql = 'SELECT rdb$relation_name
+ FROM rdb$relations
+ WHERE rdb$view_source is null
+ AND rdb$system_flag = 0';
+ break;
+
+ case 'oracle':
+ $sql = 'SELECT table_name
+ FROM USER_TABLES';
+ break;
+ }
- $dbms_data = $this->get_dbms_data($database_config['dbms']);
+ $result = $pdo->query($sql);
- if ($already_connected)
+ $tables = array();
+ while ($row = $result->fetch(PDO::FETCH_NUM))
{
- $pdo = new PDO($dbms_data['PDO'] . ':host=' . $database_config['dbhost'] . ';dbname=' . $database_config['dbname'], $database_config['dbuser'], $database_config['dbpasswd']);
+ $tables[] = current($row);
}
- else
+
+ return $tables;
+ }
+
+ /**
+ * Returns a PDO connection for the configured database.
+ *
+ * @param array $config The database configuration
+ * @param array $dbms Information on the used DBMS.
+ * @param bool $use_db Whether the DSN should be tied to a
+ * particular database making it impossible
+ * to delete that database.
+ * @return PDO The PDO database connection.
+ */
+ public function new_pdo($config, $dbms, $use_db)
+ {
+ $dsn = $dbms['PDO'] . ':';
+
+ switch ($dbms['PDO'])
{
- $pdo = new PDO($dbms_data['PDO'] . ':host=' . $database_config['dbhost'] . ';', $database_config['dbuser'], $database_config['dbpasswd']);
+ case 'sqlite2':
+ $dsn .= $config['dbhost'];
+ break;
- try
- {
- $pdo->exec('DROP DATABASE ' . $database_config['dbname']);
- }
- catch (PDOException $e){} // ignore non existent db
+ case 'sqlsrv':
+ // prefix the hostname (or DSN) with Server= so using just (local)\SQLExpress
+ // works for example, further parameters can still be appended using ;x=y
+ $dsn .= 'Server=';
+ // no break -> rest like ODBC
+ case 'odbc':
+ // for ODBC assume dbhost is a suitable DSN
+ // e.g. Driver={SQL Server Native Client 10.0};Server=(local)\SQLExpress;
+ $dsn .= $config['dbhost'];
+
+ if ($use_db)
+ {
+ $dsn .= ';Database=' . $config['dbname'];
+ }
+ break;
+
+ default:
+ $dsn .= 'host=' . $config['dbhost'];
+
+ if ($use_db)
+ {
+ $dsn .= ';dbname=' . $config['dbname'];
+ }
+ break;
+ }
- $pdo->exec('CREATE DATABASE ' . $database_config['dbname']);
+ $pdo = new PDO($dsn, $config['dbuser'], $config['dbpasswd']);;
- $pdo = new PDO($dbms_data['PDO'] . ':host=' . $database_config['dbhost'] . ';dbname=' . $database_config['dbname'], $database_config['dbuser'], $database_config['dbpasswd']);
+ // good for debug
+ // $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- if ($database_config['dbms'] == 'mysql')
- {
- $sth = $pdo->query('SELECT VERSION() AS version');
- $row = $sth->fetch(PDO::FETCH_ASSOC);
+ return $pdo;
+ }
- if (version_compare($row['version'], '4.1.3', '>='))
+ private function recreate_db($config, $dbms)
+ {
+ switch ($config['dbms'])
+ {
+ case 'sqlite':
+ if (file_exists($config['dbhost']))
{
- $dbms_data['SCHEMA'] .= '_41';
+ unlink($config['dbhost']);
}
- else
+ break;
+
+ default:
+ $pdo = $this->new_pdo($config, $dbms, false);
+
+ try
{
- $dbms_data['SCHEMA'] .= '_40';
+ $pdo->exec('DROP DATABASE ' . $config['dbname']);
}
+ catch (PDOException $e)
+ {
+ // try to delete all tables if dropping the database was not possible.
+ foreach ($this->get_tables() as $table)
+ {
+ try
+ {
+ $pdo->exec('DROP TABLE ' . $table);
+ }
+ catch (PDOException $e){} // ignore non-existent tables
+ }
+ }
- unset($row, $sth);
- }
+ $pdo->exec('CREATE DATABASE ' . $config['dbname']);
+ break;
+ }
+ }
- $sql_query = $this->split_sql_file(file_get_contents("../phpBB/install/schemas/{$dbms_data['SCHEMA']}_schema.sql"), $dbms_data['DELIM']);
+ private function load_schema($pdo, $config, $dbms)
+ {
+ if ($config['dbms'] == 'mysql')
+ {
+ $sth = $pdo->query('SELECT VERSION() AS version');
+ $row = $sth->fetch(PDO::FETCH_ASSOC);
- foreach ($sql_query as $sql)
+ if (version_compare($row['version'], '4.1.3', '>='))
+ {
+ $dbms['SCHEMA'] .= '_41';
+ }
+ else
{
- $pdo->exec($sql);
+ $dbms['SCHEMA'] .= '_40';
}
+ }
+
+ $sql = $this->split_sql_file(file_get_contents("../phpBB/install/schemas/{$dbms['SCHEMA']}_schema.sql"), $config['dbms']);
- $already_connected = true;
+ foreach ($sql as $query)
+ {
+ $pdo->exec($query);
+ }
+ }
+
+ public function getConnection()
+ {
+ $config = $this->get_database_config();
+ $dbms = $this->get_dbms_data($config['dbms']);
+
+ if (!self::$already_connected)
+ {
+ $this->recreate_db($config, $dbms);
+ }
+
+ $pdo = $this->new_pdo($config, $dbms, true);
+
+ if (!self::$already_connected)
+ {
+ $this->load_schema($pdo, $config, $dbms);
+
+ self::$already_connected = true;
}
return $this->createDefaultDBConnection($pdo, 'testdb');
@@ -156,13 +357,20 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
public function new_dbal()
{
- $this->init_test_case_helpers();
- return $this->test_case_helpers->new_dbal();
+ global $phpbb_root_path, $phpEx;
+
+ $config = $this->get_database_config();
+
+ require_once '../phpBB/includes/db/' . $config['dbms'] . '.php';
+ $dbal = 'dbal_' . $config['dbms'];
+ $db = new $dbal();
+ $db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
+
+ return $db;
}
public function setExpectedTriggerError($errno, $message = '')
{
- $this->init_test_case_helpers();
- $this->test_case_helpers->setExpectedTriggerError($errno, $message);
+ $this->get_test_case_helpers()->setExpectedTriggerError($errno, $message);
}
}
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php
index af867b29ff..fe90d321dc 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -11,17 +11,18 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
{
protected $test_case_helpers;
- public function init_test_case_helpers()
+ public function get_test_case_helpers()
{
if (!$this->test_case_helpers)
{
$this->test_case_helpers = new phpbb_test_case_helpers($this);
}
+
+ return $this->test_case_helpers;
}
public function setExpectedTriggerError($errno, $message = '')
{
- $this->init_test_case_helpers();
- $this->test_case_helpers->setExpectedTriggerError($errno, $message);
+ $this->get_test_case_helpers()->setExpectedTriggerError($errno, $message);
}
}
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 0c5932e1ad..0acdce32e0 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -18,59 +18,6 @@ class phpbb_test_case_helpers
$this->test_case = $test_case;
}
- public function get_database_config()
- {
- static $show_error = true;
-
- if (!file_exists('test_config.php'))
- {
- if ($show_error)
- {
- $show_error = false;
- }
- else
- {
- $this->test_case->markTestSkipped('Missing test_config.php: See first error.');
- return;
- }
-
- trigger_error("You have to create a test_config.php like this:
-\"<?php
-\$dbms = 'mysqli';
-\$dbhost = 'localhost';
-\$dbport = '';
-\$dbname = 'database';
-\$dbuser = 'user';
-\$dbpasswd = 'password';
-\"
-
-NOTE: The database is dropped and recreated with the phpbb-db-schema! Do NOT specify a database with important data.", E_USER_ERROR);
- }
- include('test_config.php');
-
- return array(
- 'dbms' => $dbms,
- 'dbhost' => $dbhost,
- 'dbport' => $dbport,
- 'dbname' => $dbname,
- 'dbuser' => $dbuser,
- 'dbpasswd' => $dbpasswd,
- );
- }
-
- public function new_dbal()
- {
- global $phpbb_root_path, $phpEx;
- $config = $this->get_database_config();
-
- require_once '../phpBB/includes/db/' . $config['dbms'] . '.php';
- $dbal = 'dbal_' . $config['dbms'];
- $db = new $dbal();
- $db->sql_connect($config['dbhost'], $config['dbuser'], $config['dbpasswd'], $config['dbname'], $config['dbport']);
-
- return $db;
- }
-
public function setExpectedTriggerError($errno, $message = '')
{
$exceptionName = '';