aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/build.xml20
-rwxr-xr-xbuild/build_changelog.php53
-rwxr-xr-xgit-tools/hooks/commit-msg100
-rw-r--r--phpBB/adm/style/acp_icons.html4
-rw-r--r--phpBB/adm/style/acp_main.html30
-rw-r--r--phpBB/adm/style/acp_users.html2
-rw-r--r--phpBB/adm/style/admin.css8
-rw-r--r--phpBB/adm/style/editor.js68
-rw-r--r--phpBB/develop/create_schema_files.php41
-rw-r--r--phpBB/docs/CHANGELOG.html169
-rw-r--r--phpBB/docs/INSTALL.html4
-rw-r--r--phpBB/docs/README.html2
-rw-r--r--phpBB/docs/coding-guidelines.html94
-rw-r--r--phpBB/includes/acp/acp_ban.php34
-rw-r--r--phpBB/includes/acp/acp_board.php28
-rw-r--r--phpBB/includes/acp/acp_database.php9
-rw-r--r--phpBB/includes/acp/acp_email.php10
-rw-r--r--phpBB/includes/acp/acp_forums.php10
-rw-r--r--phpBB/includes/acp/acp_inactive.php10
-rw-r--r--phpBB/includes/acp/acp_language.php9
-rw-r--r--phpBB/includes/acp/acp_main.php11
-rw-r--r--phpBB/includes/acp/acp_ranks.php2
-rw-r--r--phpBB/includes/acp/acp_update.php2
-rw-r--r--phpBB/includes/acp/acp_users.php12
-rw-r--r--phpBB/includes/auth/auth_db.php11
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/db/db_tools.php178
-rw-r--r--phpBB/includes/db/dbal.php2
-rw-r--r--phpBB/includes/db/mssqlnative.php2
-rw-r--r--phpBB/includes/db/mysqli.php8
-rw-r--r--phpBB/includes/error_collector.php12
-rw-r--r--phpBB/includes/functions.php119
-rw-r--r--phpBB/includes/functions_admin.php19
-rw-r--r--phpBB/includes/functions_display.php24
-rw-r--r--phpBB/includes/functions_install.php57
-rw-r--r--phpBB/includes/functions_messenger.php42
-rw-r--r--phpBB/includes/functions_posting.php8
-rw-r--r--phpBB/includes/functions_privmsgs.php9
-rw-r--r--phpBB/includes/mcp/mcp_main.php17
-rw-r--r--phpBB/includes/mcp/mcp_post.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php3
-rw-r--r--phpBB/includes/mcp/mcp_reports.php1
-rw-r--r--phpBB/includes/mcp/mcp_topic.php4
-rw-r--r--phpBB/includes/startup.php4
-rw-r--r--phpBB/includes/ucp/ucp_activate.php5
-rw-r--r--phpBB/includes/ucp/ucp_groups.php52
-rw-r--r--phpBB/includes/ucp/ucp_pm.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php17
-rw-r--r--phpBB/includes/ucp/ucp_register.php9
-rw-r--r--phpBB/includes/ucp/ucp_resend.php10
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php8
-rw-r--r--phpBB/install/database_update.php32
-rw-r--r--phpBB/install/install_convert.php21
-rw-r--r--phpBB/install/install_install.php12
-rw-r--r--phpBB/install/schemas/firebird_schema.sql7
-rw-r--r--phpBB/install/schemas/mssql_schema.sql10
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql7
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql7
-rw-r--r--phpBB/install/schemas/oracle_schema.sql10
-rw-r--r--phpBB/install/schemas/postgres_schema.sql10
-rw-r--r--phpBB/install/schemas/schema_data.sql3
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql7
-rw-r--r--phpBB/language/en/acp/ban.php3
-rw-r--r--phpBB/language/en/acp/board.php2
-rw-r--r--phpBB/language/en/acp/common.php10
-rw-r--r--phpBB/language/en/acp/database.php1
-rw-r--r--phpBB/language/en/acp/forums.php2
-rw-r--r--phpBB/language/en/acp/language.php1
-rw-r--r--phpBB/language/en/common.php2
-rw-r--r--phpBB/language/en/email/admin_welcome_activated.txt2
-rw-r--r--phpBB/language/en/email/privmsg_notify.txt2
-rw-r--r--phpBB/language/en/help_faq.php2
-rw-r--r--phpBB/language/en/install.php4
-rw-r--r--phpBB/language/en/ucp.php3
-rw-r--r--phpBB/memberlist.php5
-rw-r--r--phpBB/posting.php22
-rw-r--r--phpBB/styles/prosilver/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/prosilver/style.cfg2
-rw-r--r--phpBB/styles/prosilver/template/editor.js81
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html10
-rw-r--r--phpBB/styles/prosilver/template/mcp_approve.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_user.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_post.html1
-rw-r--r--phpBB/styles/prosilver/template/message_body.html12
-rw-r--r--phpBB/styles/prosilver/template/search_results.html10
-rw-r--r--phpBB/styles/prosilver/template/template.cfg2
-rw-r--r--phpBB/styles/prosilver/template/ucp_attachments.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_manage.html9
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html155
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html10
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html11
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css4
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css2
-rw-r--r--phpBB/styles/prosilver/theme/common.css2
-rw-r--r--phpBB/styles/prosilver/theme/content.css16
-rw-r--r--phpBB/styles/prosilver/theme/cp.css2
-rw-r--r--phpBB/styles/prosilver/theme/forms.css3
-rw-r--r--phpBB/styles/prosilver/theme/links.css2
-rw-r--r--phpBB/styles/prosilver/theme/print.css9
-rw-r--r--phpBB/styles/prosilver/theme/stylesheet.css12
-rw-r--r--phpBB/styles/prosilver/theme/theme.cfg2
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css2
-rw-r--r--phpBB/styles/subsilver2/imageset/imageset.cfg2
-rw-r--r--phpBB/styles/subsilver2/style.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/editor.js96
-rw-r--r--phpBB/styles/subsilver2/template/template.cfg2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html2
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css15
-rw-r--r--phpBB/styles/subsilver2/theme/theme.cfg2
-rw-r--r--phpBB/ucp.php6
-rw-r--r--phpBB/viewforum.php13
-rw-r--r--phpBB/viewtopic.php5
-rw-r--r--tests/dbal/cross_join_test.php55
-rw-r--r--tests/dbal/db_tools_test.php26
-rw-r--r--tests/dbal/fixtures/massmail_crossjoin.xml59
-rw-r--r--tests/dbal/fixtures/three_users.xml16
-rw-r--r--tests/dbal/select_test.php18
-rw-r--r--tests/error_collector_test.php35
-rw-r--r--tests/mock/cache.php22
-rw-r--r--tests/mock_user.php16
-rw-r--r--tests/profile/custom_test.php2
-rw-r--r--tests/regex/table_prefix_test.php35
-rw-r--r--tests/session/append_sid_test.php51
-rw-r--r--tests/session/fixtures/sessions_empty.xml16
-rw-r--r--tests/session/fixtures/sessions_full.xml16
-rw-r--r--tests/template/template_test.php5
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php5
-rw-r--r--tests/text_processing/censor_text_test.php85
-rw-r--r--tests/utf/normalizer_test.php4
130 files changed, 1675 insertions, 853 deletions
diff --git a/build/build.xml b/build/build.xml
index eb63bde034..bf4c97297b 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.0.9" />
- <property name="prevversion" value="3.0.8" />
- <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.9-RC1, 3.0.9-RC2, 3.0.9-RC3, 3.0.9-RC4" />
+ <property name="newversion" value="3.0.10-RC3" />
+ <property name="prevversion" value="3.0.9" />
+ <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.10-RC1, 3.0.10-RC2" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@@ -119,6 +119,7 @@
<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" />
+
<exec dir="build" escape="false"
command="diff -crNEBwd old_versions/release-${prevversion}/language new_version/phpBB3/language >
save/save_${prevversion}_to_${newversion}/language/phpbb-${prevversion}_to_${newversion}_language.patch" />
@@ -128,6 +129,19 @@
<exec dir="build" escape="false"
command="diff -crNEBwd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
save/save_${prevversion}_to_${newversion}/subsilver2/phpbb-${prevversion}_to_${newversion}_subsilver2.patch" />
+
+ <exec dir="build" escape="false"
+ command="git shortlog --summary --numbered release-${prevversion}...HEAD >
+ save/save_${prevversion}_to_${newversion}/phpbb-${prevversion}_to_${newversion}_git_shortlog.txt" />
+ <exec dir="build" escape="false"
+ command="git diff --stat release-${prevversion}...HEAD >
+ save/save_${prevversion}_to_${newversion}/phpbb-${prevversion}_to_${newversion}_git_diffstat.txt" />
+ </target>
+
+ <target name="changelog" depends="prepare">
+ <exec dir="build" escape="false"
+ command="php -f build_changelog.php '${newversion}' >
+ save/changelog_${newversion}.html" />
</target>
<!--
diff --git a/build/build_changelog.php b/build/build_changelog.php
new file mode 100755
index 0000000000..4eb5ebd83b
--- /dev/null
+++ b/build/build_changelog.php
@@ -0,0 +1,53 @@
+#!/usr/bin/env php
+<?php
+/**
+*
+* @package build
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
+*
+*/
+
+if ($_SERVER['argc'] != 2)
+{
+ echo "Please specify the new version as argument (e.g. build_changelog.php '1.0.2').\n";
+ exit(1);
+}
+
+$fixVersion = $_SERVER['argv'][1];
+
+$query = 'project = PHPBB3
+ AND resolution = Fixed
+ AND fixVersion = "' . $fixVersion . '"
+ AND status IN ("Unverified Fix", Closed)';
+
+$url = 'http://tracker.phpbb.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=' . urlencode($query) . '&tempMax=1000';
+$xml = simplexml_load_string(file_get_contents($url));
+
+foreach ($xml->xpath('//item') as $item)
+{
+ $key = (string) $item->key;
+
+ $keyUrl = 'http://tracker.phpbb.com/browse/' . $key;
+ $keyLink = '<a href="' . $keyUrl . '">' . $key . '</a>';
+
+ $value = str_replace($key, $keyLink, htmlspecialchars($item->title));
+ $value = str_replace(']', '] -', $value);
+
+ $types[(string) $item->type][$key] = $value;
+}
+
+ksort($types);
+foreach ($types as $type => $tickets)
+{
+ echo "<h4>$type</h4>\n";
+ echo "<ul>\n";
+
+ uksort($tickets, 'strnatcasecmp');
+
+ foreach ($tickets as $ticket)
+ {
+ echo "<li>$ticket</li>\n";
+ }
+ echo "</ul>\n";
+}
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
index 4f6ae71d4b..52969670ca 100755
--- a/git-tools/hooks/commit-msg
+++ b/git-tools/hooks/commit-msg
@@ -11,16 +11,16 @@
#
# ln -s ../../git-tools/hooks/commit-msg \\
# .git/hooks/commit-msg
+#
+# Warning/error messages use color by default if the output is a terminal
+# ("output" here is normally standard error when you run git commit).
+# To force or disable the use of color:
+#
+# git config phpbb.hooks.commit-msg.color true (force color output)
+# git config phpbb.hooks.commit-msg.color false (disable color output)
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
@@ -47,11 +47,55 @@ debug()
quit()
{
- if [ $1 -gt 0 ] && [ $1 -ne $ERR_UNKNOWN ] && [ $fatal -eq 0 ]
+ # Now we always exit with success, since git will trash
+ # entered commit message if commit-msg hook exits with a failure.
+ exit 0
+}
+
+use_color()
+{
+ if [ -z "$use_color_cached" ]
then
- exit 0;
+ case $(git config --bool $config_ns.color)
+ in
+ false)
+ use_color_cached=1
+ ;;
+ true)
+ use_color_cached=0
+ ;;
+ *)
+ # tty detection in shell:
+ # http://hwi.ath.cx/jsh/list/shext/isatty.sh.html
+ tty 0>/dev/stdout >/dev/null 2>&1
+ use_color_cached=$?
+ ;;
+ esac
+ fi
+ # return value is the flag inverted -
+ # if return value is 0, this means use color
+ return $use_color_cached
+}
+
+complain()
+{
+ if use_color
+ then
+ # Careful: our argument may include arguments to echo like -n
+ # ANSI color codes:
+ # http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html
+ printf "\033[31m\033[1m"
+ if [ "$1" = "-n" ]
+ then
+ echo "$@"
+ printf "\033[0m"
+ else
+ # This will print one trailing space.
+ # Not sure how to avoid this at the moment.
+ echo "$@" $(printf "\033[0m")
+ fi
else
- exit $1;
+ echo "$@"
fi
}
@@ -70,9 +114,9 @@ msg=$(grep -v '^#' "$1" |grep -nE '.{81,}')
if [ $? -eq 0 ]
then
- echo "The following lines are greater than 80 characters long:" >&2;
- echo >&2
- echo "$msg" >&2;
+ complain "The following lines are greater than 80 characters long:" >&2;
+ complain >&2
+ complain "$msg" >&2;
quit $ERR_LENGTH;
fi
@@ -126,9 +170,9 @@ do
# Don't be too strict.
# Commits may be temporary, intended to be squashed later.
# Just issue a warning here.
- echo "Warning: heading should be a sentence beginning with a capital letter." 1>&2
- echo "You entered:" 1>&2
- echo "$line" 1>&2
+ complain "Warning: heading should be a sentence beginning with a capital letter." 1>&2
+ complain "You entered:" 1>&2
+ complain "$line" 1>&2
fi
# restore exit code
(exit $result)
@@ -160,7 +204,7 @@ do
echo "$line" | grep -Eq "^#";
;;
*)
- echo "Unrecognised token $expect" >&2;
+ complain "Unrecognised token $expect" >&2;
quit $err;
;;
esac
@@ -231,7 +275,7 @@ do
expecting="eof";
;;
*)
- echo "Unrecognised token $expect" >&2;
+ complain "Unrecognised token $expect" >&2;
quit 254;
;;
esac
@@ -245,11 +289,11 @@ do
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;
+ complain "Syntax error on line $i:" >&2;
+ complain ">> $line" >&2;
+ complain -n "Expecting: " >&2;
+ complain "$expecting" | sed 's/ /, /g' >&2;
+ quit $err;
fi
i=$(( $i + 1 ));
@@ -258,7 +302,7 @@ done
# If EOF is expected exit cleanly
echo "$expecting" | grep -q "eof" || (
# Unexpected EOF, error
- echo "Unexpected EOF encountered" >&2;
+ complain "Unexpected EOF encountered" >&2;
quit $ERR_EOF;
) && (
# Do post scan checks
@@ -269,8 +313,8 @@ echo "$expecting" | grep -q "eof" || (
if [ ! -z "$dupes" ]
then
- echo "The following tickets are repeated:" >&2;
- echo "$dupes" | sed 's/ /\n/g;s/^/* /g' >&2;
+ complain "The following tickets are repeated:" >&2;
+ complain "$dupes" | sed 's/ /\n/g;s/^/* /g' >&2;
quit $ERR_FOOTER;
fi
fi
@@ -278,8 +322,8 @@ echo "$expecting" | grep -q "eof" || (
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;
+ complain "Ticket ID [$ticket] of branch missing from list of tickets:" >&2;
+ complain "$tickets" | sed 's/ /\n/g;s/^/* /g' >&2;
quit $ERR_FOOTER;
) || exit $?;
fi
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html
index eedf39b440..a34a91043c 100644
--- a/phpBB/adm/style/acp_icons.html
+++ b/phpBB/adm/style/acp_icons.html
@@ -74,7 +74,7 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <table cellspacing="1">
+ <table cellspacing="1" id="smilies">
<thead>
<tr>
<th colspan="{COLSPAN}">{L_CONFIG}</th>
@@ -94,7 +94,7 @@
<td>{L_ORDER}</td>
<!-- ENDIF -->
<!-- IF S_ADD -->
- <td>{L_ADD}</td>
+ <td>{L_ADD} <a href="#" onclick="marklist('smilies', 'add_img', true); return false;">({L_MARK_ALL})</a></td>
<!-- ENDIF -->
</tr>
</thead>
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html
index 7d3b6945ac..c665c9d893 100644
--- a/phpBB/adm/style/acp_main.html
+++ b/phpBB/adm/style/acp_main.html
@@ -34,6 +34,36 @@
</div>
<!-- ENDIF -->
+ <!-- IF S_MBSTRING_LOADED -->
+ <!-- IF S_MBSTRING_FUNC_OVERLOAD_FAIL -->
+ <div class="errorbox">
+ <h3>{L_ERROR_MBSTRING_FUNC_OVERLOAD}</h3>
+ <p>{L_ERROR_MBSTRING_FUNC_OVERLOAD_EXPLAIN}</p>
+ </div>
+ <!-- ENDIF -->
+
+ <!-- IF S_MBSTRING_ENCODING_TRANSLATION_FAIL -->
+ <div class="errorbox">
+ <h3>{L_ERROR_MBSTRING_ENCODING_TRANSLATION}</h3>
+ <p>{L_ERROR_MBSTRING_ENCODING_TRANSLATION_EXPLAIN}</p>
+ </div>
+ <!-- ENDIF -->
+
+ <!-- IF S_MBSTRING_HTTP_INPUT_FAIL -->
+ <div class="errorbox">
+ <h3>{L_ERROR_MBSTRING_HTTP_INPUT}</h3>
+ <p>{L_ERROR_MBSTRING_HTTP_INPUT_EXPLAIN}</p>
+ </div>
+ <!-- ENDIF -->
+
+ <!-- IF S_MBSTRING_HTTP_OUTPUT_FAIL -->
+ <div class="errorbox">
+ <h3>{L_ERROR_MBSTRING_HTTP_OUTPUT}</h3>
+ <p>{L_ERROR_MBSTRING_HTTP_OUTPUT_EXPLAIN}</p>
+ </div>
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+
<!-- IF S_WRITABLE_CONFIG -->
<div class="errorbox notice">
<p>{L_WRITABLE_CONFIG}</p>
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html
index e266654649..d5a29a21cc 100644
--- a/phpBB/adm/style/acp_users.html
+++ b/phpBB/adm/style/acp_users.html
@@ -13,7 +13,7 @@
<fieldset>
<legend>{L_SELECT_USER}</legend>
<dl>
- <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
+ <dt><label for="username">{L_ENTER_USERNAME}:</label></dt>
<dd><input class="text medium" type="text" id="username" name="username" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><label><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</label></dd>
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 4c3fa51af3..666f4921ba 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -899,12 +899,15 @@ html>body dd label input { vertical-align: text-bottom;} /* Tweak for Moz to ali
dd input {
font-size: 1.00em;
max-width: 100%;
+ margin: 2px 0;
}
dd select {
font-size: 100%;
+ font-size: 1em;
width: auto;
max-width: 100%;
+ margin: 2px 0;
}
dd textarea {
@@ -912,11 +915,6 @@ dd textarea {
width: 90%;
}
-dd select {
- width: auto;
- font-size: 1.00em;
-}
-
fieldset dl {
margin-bottom: 10px;
font-size: 0.85em;
diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js
index 217aa699e2..600fa254cf 100644
--- a/phpBB/adm/style/editor.js
+++ b/phpBB/adm/style/editor.js
@@ -28,8 +28,8 @@ function helpline(help)
/**
* Fix a bug involving the TextRange object. From
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
+*/
+function initInsertions()
{
var doc;
if(document.forms[form_name])
@@ -66,7 +66,7 @@ function bbstyle(bbnumber)
else
{
insert_text('[*]');
- document.forms[form_name].elements[text_name].focus();
+ document.forms[form_name].elements[text_name].focus();
}
}
@@ -76,7 +76,7 @@ function bbstyle(bbnumber)
function bbfontstyle(bbopen, bbclose)
{
theSelection = false;
-
+
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
@@ -84,14 +84,10 @@ function bbfontstyle(bbopen, bbclose)
if ((clientVer >= 4) && is_ie && is_win)
{
// Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
+ if (textarea.createTextRange && textarea.caretPos)
{
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
+ textarea.caretPos.text = bbopen + textarea.caretPos.text + bbclose;
+ textarea.focus();
return;
}
}
@@ -102,10 +98,10 @@ function bbfontstyle(bbopen, bbclose)
theSelection = '';
return;
}
-
+
//The new position for the cursor after adding the bbcode
var caret_pos = getCaretPosition(textarea).start;
- var new_pos = caret_pos + bbopen.length;
+ var new_pos = caret_pos + bbopen.length;
// Open tag
insert_text(bbopen + bbclose);
@@ -116,12 +112,12 @@ function bbfontstyle(bbopen, bbclose)
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
- }
+ }
// IE
else if (document.selection)
{
- var range = textarea.createTextRange();
- range.move("character", new_pos);
+ var range = textarea.createTextRange();
+ range.move("character", bbopen.length);
range.select();
storeCaret(textarea);
}
@@ -136,7 +132,7 @@ function bbfontstyle(bbopen, bbclose)
function insert_text(text, spaces, popup)
{
var textarea;
-
+
if (!popup)
{
textarea = document.forms[form_name].elements[text_name];
@@ -159,18 +155,18 @@ function insert_text(text, spaces, popup)
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
- }
-
+ }
+
else if (textarea.createTextRange && textarea.caretPos)
{
- if (baseHeight != textarea.caretPos.boundingHeight)
+ if (baseHeight != textarea.caretPos.boundingHeight)
{
textarea.focus();
storeCaret(textarea);
}
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
-
+
}
else
{
@@ -233,7 +229,7 @@ function addquote(post_id, username)
theSelection = theSelection.replace(/<br\/>/ig, '\n');
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
- theSelection = theSelection.replace(/&amp\;/ig, '&');
+ theSelection = theSelection.replace(/&amp\;/ig, '&');
theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
}
else if (document.all)
@@ -268,7 +264,7 @@ function mozWrap(txtarea, open, close)
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;
- if (selEnd == 1 || selEnd == 2)
+ if (selEnd == 1 || selEnd == 2)
{
selEnd = selLength;
}
@@ -292,7 +288,17 @@ function mozWrap(txtarea, open, close)
*/
function storeCaret(textEl)
{
- if (textEl.createTextRange)
+ var keyCode = false;
+ if (is_ie)
+ {
+ keyCode = (event.keyCode) ? event.keyCode : event.charCode;
+ }
+
+ // Did the user press Shift (16), Ctrl (17) or Alt (18)?
+ // If so, we do not update the caretPos, so BBCodes can still be applied correctly.
+ var is_control_key = (keyCode == 16 || keyCode == 17 || keyCode == 18);
+
+ if ((!is_ie || !is_control_key) && (textEl.createTextRange))
{
textEl.caretPos = document.selection.createRange().duplicate();
}
@@ -328,7 +334,7 @@ function colorPalette(dir, width, height)
{
document.writeln('<tr>');
}
-
+
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
@@ -368,9 +374,9 @@ function caretPosition()
function getCaretPosition(txtarea)
{
var caretPos = new caretPosition();
-
+
// simple Gecko/Opera way
- if (txtarea.selectionStart || txtarea.selectionStart == 0)
+ if (!is_ie && (txtarea.selectionStart || txtarea.selectionStart == 0))
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
@@ -384,19 +390,19 @@ function getCaretPosition(txtarea)
// a new selection of the whole textarea
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea);
-
+
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
{
range_all.moveStart('character', 1);
}
-
+
txtarea.sel_start = sel_start;
-
+
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
- caretPos.end = txtarea.sel_start;
+ caretPos.end = txtarea.sel_start;
}
return caretPos;
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index efe8837b26..7f37b94453 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -12,11 +12,7 @@
* If you overwrite the original schema files please make sure you save the file with UNIX linefeeds.
*/
-die("Please read the first lines of this script for instructions on how to enable it");
-
-@set_time_limit(0);
-
-$schema_path = './../install/schemas/';
+$schema_path = dirname(__FILE__) . '/../install/schemas/';
if (!is_writable($schema_path))
{
@@ -242,7 +238,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '
foreach ($supported_dbms as $dbms)
{
- $fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt');
+ $fp = fopen($schema_path . $dbms . '_schema.sql', 'wt');
$line = '';
@@ -251,32 +247,43 @@ foreach ($supported_dbms as $dbms)
{
case 'mysql_40':
case 'mysql_41':
- $line = "#\n# \$I" . "d: $\n#\n\n";
+ case 'firebird':
+ case 'sqlite':
+ fwrite($fp, "# DO NOT EDIT THIS FILE, IT IS GENERATED\n");
+ fwrite($fp, "#\n");
+ fwrite($fp, "# To change the contents of this file, edit\n");
+ fwrite($fp, "# phpBB/develop/create_schema_files.php and\n");
+ fwrite($fp, "# run it.\n");
break;
+ case 'mssql':
+ case 'oracle':
+ case 'postgres':
+ fwrite($fp, "/*\n");
+ fwrite($fp, " * DO NOT EDIT THIS FILE, IT IS GENERATED\n");
+ fwrite($fp, " *\n");
+ fwrite($fp, " * To change the contents of this file, edit\n");
+ fwrite($fp, " * phpBB/develop/create_schema_files.php and\n");
+ fwrite($fp, " * run it.\n");
+ fwrite($fp, " */\n\n");
+ break;
+ }
+
+ switch ($dbms)
+ {
case 'firebird':
- $line = "#\n# \$I" . "d: $\n#\n\n";
$line .= custom_data('firebird') . "\n";
break;
case 'sqlite':
- $line = "#\n# \$I" . "d: $\n#\n\n";
$line .= "BEGIN TRANSACTION;\n\n";
break;
- case 'mssql':
- $line = "/*\n\n \$I" . "d: $\n\n*/\n\n";
- // no need to do this, no transaction support for schema changes
- //$line .= "BEGIN TRANSACTION\nGO\n\n";
- break;
-
case 'oracle':
- $line = "/*\n\n \$I" . "d: $\n\n*/\n\n";
$line .= custom_data('oracle') . "\n";
break;
case 'postgres':
- $line = "/*\n\n \$I" . "d: $\n\n*/\n\n";
$line .= "BEGIN;\n\n";
$line .= custom_data('postgres') . "\n";
break;
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 6437fef1d5..a4bbfb7d7f 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -53,6 +53,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
+ <li><a href="#v309">Changes since 3.0.9</a></li>
<li><a href="#v308">Changes since 3.0.8</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>
@@ -90,7 +91,139 @@
<div class="content">
- <a name="v308"></a><h3>1.i. Changes since 3.0.8</h3>
+ <a name="v309"></a><h3>1.i. Changes since 3.0.9</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-5506">PHPBB3-5506</a>] - Deleting all items from last page results in empty list display</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6458">PHPBB3-6458</a>] - Width of Topics and Posts columns in Board Index is causing problems with language packs</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6632">PHPBB3-6632</a>] - Better viewing of topics for wide screen displays</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7138">PHPBB3-7138</a>] - Cannot display simple header/footer with trigger_error()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7291">PHPBB3-7291</a>] - Broken links of char selection in memberlist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7932">PHPBB3-7932</a>] - Fix font size in select boxes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8094">PHPBB3-8094</a>] - Text in the forums.php and install.php not matching</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8173">PHPBB3-8173</a>] - Redundant BBCode helpline in JS</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8177">PHPBB3-8177</a>] - February 29th birthdays not shown in non-leap year</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8571">PHPBB3-8571</a>] - Users can make their age a negative number on memberlist</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8691">PHPBB3-8691</a>] - Error creating log_time index</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8937">PHPBB3-8937</a>] - Code tags - single space indent</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8996">PHPBB3-8996</a>] - Wrong position when adding BBCodes with accesskey in IE</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9008">PHPBB3-9008</a>] - Incorrect unread topic tracking for unapproved topics</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9066">PHPBB3-9066</a>] - Invalid Prefix Names Allowed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9416">PHPBB3-9416</a>] - HTML entities in poll titles and options incorrectly re-encoded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9525">PHPBB3-9525</a>] - Minimum characters per post/message should never be '0'</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9645">PHPBB3-9645</a>] - XHTML error on phpinfo page in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9776">PHPBB3-9776</a>] - When deleting and recreating a poll, old options aren't deleted and reappear with the new ones</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9956">PHPBB3-9956</a>] - No error message displayed when disapprove reason is invalid or empty</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9976">PHPBB3-9976</a>] - Direct post links open the wrong page of viewtopic when multiple posts are posted in the same second</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9978">PHPBB3-9978</a>] - Missing semicolons in // &lt;![CDATA[ part of overall_header.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10087">PHPBB3-10087</a>] - Limited browser support for ban exclusion emphasis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10157">PHPBB3-10157</a>] - Missing error handling when a custom profile field is not defined for current language</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10166">PHPBB3-10166</a>] - Post-admin activation email confusingly refers to username</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10187">PHPBB3-10187</a>] - XHTML error in ucp_groups_manage.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10190">PHPBB3-10190</a>] - Misleading information about permissions displayed after editing forum settings</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10212">PHPBB3-10212</a>] - Captcha not displayed when username not exists</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10216">PHPBB3-10216</a>] - Updater's failed query language grammatically incorrect</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10226">PHPBB3-10226</a>] - Mysqli dbal extension does not allow connection via pipes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10227">PHPBB3-10227</a>] - Mysqli dbal extension does not allow persistent connection for PHP &gt;= 5.3.0</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10237">PHPBB3-10237</a>] - Unwatching a forum/topic does not check for correct hash parameter</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10240">PHPBB3-10240</a>] - Word filter evasion</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10253">PHPBB3-10253</a>] - IE9 Quote problem</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10255">PHPBB3-10255</a>] - gitignore ignores too much</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10257">PHPBB3-10257</a>] - AAAA record parsing fails on older versions of Windows</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10259">PHPBB3-10259</a>] - Incorrect email on joining Open group</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10265">PHPBB3-10265</a>] - Unit test tests/random/mt_rand.php is not run because of missing _test suffix.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10266">PHPBB3-10266</a>] - Poor navigation links after reporting a post</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10267">PHPBB3-10267</a>] - Missing strlen() on $table_prefix in db tools index name length check</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10274">PHPBB3-10274</a>] - Hardcoded module ID in &quot;Re-check version&quot; link on ACP front page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10275">PHPBB3-10275</a>] - Wrong information about sent passwords in FAQ</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10292">PHPBB3-10292</a>] - Whitespace inconsistency in acp_ranks</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10293">PHPBB3-10293</a>] - Jumpbox allows jumping to invalid forums in prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10294">PHPBB3-10294</a>] - sqlsrv_rows_affected non-functional in MSSQLNative.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10296">PHPBB3-10296</a>] - incorrect cross join in SQL Server</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10298">PHPBB3-10298</a>] - EMBED Tag Not Closed Properly In subSilver2 attachment.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10299">PHPBB3-10299</a>] - Typo in comment about $max_store_length in truncate_string() (in functions_content.php)</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10303">PHPBB3-10303</a>] - send_status_line() doesn't validate user input</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10304">PHPBB3-10304</a>] - Bad url in U_ICQ on /ucp_mp_viewmessage.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10307">PHPBB3-10307</a>] - Return value of $db-&gt;sql_fetchrow() on empty tables is not consistent</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10309">PHPBB3-10309</a>] - Utf tests download data into temporary locations deep in source tree</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10320">PHPBB3-10320</a>] - &quot;Most active topic&quot; can leak topic title of topics in password-protected forums</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10321">PHPBB3-10321</a>] - Link to page 1 of the Memberlist has a useless question mark at the end</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10324">PHPBB3-10324</a>] - XHTML error in Prosilver - MCP - User Notes</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10339">PHPBB3-10339</a>] - Typo in prosilver's mcp_front.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10341">PHPBB3-10341</a>] - Topic title of &quot;0&quot; does not show as &quot;Most active topic&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10351">PHPBB3-10351</a>] - Invalid syntax for Oracle's sql_column_remove()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10352">PHPBB3-10352</a>] - Missing break for Oracle's sql_table_drop()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10365">PHPBB3-10365</a>] - Moderators can view forbidden information</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10377">PHPBB3-10377</a>] - All moderators can change topic type</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10394">PHPBB3-10394</a>] - Tests use call-time pass by reference which results in Fatal error on PHP 5.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10397">PHPBB3-10397</a>] - Pagination code inconsistency </li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10400">PHPBB3-10400</a>] - '0' (zero) not allowed as forum name</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10408">PHPBB3-10408</a>] - Layout of topics/attachments list is broken in UCP and MCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10413">PHPBB3-10413</a>] - Make create_schema_files usable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10416">PHPBB3-10416</a>] - Use dbport in phpbb_database_test_connection_manager::connect()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10420">PHPBB3-10420</a>] - Update startup to account for PHP 5.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10421">PHPBB3-10421</a>] - Interchanged parameters in includes/acp/acp_users.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10422">PHPBB3-10422</a>] - Unnecessary &lt;!-- IF --&gt; statement in viewtopic_body.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10435">PHPBB3-10435</a>] - Topic count mismatch on viewforum</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10437">PHPBB3-10437</a>] - Announcements on moderation queue are not hidden</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10446">PHPBB3-10446</a>] - Unencoded 8bit characters in email headers</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10452">PHPBB3-10452</a>] - XHTML error when printing a PM</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10461'>PHPBB3-10461</a>] - MCP&#39;s recent actions list is empty</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10479'>PHPBB3-10479</a>] - Remove PostgreSQL version numbers from driver&#39;s language string</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10485'>PHPBB3-10485</a>] - XHTML error in Prosilver - index and viewforum</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10488'>PHPBB3-10488</a>] - Database updater for 3.0.10-RC1 overwrites config variable email_max_chunk_size without checking for custom value</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10497'>PHPBB3-10497</a>] - SQL error when guest visits forum with unread topic</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8616">PHPBB3-8616</a>] - Add direct link to PM to notification message</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9036">PHPBB3-9036</a>] - Forums that can be listed but not read expose forum information</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9297">PHPBB3-9297</a>] - Add support for Extended Passive Mode (EPSV) in class ftp_fsock to better support IPv6 connections.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9307">PHPBB3-9307</a>] - Mass email $max_chunk_size</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9361">PHPBB3-9361</a>] - Edit account settings - Improved clarification needed</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9778">PHPBB3-9778</a>] - Member Search from the Admin Control Panel is not Intuitive</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9898">PHPBB3-9898</a>] - Readme needs updating to reflect more opening for patches</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9995">PHPBB3-9995</a>] - Unnecessary coding in display_forums() in functions_display.php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10032">PHPBB3-10032</a>] - BBCode Add List Item Control Name Contains Typo</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10074">PHPBB3-10074</a>] - Change default value of 'Set as special rank' to No for Add new rank</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10185">PHPBB3-10185</a>] - Board startdate not being set</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10189">PHPBB3-10189</a>] - Add &quot;automatically generated&quot; comment into schema-files.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10199">PHPBB3-10199</a>] - Performance: viewtopic has a useless join</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10222">PHPBB3-10222</a>] - Also build language and styles changes in diff/patch format</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10239">PHPBB3-10239</a>] - Add &quot;Are you sure&quot; confirmation to backup restore in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10243">PHPBB3-10243</a>] - Add gmgetdate() wrapper for getdate() which returns dates in UTC.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10245">PHPBB3-10245</a>] - Messenger uses output buffering for error collection, should use error collector instead</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10246">PHPBB3-10246</a>] - Remove VCS section from docs/coding-guidelines.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10254">PHPBB3-10254</a>] - Remove style names from themes and fix some information on it</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10263">PHPBB3-10263</a>] - Add phpbb_version_compare() wrapper for version_compare()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10278">PHPBB3-10278</a>] - Improve timeout handling in get_remote_file()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10315">PHPBB3-10315</a>] - Radio Buttons in ACP are clipped in Safari - Fix suggested</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10327">PHPBB3-10327</a>] - Use &quot;ALTER TABLE ... ADD INDEX&quot; instead of &quot;CREATE INDEX&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10334">PHPBB3-10334</a>] - Birthday List display not dependent on user privileges</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10335">PHPBB3-10335</a>] - Responses to bots should have extra header to be used by reverse proxies</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10346">PHPBB3-10346</a>] - Add drop_tables key for database updater</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10354">PHPBB3-10354</a>] - When template tests are skipped because cache is not writable, print cache directory path</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10369">PHPBB3-10369</a>] - Change error collector to always report errfile and errline</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10370">PHPBB3-10370</a>] - Various improvements for get_backtrace()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10402">PHPBB3-10402</a>] - Displaying report texts with linebreaks and clickable links</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10419">PHPBB3-10419</a>] - Add mbstring PHP ini parameters checks to ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10430">PHPBB3-10430</a>] - Some typos and the like in docs/coding-guidelines.html</li>
+</ul>
+<h4>New Feature</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8240">PHPBB3-8240</a>] - Request: db_tools to have two additional functions, table list and column list</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9689">PHPBB3-9689</a>] - Scripts and utilities</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10003">PHPBB3-10003</a>] - Resolve db_tools proliferation</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10313">PHPBB3-10313</a>] - Include slow unit tests when running build script</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10483'>PHPBB3-10483</a>] - Test suite does not run with MySQL strict mode</li>
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10486'>PHPBB3-10486</a>] - Create git shortlog and git diff --stat in build script</li>
+</ul>
+
+ <a name="v308"></a><h3>1.ii. Changes since 3.0.8</h3>
<h4> Bug
</h4>
@@ -458,7 +591,7 @@
</ul>
- <a name="v307-PL1"></a><h3>1.ii. Changes since 3.0.7-PL1</h3>
+ <a name="v307-PL1"></a><h3>1.iii. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@@ -916,13 +1049,13 @@
</ul>
- <a name="v307"></a><h3>1.iii. Changes since 3.0.7</h3>
+ <a name="v307"></a><h3>1.iiv. 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.iv. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>1.v. 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>
@@ -1026,7 +1159,7 @@
</ul>
- <a name="v305"></a><h3>1.v. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>1.vi. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -1248,7 +1381,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.vi. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>1.vii. 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>
@@ -1337,7 +1470,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.vii. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>1.viii. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -1369,7 +1502,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.viii. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>1.ix. 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>
@@ -1468,7 +1601,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.ix. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>1.x. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -1516,7 +1649,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.x Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>1.xi Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -1587,7 +1720,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.xi. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>1.xii. 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>
@@ -1596,7 +1729,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.xii. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>1.xiii. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -1631,7 +1764,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xiii. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>1.xiv. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -1641,7 +1774,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xiv. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>1.xv. 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>
@@ -1704,7 +1837,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xv. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>1.xvi. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -1755,7 +1888,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xvi. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>1.xvii. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -1864,7 +1997,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xvii. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>1.xviii. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -1910,7 +2043,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xviii. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>1.xix. 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 3c3ccf9f28..e5ba479d9e 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -274,7 +274,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.8</samp> you should select the phpBB-3.0.8_to_3.0.9.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.9</samp> you should select the phpBB-3.0.9_to_3.0.10.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>
@@ -286,7 +286,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 <samp>3.0.8</samp> you need the phpBB-3.0.8_to_3.0.9.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 <samp>3.0.9</samp> you need the phpBB-3.0.9_to_3.0.10.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 7a0a42b34f..7ceb698ac4 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -263,7 +263,7 @@
<p>The relevant database type/version is listed within the administration control panel</p>
- <p>Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a fix which you are <strong>VERY SURE</strong> works (and is consistent with our <a href="coding-guidelines.html">coding guidelines</a>) and does not introduce further problems or incompatibilities please let us know. However only include it in the bug report if you really must, if we need it we'll ask you for it.</p>
+ <p>Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
<p>Once a bug has been submitted you will be emailed any follow up comments added to it. <strong>Please</strong> if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.</p>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index cd3c09f6fb..7d51b26dca 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -87,12 +87,6 @@
<li><a href="#writingstyle">Writing Style</a></li>
</ol>
</li>
- <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 and Repository Rules</a></li>
- </ol>
- </li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
@@ -468,12 +462,12 @@ do_stuff($str);
$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;
</pre></div>
- <p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p>
+ <p class="good">// Double quotes are sometimes needed to not overcrowd the line with concatenations.</p>
<div class="codebox"><pre>
$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
</pre></div>
- <p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p>
+ <p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
<h4>Associative array keys:</h4>
<p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p>
@@ -502,7 +496,7 @@ $foo = $assoc_array[$var];
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
<h4>Magic numbers:</h4>
- <p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not have a very close eye to it).</p>
+ <p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not keep a very close eye on it).</p>
<h4>Shortcut operators:</h4>
<p>The only shortcut operators that cause readability problems are the shortcut increment <code>$i++</code> and decrement <code>$j--</code> operators. These operators should not be used as part of an expression. They can, however, be used on their own line. Using them in expressions is just not worth the headaches when debugging, examples:</p>
@@ -671,7 +665,7 @@ $sql = 'SELECT *
</pre></div>
<h4>SQL Quotes: </h4>
- <p>Double quotes where applicable (The variables in these examples are typecasted to integers before) ... examples: </p>
+ <p>Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples: </p>
<p class="bad">// These are wrong.</p>
<div class="codebox"><pre>
@@ -832,7 +826,7 @@ SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
<h4>sql_build_query():</h4>
- <p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p>
+ <p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for SELECT and SELECT DISTINCT queries if you need to JOIN on more than one table or retrieve data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, I will give a short example:</p>
<div class="codebox"><pre>
$sql_array = array(
@@ -917,7 +911,7 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
</pre></div>
<h4>Use of in_array(): </h4>
- <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
+ <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
<a name="general"></a><h3>2.v. General Guidelines</h3>
@@ -930,7 +924,7 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p>
<h4>Variables: </h4>
- <p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params. </p>
+ <p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params.</p>
<p>The request_var function determines the type to set from the second parameter (which determines the default value too). If you need to get a scalar variable type, you need to tell this the request_var function explicitly. Examples:</p>
<p class="bad">// Old method, do not use it</p>
@@ -997,7 +991,7 @@ $user-&gt;setup();
<p>The <code>$user-&gt;setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
<h4>Errors and messages: </h4>
- <p>All messages/errors should be outputed by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
+ <p>All messages/errors should be outputted by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<div class="codebox"><pre>
trigger_error('NO_FORUM');
@@ -1015,7 +1009,7 @@ trigger_error('NO_MODE', E_USER_ERROR);
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
- <p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
+ <p>The <code>append_sid()</code> function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<div class="codebox"><pre>
append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
@@ -1023,7 +1017,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<h4>General function usage: </h4>
- <p>Some of these functions are only chosen over others because of personal preference and having no other benefit than to be consistent over the code.</p>
+ <p>Some of these functions are only chosen over others because of personal preference and have no benefit other than maintaining consistency throughout the code.</p>
<ul>
<li>
@@ -1073,7 +1067,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
required_imageset = prosilver
</pre></div>
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>
-<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p>
+<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.</p>
<p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p>
<p>When writing <code>&lt;table&gt;</code> the order <code>&lt;table class="" cellspacing="" cellpadding="" border="" align=""&gt;</code> creates consistency and allows everyone to easily see which table produces which "look". The same applies to most other tags for which additional parameters can be set, consistency is the major aim here.</p>
@@ -1093,7 +1087,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<p>Row colours/classes are now defined by the template, use an <code>IF S_ROW_COUNT</code> switch, see viewtopic or viewforum for an example.</p>
-<p>Remember block level ordering is important ... while not all pages validate as XHTML 1.0 Strict compliant it is something we're trying to work too.</p>
+<p>Remember block level ordering is important ... while not all pages validate as XHTML 1.0 Strict compliant it is something we're trying to work on.</p>
<p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p>
@@ -1142,12 +1136,12 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<a name="templates"></a><h3>4.i. General Templating</h3>
<h4>File naming</h4>
-<p>Firstly templates now take the suffix &quot;.html&quot; rather than &quot;.tpl&quot;. This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p>
+<p>Firstly templates now take the suffix &quot;.html&quot; rather than &quot;.tpl&quot;. This was done simply to make the lives of some people easier wrt syntax highlighting, etc.</p>
<h4>Variables</h4>
<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.</p>
-<p>L_* template variables are automatically tried to be mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically. For example <code>{L_USERNAME}</code> maps to <code>$user-&gt;lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped to be put in javascript code. This should reduce the need to assign loads of new lang vars in Modifications.
+<p>L_* template variables are automatically mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically and if the language entry exists. For example <code>{L_USERNAME}</code> maps to <code>$user-&gt;lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped so they can be put in javascript code. This should reduce the need to assign loads of new language variables in MODifications.
</p>
<h4>Blocks/Loops</h4>
@@ -1430,9 +1424,9 @@ div
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></div>
-<p>Here we open the loop l_block1 and doing some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p>
+<p>Here we open the loop l_block1 and do some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p>
-<p>Let's have a closer look to the markup:</p>
+<p>Let's have a closer look at the markup:</p>
<div class="codebox"><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
@@ -1526,7 +1520,7 @@ div
&lt;/ul&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
</pre></div>
-<p>Just always remember that processing is taking place from up to down.</p>
+<p>Just always remember that processing is taking place from top to bottom.</p>
<h4>Forms</h4>
<p>If a form is used for a non-trivial operation (i.e. more than a jumpbox), then it should include the <code>{S_FORM_TOKEN}</code> template variable.</p>
@@ -1542,11 +1536,9 @@ div
</pre></div><br />
<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3>
- <p>When basing a new template on an existing one, it is not necessary to provide all template files. By declaring the template to be &quot;<strong>inheriting</strong>&quot; in the template configuration file.</p>
-
- <p>The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p>
+ <p>When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the <strong>inherit_from</strong> field in the template configuration file, the style can be set to inherit template files from the base style. The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p>
- <p>The effect of doing so is that the template engine will use the files in the new template where they exist, but fall back to files in the base template otherwise. Declaring a style to be inheriting also causes it to use some of the configuration settings of the base style, notably database storage.</p>
+ <p>The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the base style otherwise. Declaring a style to inherit from another also causes it to use some of the configuration settings of the base style, notably database storage.</p>
<p>We strongly encourage the use of inheritance for styles based on the bundled styles, as it will ease the update procedure.</p>
@@ -1673,7 +1665,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<h4>Encoding:</h4>
- <p>With phpBB3, the output encoding for the forum in now UTF-8, a Universal Character Encoding by the Unicode Consortium that is by design a superset to US-ASCII and ISO-8859-1. By using one character set which simultaenously supports all scripts which previously would have required different encodings (eg: ISO-8859-1 to ISO-8859-15 (Latin, Greek, Cyrillic, Thai, Hebrew, Arabic); GB2312 (Simplified Chinese); Big5 (Traditional Chinese), EUC-JP (Japanese), EUC-KR (Korean), VISCII (Vietnamese); et cetera), this removes the need to convert between encodings and improves the accessibility of multilingual forums.</p>
+ <p>With phpBB3, the output encoding for the forum in now UTF-8, a Universal Character Encoding by the Unicode Consortium that is by design a superset to US-ASCII and ISO-8859-1. By using one character set which simultaenously supports all scripts which previously would have required different encodings (eg: ISO-8859-1 to ISO-8859-15 (Latin, Greek, Cyrillic, Thai, Hebrew, Arabic); GB2312 (Simplified Chinese); Big5 (Traditional Chinese), EUC-JP (Japanese), EUC-KR (Korean), VISCII (Vietnamese); et cetera), we remove the need to convert between encodings and improves the accessibility of multilingual forums.</p>
<p>The impact is that the language files for phpBB must now also be encoded as UTF-8, with a caveat that the files must <strong>not contain</strong> a <acronym title="Byte-Order-Mark">BOM</acronym> for compatibility reasons with non-Unicode aware versions of PHP. For those with forums using the Latin character set (ie: most European languages), this change is transparent since UTF-8 is superset to US-ASCII and ISO-8859-1.</p>
@@ -2323,51 +2315,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<hr />
-<a name="vcs"></a><h2>7. VCS Guidelines</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <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>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>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>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>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 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>
-
- <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="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
+<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
<div class="paragraph">
<div class="inner"><span class="corners-top"><span></span></span>
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index a7ea57b753..f8af1b86e1 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -175,12 +175,21 @@ class acp_ban
}
$result = $db->sql_query($sql);
- $banned_options = '';
+ $banned_options = $excluded_options = array();
$ban_length = $ban_reasons = $ban_give_reasons = array();
while ($row = $db->sql_fetchrow($result))
{
- $banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
+ $option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
+
+ if ($row['ban_exclude'])
+ {
+ $excluded_options[] = $option;
+ }
+ else
+ {
+ $banned_options[] = $option;
+ }
$time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;
@@ -241,11 +250,26 @@ class acp_ban
}
}
+ $options = '';
+ if ($excluded_options)
+ {
+ $options .= '<optgroup label="' . $user->lang['OPTIONS_EXCLUDED'] . '">';
+ $options .= implode('', $excluded_options);
+ $options .= '</optgroup>';
+ }
+
+ if ($banned_options)
+ {
+ $options .= '<optgroup label="' . $user->lang['OPTIONS_BANNED'] . '">';
+ $options .= implode('', $banned_options);
+ $options .= '</optgroup>';
+ }
+
$template->assign_vars(array(
'S_BAN_END_OPTIONS' => $ban_end_options,
- 'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
- 'BANNED_OPTIONS' => $banned_options)
- );
+ 'S_BANNED_OPTIONS' => ($banned_options || $excluded_options) ? true : false,
+ 'BANNED_OPTIONS' => $options,
+ ));
}
}
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index d8ab42ed2d..8c761e51fe 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -188,7 +188,7 @@ class acp_board
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true),
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true),
- 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true),
+ 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:1', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
@@ -234,7 +234,7 @@ class acp_board
'max_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,),
'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
- 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
+ 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'select', 'method' => 'select_acc_activation', 'explain' => true),
'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
@@ -768,24 +768,28 @@ class acp_board
/**
* Select account activation method
*/
- function select_acc_activation($value, $key = '')
+ function select_acc_activation($selected_value, $value)
{
global $user, $config;
- $radio_ary = array(
- USER_ACTIVATION_DISABLE => 'ACC_DISABLE',
- USER_ACTIVATION_NONE => 'ACC_NONE',
+ $act_ary = array(
+ 'ACC_DISABLE' => USER_ACTIVATION_DISABLE,
+ 'ACC_NONE' => USER_ACTIVATION_NONE,
);
-
if ($config['email_enable'])
{
- $radio_ary[USER_ACTIVATION_SELF] = 'ACC_USER';
- $radio_ary[USER_ACTIVATION_ADMIN] = 'ACC_ADMIN';
- }
+ $act_ary['ACC_USER'] = USER_ACTIVATION_SELF;
+ $act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN;
+ }
+ $act_options = '';
- $radio_text = h_radio('config[require_activation]', $radio_ary, $value, 'require_activation', $key, '<br />');
+ foreach ($act_ary as $key => $value)
+ {
+ $selected = ($selected_value == $value) ? ' selected="selected"' : '';
+ $act_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$key] . '</option>';
+ }
- return $radio_text;
+ return $act_options;
}
/**
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 193dd001c0..62bcd43a47 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -221,6 +221,7 @@ class acp_database
case 'submit':
$delete = request_var('delete', '');
$file = request_var('file', '');
+ $download = request_var('download', '');
if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
@@ -247,10 +248,8 @@ class acp_database
confirm_box(false, $user->lang['DELETE_SELECTED_BACKUP'], build_hidden_fields(array('delete' => $delete, 'file' => $file)));
}
}
- else
+ else if ($download || confirm_box(true))
{
- $download = request_var('download', '');
-
if ($download)
{
$name = $matches[0];
@@ -411,6 +410,10 @@ class acp_database
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
}
+ else if (!$download)
+ {
+ confirm_box(false, $user->lang['RESTORE_SELECTED_BACKUP'], build_hidden_fields(array('file' => $file)));
+ }
default:
$methods = array('sql');
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 133fe47e09..df0d44c0c5 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -136,8 +136,9 @@ class acp_email
$i = $j = 0;
- // Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
- $max_chunk_size = 50;
+ // Send with BCC
+ // Maximum number of bcc recipients
+ $max_chunk_size = (int) $config['email_max_chunk_size'];
$email_list = array();
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
@@ -194,10 +195,7 @@ class acp_email
$messenger->template('admin_send_email', $used_lang);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 4d9b9f01e0..50e12a0f15 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -212,15 +212,11 @@ class acp_forums
$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
- // Redirect to permissions
- if ($auth->acl_get('a_fauth') && !$copied_permissions)
- {
- $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
- }
-
// redirect directly to permission settings screen if authed
if ($action == 'add' && !$copied_permissions && $auth->acl_get('a_fauth'))
{
+ $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
+
meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
}
@@ -875,7 +871,7 @@ class acp_forums
$errors = array();
- if (!$forum_data['forum_name'])
+ if ($forum_data['forum_name'] == '')
{
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
}
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index c93cbc457f..f3f332d707 100644
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -118,10 +118,7 @@ class acp_inactive
$messenger->to($row['user_email'], $row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']))
@@ -209,10 +206,7 @@ class acp_inactive
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 598b390302..d560cdd0c5 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -919,6 +919,9 @@ class acp_language
$default_lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
+ // We want to notify the admin that custom profile fields need to be updated for the new language.
+ $notify_cpf_update = false;
+
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
@@ -932,6 +935,7 @@ class acp_language
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
+ $notify_cpf_update = true;
}
$db->sql_freeresult($result);
@@ -944,12 +948,15 @@ class acp_language
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
+ $notify_cpf_update = true;
}
$db->sql_freeresult($result);
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
- trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
+ $message = sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']);
+ $message .= ($notify_cpf_update) ? '<br /><br />' . $user->lang['LANGUAGE_PACK_CPF_UPDATE'] : '';
+ trigger_error($message . adm_back_link($this->u_action));
break;
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 6d1c02248a..c8df21f5a9 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -600,6 +600,17 @@ class acp_main
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
}
+ if (extension_loaded('mbstring'))
+ {
+ $template->assign_vars(array(
+ 'S_MBSTRING_LOADED' => true,
+ 'S_MBSTRING_FUNC_OVERLOAD_FAIL' => (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
+ 'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => (@ini_get('mbstring.encoding_translation') != 0),
+ 'S_MBSTRING_HTTP_INPUT_FAIL' => (@ini_get('mbstring.http_input') != 'pass'),
+ 'S_MBSTRING_HTTP_OUTPUT_FAIL' => (@ini_get('mbstring.http_output') != 'pass'),
+ ));
+ }
+
// Fill dbms version if not yet filled
if (empty($config['dbms_version']))
{
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index fcfef2a61e..dfd7511427 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -199,7 +199,7 @@ class acp_ranks
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
'S_FILENAME_LIST' => $filename_list,
'RANK_IMAGE' => ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
- 'S_SPECIAL_RANK' => (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,
+ 'S_SPECIAL_RANK' => (isset($ranks['rank_special']) && $ranks['rank_special']) ? true : false,
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
);
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 931fa53165..7e3d1a1024 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -37,7 +37,7 @@ class acp_update
$errstr = '';
$errno = 0;
- $info = obtain_latest_version_info(request_var('versioncheck_force', false), true);
+ $info = obtain_latest_version_info(request_var('versioncheck_force', false));
if ($info === false)
{
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 789003e31b..4f58434a43 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -348,10 +348,7 @@ class acp_users
$messenger->to($user_row['user_email'], $user_row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
@@ -406,10 +403,7 @@ class acp_users
$messenger->to($user_row['user_email'], $user_row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))
@@ -818,7 +812,7 @@ class acp_users
// Which updates do we need to do?
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
- $update_password = ($data['new_password'] && !phpbb_check_hash($user_row['user_password'], $data['new_password'])) ? true : false;
+ $update_password = ($data['new_password'] && !phpbb_check_hash($data['new_password'], $user_row['user_password'])) ? true : false;
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php
index 6ca69d9174..c20196d019 100644
--- a/phpBB/includes/auth/auth_db.php
+++ b/phpBB/includes/auth/auth_db.php
@@ -107,6 +107,15 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for
if (!$row)
{
+ if ($config['ip_login_limit_max'] && $attempts >= $config['ip_login_limit_max'])
+ {
+ return array(
+ 'status' => LOGIN_ERROR_ATTEMPTS,
+ 'error_msg' => 'LOGIN_ERROR_ATTEMPTS',
+ 'user_row' => array('user_id' => ANONYMOUS),
+ );
+ }
+
return array(
'status' => LOGIN_ERROR_USERNAME,
'error_msg' => 'LOGIN_ERROR_USERNAME',
@@ -264,4 +273,4 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for
);
}
-?> \ No newline at end of file
+?>
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 03b1102602..a0444ea594 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.10-dev');
+define('PHPBB_VERSION', '3.0.11-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 2cb0fcef68..2cba11133a 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -348,6 +348,66 @@ class phpbb_db_tools
}
/**
+ * Gets a list of tables in the database.
+ *
+ * @return array Array of table names (all lower case)
+ */
+ function sql_list_tables()
+ {
+ switch ($this->db->sql_layer)
+ {
+ case 'mysql':
+ case 'mysql4':
+ case 'mysqli':
+ $sql = 'SHOW TABLES';
+ break;
+
+ 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;
+ }
+
+ $result = $this->db->sql_query($sql);
+
+ $tables = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $name = current($row);
+ $tables[$name] = $name;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tables;
+ }
+
+ /**
* Check if table exists
*
*
@@ -1011,34 +1071,21 @@ class phpbb_db_tools
}
/**
- * Check if a specified column exist
+ * Gets a list of columns of a table.
*
- * @param string $table Table to check the column at
- * @param string $column_name The column to check
+ * @param string $table Table name
*
- * @return bool True if column exists, else false
+ * @return array Array of column names (all lower case)
*/
- function sql_column_exists($table, $column_name)
+ function sql_list_columns($table)
{
+ $columns = array();
+
switch ($this->sql_layer)
{
case 'mysql_40':
case 'mysql_41':
-
$sql = "SHOW COLUMNS FROM $table";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- // lower case just in case
- if (strtolower($row['Field']) == $column_name)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
- return false;
break;
// PostgreSQL has a way of doing this in a much simpler way but would
@@ -1049,19 +1096,6 @@ class phpbb_db_tools
WHERE c.relname = '{$table}'
AND a.attnum > 0
AND a.attrelid = c.oid";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- // lower case just in case
- if (strtolower($row['attname']) == $column_name)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
-
- return false;
break;
// same deal with PostgreSQL, we must perform more complex operations than
@@ -1072,62 +1106,26 @@ class phpbb_db_tools
FROM syscolumns c
LEFT JOIN sysobjects o ON c.id = o.id
WHERE o.name = '{$table}'";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- // lower case just in case
- if (strtolower($row['name']) == $column_name)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
- return false;
break;
case 'oracle':
$sql = "SELECT column_name
FROM user_tab_columns
WHERE LOWER(table_name) = '" . strtolower($table) . "'";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- // lower case just in case
- if (strtolower($row['column_name']) == $column_name)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
- return false;
break;
case 'firebird':
$sql = "SELECT RDB\$FIELD_NAME as FNAME
FROM RDB\$RELATION_FIELDS
WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- // lower case just in case
- if (strtolower($row['fname']) == $column_name)
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- $this->db->sql_freeresult($result);
- return false;
break;
- // ugh, SQLite
case 'sqlite':
$sql = "SELECT sql
FROM sqlite_master
WHERE type = 'table'
AND name = '{$table}'";
+
$result = $this->db->sql_query($sql);
if (!$result)
@@ -1151,14 +1149,39 @@ class phpbb_db_tools
continue;
}
- if (strtolower($entities[0]) == $column_name)
- {
- return true;
- }
+ $column = strtolower($entities[0]);
+ $columns[$column] = $column;
}
- return false;
+
+ return $columns;
break;
}
+
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $column = strtolower(current($row));
+ $columns[$column] = $column;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $columns;
+ }
+
+ /**
+ * Check whether a specified column exist in a table
+ *
+ * @param string $table Table to check
+ * @param string $column_name Column to check
+ *
+ * @return bool True if column exists, false otherwise
+ */
+ function sql_column_exists($table, $column_name)
+ {
+ $columns = $this->sql_list_columns($table);
+
+ return isset($columns[$column_name]);
}
/**
@@ -1805,7 +1828,7 @@ class phpbb_db_tools
break;
case 'oracle':
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP ' . $column_name;
+ $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
break;
case 'postgres':
@@ -1956,6 +1979,7 @@ class phpbb_db_tools
$statements[] = "DROP SEQUENCE {$row['referenced_name']}";
}
$this->db->sql_freeresult($result);
+ break;
case 'postgres':
// PGSQL does not "tightly" bind sequences and tables, we must guess...
@@ -2091,7 +2115,7 @@ class phpbb_db_tools
case 'mysql_40':
case 'mysql_41':
- $statements[] = 'CREATE UNIQUE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX (' . implode(', ', $column) . ')';
break;
case 'mssql':
@@ -2144,7 +2168,7 @@ class phpbb_db_tools
}
// no break
case 'mysql_41':
- $statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
break;
case 'mssql':
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 9b45c085a2..b4c1a72e1c 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -609,7 +609,7 @@ class dbal
}
}
- $sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array));
+ $sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array));
if (!empty($array['LEFT_JOIN']))
{
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php
index 6810562d17..7fbc374e77 100644
--- a/phpBB/includes/db/mssqlnative.php
+++ b/phpBB/includes/db/mssqlnative.php
@@ -396,7 +396,7 @@ class dbal_mssqlnative extends dbal
*/
function sql_affectedrows()
{
- return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->db_connect_id) : false;
+ return (!empty($this->query_result)) ? @sqlsrv_rows_affected($this->query_result) : false;
}
/**
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index 46c2f9210b..456ce906d0 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -249,7 +249,13 @@ class dbal_mysqli extends dbal
return $cache->sql_fetchrow($query_id);
}
- return ($query_id !== false) ? @mysqli_fetch_assoc($query_id) : false;
+ if ($query_id !== false)
+ {
+ $result = @mysqli_fetch_assoc($query_id);
+ return $result !== null ? $result : false;
+ }
+
+ return false;
}
/**
diff --git a/phpBB/includes/error_collector.php b/phpBB/includes/error_collector.php
index 55834f354c..3c0a89a1f3 100644
--- a/phpBB/includes/error_collector.php
+++ b/phpBB/includes/error_collector.php
@@ -49,13 +49,15 @@ class phpbb_error_collector
{
$text .= "<br />\n";
}
+
list($errno, $msg_text, $errfile, $errline) = $error;
- $text .= "Errno $errno: $msg_text";
- if (defined('DEBUG_EXTRA') || defined('IN_INSTALL'))
- {
- $text .= " at $errfile line $errline";
- }
+
+ // Prevent leakage of local path to phpBB install
+ $errfile = phpbb_filter_root_path($errfile);
+
+ $text .= "Errno $errno: $msg_text at $errfile line $errline";
}
+
return $text;
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index df49bdf637..7ce83b871a 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1880,7 +1880,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
*/
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
{
- global $db, $tracking_topics, $user, $config;
+ global $db, $tracking_topics, $user, $config, $auth;
// Determine the users last forum mark time if not given.
if ($mark_time_forum === false)
@@ -1903,6 +1903,10 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
}
+ // Handle update of unapproved topics info.
+ // Only update for moderators having m_approve permission for the forum.
+ $sql_update_unapproved = ($auth->acl_get('m_approve', $forum_id)) ? '': 'AND t.topic_approved = 1';
+
// Check the forum for any left unread topics.
// If there are none, we mark the forum as read.
if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -1918,7 +1922,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
- AND t.topic_moved_id = 0
+ AND t.topic_moved_id = 0 ' .
+ $sql_update_unapproved . '
AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
GROUP BY t.forum_id';
$result = $db->sql_query_limit($sql, 1);
@@ -1938,11 +1943,12 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else
{
- $sql = 'SELECT topic_id
- FROM ' . TOPICS_TABLE . '
- WHERE forum_id = ' . $forum_id . '
- AND topic_last_post_time > ' . $mark_time_forum . '
- AND topic_moved_id = 0';
+ $sql = 'SELECT t.topic_id
+ FROM ' . TOPICS_TABLE . ' t
+ WHERE t.forum_id = ' . $forum_id . '
+ AND t.topic_last_post_time > ' . $mark_time_forum . '
+ AND t.topic_moved_id = 0 ' .
+ $sql_update_unapproved;
$result = $db->sql_query($sql);
$check_forum = $tracking_topics['tf'][$forum_id];
@@ -2127,7 +2133,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
$end_cnt = max(min($total_pages, $on_page + 4), 6);
- $page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;
+ $page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $seperator;
for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
{
@@ -2138,7 +2144,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
}
}
- $page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
+ $page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $seperator;
}
else
{
@@ -2225,6 +2231,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
+ if ($params === '' || (is_array($params) && empty($params)))
+ {
+ // Do not append the ? if the param-list is empty anyway.
+ $params = false;
+ }
+
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately.
// They could mimic most of what is within this function
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
@@ -3381,61 +3393,44 @@ function add_log()
}
/**
-* Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com)
+* Return a nicely formatted backtrace.
+*
+* Turns the array returned by debug_backtrace() into HTML markup.
+* Also filters out absolute paths to phpBB root.
+*
+* @return string HTML markup
*/
function get_backtrace()
{
- global $phpbb_root_path;
-
$output = '<div style="font-family: monospace;">';
$backtrace = debug_backtrace();
- $path = phpbb_realpath($phpbb_root_path);
- foreach ($backtrace as $number => $trace)
- {
- // We skip the first one, because it only shows this file/function
- if ($number == 0)
- {
- continue;
- }
+ // We skip the first one, because it only shows this file/function
+ unset($backtrace[0]);
+ foreach ($backtrace as $trace)
+ {
// Strip the current directory from path
- if (empty($trace['file']))
- {
- $trace['file'] = '';
- }
- else
- {
- $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']);
- $trace['file'] = substr($trace['file'], 1);
- }
- $args = array();
+ $trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file']));
+ $trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line'];
- // If include/require/include_once is not called, do not show arguments - they may contain sensible information
- if (!in_array($trace['function'], array('include', 'require', 'include_once')))
+ // Only show function arguments for include etc.
+ // Other parameters may contain sensible information
+ $argument = '';
+ if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once')))
{
- unset($trace['args']);
- }
- else
- {
- // Path...
- if (!empty($trace['args'][0]))
- {
- $argument = htmlspecialchars($trace['args'][0]);
- $argument = str_replace(array($path, '\\'), array('', '/'), $argument);
- $argument = substr($argument, 1);
- $args[] = "'{$argument}'";
- }
+ $argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0]));
}
$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];
$trace['type'] = (!isset($trace['type'])) ? '' : $trace['type'];
$output .= '<br />';
- $output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />';
+ $output .= '<b>FILE:</b> ' . $trace['file'] . '<br />';
$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';
- $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />';
+ $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']);
+ $output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')<br />';
}
$output .= '</div>';
return $output;
@@ -3497,6 +3492,10 @@ function get_preg_expression($mode)
$inline = ($mode == 'relative_url') ? ')' : '';
return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
+
+ case 'table_prefix':
+ return '#^[a-zA-Z][a-zA-Z0-9_]*$#';
+ break;
}
return '';
@@ -3810,9 +3809,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false)
{
- // remove complete path to installation, with the risk of changing backslashes meant to be there
- $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
- $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
+ $errfile = phpbb_filter_root_path($errfile);
+ $msg_text = phpbb_filter_root_path($msg_text);
$error_name = ($errno === E_WARNING) ? 'PHP Warning' : 'PHP Notice';
echo '<b>[phpBB Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
@@ -3991,6 +3989,29 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
/**
+* Removes absolute path to phpBB root directory from error messages
+* and converts backslashes to forward slashes.
+*
+* @param string $errfile Absolute file path
+* (e.g. /var/www/phpbb3/phpBB/includes/functions.php)
+* Please note that if $errfile is outside of the phpBB root,
+* the root path will not be found and can not be filtered.
+* @return string Relative file path
+* (e.g. /includes/functions.php)
+*/
+function phpbb_filter_root_path($errfile)
+{
+ static $root_path;
+
+ if (empty($root_path))
+ {
+ $root_path = phpbb_realpath(dirname(__FILE__) . '/../');
+ }
+
+ return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile);
+}
+
+/**
* Queries the session table to get information about online guests
* @param int $item_id Limits the search to the item with this id
* @param string $item The name of the item which is stored in the session table as session_{$item}_id
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 0c83674054..0e1a11b4aa 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2574,7 +2574,11 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$db->sql_freeresult($result);
}
- if ($log_count == 0)
+ // $log_count may be false here if false was passed in for it,
+ // because in this case we did not run the COUNT() query above.
+ // If we ran the COUNT() query and it returned zero rows, return;
+ // otherwise query for logs below.
+ if ($log_count === 0)
{
// Save the queries, because there are no logs to display
return 0;
@@ -3095,7 +3099,7 @@ function get_database_size()
/**
* Retrieve contents from remotely stored file
*/
-function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 10)
+function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 6)
{
global $user;
@@ -3105,6 +3109,9 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
@fputs($fsock, "HOST: $host\r\n");
@fputs($fsock, "Connection: close\r\n\r\n");
+ $timer_stop = time() + $timeout;
+ stream_set_timeout($fsock, $timeout);
+
$file_info = '';
$get_info = false;
@@ -3127,6 +3134,14 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
return false;
}
}
+
+ $stream_meta_data = stream_get_meta_data($fsock);
+
+ if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
+ {
+ $errstr = $user->lang['FSOCK_TIMEOUT'];
+ return false;
+ }
}
@fclose($fsock);
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 14d0c44dcf..ee7048638d 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -465,6 +465,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'S_NO_CAT' => $catless && !$last_catless,
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
'S_UNREAD_FORUM' => $forum_unread,
+ 'S_AUTH_READ' => $auth->acl_get('f_read', $row['forum_id']),
'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,
@@ -674,7 +675,7 @@ function topic_generate_pagination($replies, $url)
$pagination .= '<a href="' . $url . ($j == 0 ? '' : '&amp;start=' . $j) . '">' . $times . '</a>';
if ($times == 1 && $total_pages > 5)
{
- $pagination .= ' ... ';
+ $pagination .= '<span class="page-dots"> ... </span>';
// Display the last three pages
$times = $total_pages - 3;
@@ -1083,6 +1084,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$match_id = ($mode == 'forum') ? $forum_id : $topic_id;
$u_url = "uid={$user->data['user_id']}";
$u_url .= ($mode == 'forum') ? '&amp;f' : '&amp;f=' . $forum_id . '&amp;t';
+ $is_watching = 0;
// Is user watching this thread?
if ($user_id != ANONYMOUS)
@@ -1109,9 +1111,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$uid = request_var('uid', 0);
$token = request_var('hash', '');
- if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))
+ if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
- if (($uid != $user_id) || ($_GET['unwatch'] != $mode))
+ if ($uid != $user_id || $_GET['unwatch'] != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
@@ -1124,7 +1126,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />';
+ $message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
meta_refresh(3, $redirect_url);
trigger_error($message);
}
@@ -1141,7 +1144,14 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$s_hidden_fields['t'] = $topic_id;
}
- $confirm_box_message = (($item_title == '') ? 'UNWATCH_' . strtoupper($mode) : $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title));
+ if ($item_title == '')
+ {
+ $confirm_box_message = 'UNWATCH_' . strtoupper($mode);
+ }
+ else
+ {
+ $confirm_box_message = $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title);
+ }
confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields));
}
}
@@ -1166,9 +1176,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$uid = request_var('uid', 0);
$token = request_var('hash', '');
- if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))
+ if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
- if (($uid != $user_id) || ($_GET['watch'] != $mode))
+ if ($uid != $user_id || $_GET['watch'] != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 6438f35ccc..6caa5c943f 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -202,61 +202,20 @@ function dbms_select($default = '', $only_20x_options = false)
/**
* Get tables of a database
+*
+* @deprecated
*/
-function get_tables($db)
+function get_tables(&$db)
{
- switch ($db->sql_layer)
- {
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
- $sql = 'SHOW TABLES';
- break;
-
- 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;
- }
-
- $result = $db->sql_query($sql);
-
- $tables = array();
-
- while ($row = $db->sql_fetchrow($result))
+ if (!class_exists('phpbb_db_tools'))
{
- $tables[] = current($row);
+ global $phpbb_root_path, $phpEx;
+ require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
}
- $db->sql_freeresult($result);
+ $db_tools = new phpbb_db_tools($db);
- return $tables;
+ return $db_tools->sql_list_tables();
}
/**
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index b5c87094c0..91b361183c 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -163,6 +163,22 @@ class messenger
}
/**
+ * Adds X-AntiAbuse headers
+ *
+ * @param array $config Configuration array
+ * @param user $user A user object
+ *
+ * @return null
+ */
+ function anti_abuse_headers($config, $user)
+ {
+ $this->headers('X-AntiAbuse: Board servername - ' . mail_encode($config['server_name']));
+ $this->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
+ $this->headers('X-AntiAbuse: Username - ' . mail_encode($user->data['username']));
+ $this->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ }
+
+ /**
* Set the email priority
*/
function set_mail_priority($priority = MAIL_NORMAL_PRIORITY)
@@ -975,9 +991,16 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
$smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']);
// Ok we have error checked as much as we can to this point let's get on it already.
- ob_start();
+ if (!class_exists('phpbb_error_collector'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
+ }
+ $collector = new phpbb_error_collector;
+ $collector->install();
$smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);
- $error_contents = ob_get_clean();
+ $collector->uninstall();
+ $error_contents = $collector->format_errors();
if (!$smtp->socket)
{
@@ -1608,18 +1631,27 @@ function mail_encode($str, $eol = "\r\n")
*/
function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
{
- global $config;
+ global $config, $phpbb_root_path, $phpEx;
// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
// Reference: http://bugs.php.net/bug.php?id=15841
$headers = implode($eol, $headers);
- ob_start();
+ if (!class_exists('phpbb_error_collector'))
+ {
+ include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
+ }
+
+ $collector = new phpbb_error_collector;
+ $collector->install();
+
// On some PHP Versions mail() *may* fail if there are newlines within the subject.
// Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
// Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)
$result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
- $err_msg = ob_get_clean();
+
+ $collector->uninstall();
+ $err_msg = $collector->format_errors();
return $result;
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index a641afbaed..77d92e26e2 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1870,9 +1870,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_topic':
case 'edit_first_post':
- if (isset($poll['poll_options']) && !empty($poll['poll_options']))
+ if (isset($poll['poll_options']))
{
- $poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
+ $poll_start = ($poll['poll_start'] || empty($poll['poll_options'])) ? $poll['poll_start'] : $current_time;
$poll_length = $poll['poll_length'] * 86400;
if ($poll_length < 0)
{
@@ -2075,11 +2075,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
// Update Poll Tables
- if (isset($poll['poll_options']) && !empty($poll['poll_options']))
+ if (isset($poll['poll_options']))
{
$cur_poll_options = array();
- if ($poll['poll_start'] && $mode == 'edit')
+ if ($mode == 'edit')
{
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . '
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4c34bc92ca..c40ceb088f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1607,7 +1607,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
// Send Notifications
if ($mode != 'edit')
{
- pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message']);
+ pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']);
}
return $data['msg_id'];
@@ -1616,7 +1616,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
/**
* PM Notification
*/
-function pm_notification($mode, $author, $recipients, $subject, $message)
+function pm_notification($mode, $author, $recipients, $subject, $message, $msg_id)
{
global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
@@ -1688,8 +1688,9 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
'AUTHOR_NAME' => htmlspecialchars_decode($author),
'USERNAME' => htmlspecialchars_decode($addr['name']),
- 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox")
- );
+ 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox",
+ 'U_VIEW_MESSAGE' => generate_board_url() . "/ucp.$phpEx?i=pm&mode=view&p=$msg_id",
+ ));
$messenger->send($addr['method']);
}
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index ad10a52705..ffede11d37 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -286,14 +286,6 @@ function change_topic_type($action, $topic_ids)
{
global $auth, $user, $db, $phpEx, $phpbb_root_path;
- // For changing topic types, we only allow operations in one forum.
- $forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'), true);
-
- if ($forum_id === false)
- {
- return;
- }
-
switch ($action)
{
case 'make_announce':
@@ -316,11 +308,18 @@ function change_topic_type($action, $topic_ids)
default:
$new_topic_type = POST_NORMAL;
- $check_acl = '';
+ $check_acl = false;
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS';
break;
}
+ $forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', $check_acl, true);
+
+ if ($forum_id === false)
+ {
+ return;
+ }
+
$redirect = request_var('redirect', build_url(array('action', 'quickmod')));
$s_hidden_fields = array(
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index de7f3e63ee..ba45037a18 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -246,7 +246,7 @@ function mcp_post_details($id, $mode, $action)
}
// Get Reports
- if ($auth->acl_get('m_', $post_info['forum_id']))
+ if ($auth->acl_get('m_report', $post_info['forum_id']))
{
$sql = 'SELECT r.*, re.*, u.user_id, u.username
FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u, ' . REPORTS_REASONS_TABLE . " re
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index c419da5574..764461fa53 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -216,6 +216,7 @@ class mcp_queue
'POST_IP' => $post_info['poster_ip'],
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
+ 'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
));
@@ -778,6 +779,8 @@ function disapprove_post($post_id_list, $id, $mode)
if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
+ unset($_REQUEST['confirm_key']);
+ unset($_POST['confirm_key']);
unset($_POST['confirm']);
}
else
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 39d9fbd4af..def5422be2 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -148,6 +148,7 @@ class mcp_reports
$message = bbcode_nl2br($message);
$message = smiley_text($message);
+ $report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 76cd9beb92..d7cc1e795a 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -239,8 +239,8 @@ function mcp_topic_view($id, $mode, $action)
'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,
+ 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])),
+ 'S_POST_UNAPPROVED' => (!$row['post_approved'] && $auth->acl_get('m_approve', $topic_info['forum_id'])),
'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index ca9665da29..bbe2f127f1 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -97,8 +97,8 @@ function deregister_globals()
unset($input);
}
-// If we are on PHP >= 6.0.0 we do not need some code
-if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
+// Register globals and magic quotes have been dropped in PHP 5.4
+if (version_compare(PHP_VERSION, '5.4.0-dev', '>='))
{
/**
* @ignore
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index b00c1b9f52..82c1937919 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -117,10 +117,7 @@ class ucp_activate
$messenger->to($user_row['user_email'], $user_row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 1c055a4823..d62dbb1866 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -193,47 +193,43 @@ class ucp_groups
if ($group_row[$group_id]['group_type'] == GROUP_FREE)
{
group_user_add($group_id, $user->data['user_id']);
-
- $email_template = 'group_added';
}
else
{
group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1);
- $email_template = 'group_request';
- }
+ include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
+ $messenger = new messenger();
- include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $messenger = new messenger();
+ $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
+ FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
+ WHERE ug.user_id = u.user_id
+ AND ug.group_leader = 1
+ AND ug.group_id = $group_id";
+ $result = $db->sql_query($sql);
- $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang
- FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u
- WHERE ug.user_id = u.user_id
- AND ' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? "ug.user_id = {$user->data['user_id']}" : 'ug.group_leader = 1') . "
- AND ug.group_id = $group_id";
- $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $messenger->template('group_request', $row['user_lang']);
- while ($row = $db->sql_fetchrow($result))
- {
- $messenger->template($email_template, $row['user_lang']);
+ $messenger->to($row['user_email'], $row['username']);
+ $messenger->im($row['user_jabber'], $row['username']);
- $messenger->to($row['user_email'], $row['username']);
- $messenger->im($row['user_jabber'], $row['username']);
+ $messenger->assign_vars(array(
+ 'USERNAME' => htmlspecialchars_decode($row['username']),
+ 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
+ 'REQUEST_USERNAME' => $user->data['username'],
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($row['username']),
- 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
- 'REQUEST_USERNAME' => $user->data['username'],
+ 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
+ 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
+ );
- 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
- 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
- );
+ $messenger->send($row['user_notify_type']);
+ }
+ $db->sql_freeresult($result);
- $messenger->send($row['user_notify_type']);
+ $messenger->save_queue();
}
- $db->sql_freeresult($result);
-
- $messenger->save_queue();
add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']);
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index c675928a5b..447b6ebe87 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -243,7 +243,7 @@ class ucp_pm
$num_not_moved = $num_removed = 0;
$release = request_var('release', 0);
- if ($user->data['user_new_privmsg'] && $action == 'view_folder')
+ if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message'))
{
$return = place_pm_into_folder($global_privmsgs_rules, $release);
$num_not_moved = $return['not_moved'];
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index d0cfa1ffd2..82a095dd9c 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -208,7 +208,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $author_id) : '',
'U_WWW' => (!empty($user_info['user_website'])) ? $user_info['user_website'] : '',
- 'U_ICQ' => ($user_info['user_icq']) ? 'http://www.icq.com/people' . urlencode($user_info['user_icq']) . '/' : '',
+ 'U_ICQ' => ($user_info['user_icq']) ? 'http://www.icq.com/people/' . urlencode($user_info['user_icq']) . '/' : '',
'U_AIM' => ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $author_id) : '',
'U_YIM' => ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&amp;.src=pg' : '',
'U_MSN' => ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=msnm&amp;u=' . $author_id) : '',
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index c099e3b3fa..d35d13b6c1 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -78,14 +78,14 @@ class ucp_profile
$error = validate_data($data, $check_ary);
- if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
+ if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
{
- $error[] = 'NEW_PASSWORD_ERROR';
+ $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
}
- if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password']))
+ if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{
- $error[] = 'CUR_PASSWORD_ERROR';
+ $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
}
// Only check the new password against the previous password if there have been no errors
@@ -94,9 +94,9 @@ class ucp_profile
$error[] = 'SAME_PASSWORD_ERROR';
}
- if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
+ if (!phpbb_check_hash($data['cur_password'], $user->data['user_password']))
{
- $error[] = 'NEW_EMAIL_ERROR';
+ $error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
}
if (!check_form_key('ucp_reg_details'))
@@ -150,10 +150,7 @@ class ucp_profile
$messenger->to($data['email'], $data['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 13b9945851..4e8729db56 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -155,8 +155,8 @@ class ucp_register
$this->tpl_name = 'ucp_agreement';
return;
}
-
-
+
+
// The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
if ($config['enable_confirm'])
{
@@ -366,10 +366,7 @@ class ucp_register
$messenger->to($data['email'], $data['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index 39e9be24a1..4d181dba49 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -94,10 +94,7 @@ class ucp_resend
$messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
$messenger->to($user_row['user_email'], $user_row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
@@ -133,10 +130,7 @@ class ucp_resend
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']),
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 7f6e3c0250..81cc2f68f3 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.9',
+ 'phpbb_version' => '3.0.10',
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
@@ -504,7 +504,7 @@ if (!$get_info)
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
array('topic_last_view_time', 'posts.post_time', 'intval'),
- array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
+ array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
array('poll_length', 'vote_desc.vote_length', 'null_to_zero'),
array('poll_max_options', 1, ''),
@@ -537,7 +537,7 @@ if (!$get_info)
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
- array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
+ array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
array('poll_length', 'vote_desc.vote_length', 'null_to_zero'),
array('poll_max_options', 1, ''),
@@ -582,7 +582,7 @@ if (!$get_info)
array('poll_option_id', 'vote_results.vote_option_id', ''),
array('topic_id', 'vote_desc.topic_id', ''),
array('', 'topics.topic_poster AS poster_id', 'phpbb_user_id'),
- array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
+ array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'htmlspecialchars_decode', 'function3' => 'utf8_htmlspecialchars')),
array('poll_option_total', 'vote_results.vote_result', ''),
'where' => 'vote_results.vote_id = vote_desc.vote_id',
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a167e79308..9c44350955 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-define('UPDATES_TO_VERSION', '3.0.10-dev');
+define('UPDATES_TO_VERSION', '3.0.11-dev');
// Enter any version to update from to test updates. The version within the db will not be updated.
define('DEBUG_FROM_VERSION', false);
@@ -951,7 +951,7 @@ function database_update_info()
// this column was removed from the database updater
// after 3.0.9-RC3 was released. It might still exist
// in 3.0.9-RCX installations and has to be dropped in
- // 3.0.10 after the db_tools class is capable of properly
+ // 3.0.11 after the db_tools class is capable of properly
// removing a primary key.
// 'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
@@ -985,8 +985,14 @@ function database_update_info()
'3.0.9-RC3' => array(),
// No changes from 3.0.9-RC4 to 3.0.9
'3.0.9-RC4' => array(),
-
- /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.10-RC1 */
+ // No changes from 3.0.9 to 3.0.10-RC1
+ '3.0.9' => array(),
+ // No changes from 3.0.10-RC1 to 3.0.10-RC2
+ '3.0.10-RC1' => array(),
+ // No changes from 3.0.10-RC2 to 3.0.10-RC3
+ '3.0.10-RC2' => array(),
+
+ /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */
);
}
@@ -1994,6 +2000,24 @@ function change_database_data(&$no_updates, $version)
// No changes from 3.0.9-RC4 to 3.0.9
case '3.0.9-RC4':
break;
+
+ // Changes from 3.0.9 to 3.0.10-RC1
+ case '3.0.9':
+ if (!isset($config['email_max_chunk_size']))
+ {
+ set_config('email_max_chunk_size', '50');
+ }
+
+ $no_updates = false;
+ break;
+
+ // No changes from 3.0.10-RC1 to 3.0.10-RC2
+ case '3.0.10-RC1':
+ break;
+
+ // No changes from 3.0.10-RC2 to 3.0.10-RC3
+ case '3.0.10-RC2':
+ break;
}
}
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 814b50cf68..62efc3e46b 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -1716,19 +1716,16 @@ class install_convert extends module
fix_empty_primary_groups();
- if (!isset($config['board_startdate']))
- {
- $sql = 'SELECT MIN(user_regdate) AS board_startdate
- FROM ' . USERS_TABLE;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $sql = 'SELECT MIN(user_regdate) AS board_startdate
+ FROM ' . USERS_TABLE;
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0) || !isset($config['board_startdate']))
- {
- set_config('board_startdate', $row['board_startdate']);
- $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
- }
+ if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
+ {
+ set_config('board_startdate', $row['board_startdate']);
+ $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
update_dynamic_config();
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 9b37ee2be3..026fc0d404 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -546,6 +546,11 @@ class install_install extends module
$error[] = $lang['INST_ERR_NO_DB'];
$connect_test = false;
}
+ else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix']))
+ {
+ $error[] = $lang['INST_ERR_DB_INVALID_PREFIX'];
+ $connect_test = false;
+ }
else
{
$connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']);
@@ -1938,10 +1943,7 @@ class install_install extends module
$messenger->to($data['board_email1'], $data['admin_name']);
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['admin_name']),
@@ -2030,7 +2032,7 @@ class install_install extends module
'dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false),
'dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false),
'dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false),
- 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => false),
+ 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => true),
);
var $admin_config_options = array(
'legend1' => 'ADMIN_CONFIG',
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 40041b13cb..73052f0a22 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index c4fc2d4eec..8ed3ba7e12 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
/*
Table: 'phpbb_attachments'
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 06d32166f3..42b7291d9d 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 1db2790ec7..7a6d0ae188 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 783261e365..6e7ec31efc 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
/*
This first section is optional, however its probably the best method
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index cf655cb1c7..38f167bc7b 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -1,8 +1,10 @@
/*
-
- $Id: $
-
-*/
+ * DO NOT EDIT THIS FILE, IT IS GENERATED
+ *
+ * To change the contents of this file, edit
+ * phpBB/develop/create_schema_files.php and
+ * run it.
+ */
BEGIN;
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 153ac61157..fcc372ae93 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -94,6 +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_max_chunk_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');
@@ -245,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.10-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.11-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index dae1eb839c..c0574244ca 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -1,7 +1,8 @@
+# DO NOT EDIT THIS FILE, IT IS GENERATED
#
-# $Id: $
-#
-
+# To change the contents of this file, edit
+# phpBB/develop/create_schema_files.php and
+# run it.
BEGIN TRANSACTION;
# Table: 'phpbb_attachments'
diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php
index 099834d1e4..7b2ef59a7a 100644
--- a/phpBB/language/en/acp/ban.php
+++ b/phpBB/language/en/acp/ban.php
@@ -68,6 +68,9 @@ $lang = array_merge($lang, array(
'LENGTH_BAN_INVALID' => 'The date has to be formatted <kbd>YYYY-MM-DD</kbd>.',
+ 'OPTIONS_BANNED' => 'Banned',
+ 'OPTIONS_EXCLUDED' => 'Excluded',
+
'PERMANENT' => 'Permanent',
'UNTIL' => 'Until',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 5a9ca6231d..6e6d4302cd 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -174,7 +174,7 @@ $lang = array_merge($lang, array(
'MAX_POST_URLS' => 'Maximum links per post',
'MAX_POST_URLS_EXPLAIN' => 'Maximum number of URLs in a post. Set to 0 for unlimited links.',
'MIN_CHAR_LIMIT' => 'Minimum characters per post/message',
- 'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message.',
+ 'MIN_CHAR_LIMIT_EXPLAIN' => 'The minimum number of characters the user need to enter within a post/private message. The minimum for this setting is 1.',
'POSTING' => 'Posting',
'POSTS_PER_PAGE' => 'Posts per page',
'QUOTE_DEPTH_LIMIT' => 'Maximum nesting depth for quotes',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 8c71e936b3..ef8d6f1cb3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -327,6 +327,16 @@ $lang = array_merge($lang, array(
'DATABASE_SERVER_INFO' => 'Database server',
'DATABASE_SIZE' => 'Database size',
+ // Enviroment configuration checks, mbstring related
+ 'ERROR_MBSTRING_FUNC_OVERLOAD' => 'Function overloading is improperly configured',
+ 'ERROR_MBSTRING_FUNC_OVERLOAD_EXPLAIN' => '<var>mbstring.func_overload</var> must be set to either 0 or 4. You can check the current value on the <samp>PHP information</samp> page.',
+ 'ERROR_MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding is improperly configured',
+ 'ERROR_MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => '<var>mbstring.encoding_translation</var> must be set to 0. You can check the current value on the <samp>PHP information</samp> page.',
+ 'ERROR_MBSTRING_HTTP_INPUT' => 'HTTP input character conversion is improperly configured',
+ 'ERROR_MBSTRING_HTTP_INPUT_EXPLAIN' => '<var>mbstring.http_input</var> must be set to <samp>pass</samp>. You can check the current value on the <samp>PHP information</samp> page.',
+ 'ERROR_MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion is improperly configured',
+ 'ERROR_MBSTRING_HTTP_OUTPUT_EXPLAIN' => '<var>mbstring.http_output</var> must be set to <samp>pass</samp>. You can check the current value on the <samp>PHP information</samp> page.',
+
'FILES_PER_DAY' => 'Attachments per day',
'FORUM_STATS' => 'Board statistics',
diff --git a/phpBB/language/en/acp/database.php b/phpBB/language/en/acp/database.php
index ae8f76d6b7..9c8ecbf13a 100644
--- a/phpBB/language/en/acp/database.php
+++ b/phpBB/language/en/acp/database.php
@@ -59,6 +59,7 @@ $lang = array_merge($lang, array(
'RESTORE_FAILURE' => 'The backup file may be corrupt.',
'RESTORE_OPTIONS' => 'Restore options',
+ 'RESTORE_SELECTED_BACKUP' => 'Are you sure you want to restore the selected backup?',
'RESTORE_SUCCESS' => 'The database has been successfully restored.<br /><br />Your board should be back to the state it was when the backup was made.',
'SELECT_ALL' => 'Select all',
diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php
index eab027f295..b99a0724be 100644
--- a/phpBB/language/en/acp/forums.php
+++ b/phpBB/language/en/acp/forums.php
@@ -72,7 +72,7 @@ $lang = array_merge($lang, array(
'ENABLE_TOPIC_ICONS' => 'Enable topic icons',
'FORUM_ADMIN' => 'Forum administration',
- 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>',
+ 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>',
'FORUM_AUTO_PRUNE' => 'Enable auto-pruning',
'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.',
'FORUM_CREATED' => 'Forum created successfully.',
diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php
index 4d11309ebb..dde4e3d722 100644
--- a/phpBB/language/en/acp/language.php
+++ b/phpBB/language/en/acp/language.php
@@ -59,6 +59,7 @@ $lang = array_merge($lang, array(
'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been reset to the boards default language.',
'LANGUAGE_PACK_DETAILS' => 'Language pack details',
'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.',
+ 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.',
'LANGUAGE_PACK_ISO' => 'ISO',
'LANGUAGE_PACK_LOCALNAME' => 'Local name',
'LANGUAGE_PACK_NAME' => 'Name',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 1c96818346..005640b7dd 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -165,6 +165,7 @@ $lang = array_merge($lang, array(
'EMPTY_MESSAGE_SUBJECT' => 'You must specify a subject when composing a new message.',
'ENABLED' => 'Enabled',
'ENCLOSURE' => 'Enclosure',
+ 'ENTER_USERNAME' => 'Enter username',
'ERR_CHANGING_DIRECTORY' => 'Unable to change directory.',
'ERR_CONNECTING_SERVER' => 'Error connecting to the server.',
'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.',
@@ -200,6 +201,7 @@ $lang = array_merge($lang, array(
'FORUM_RULES_LINK' => 'Please click here to view the forum rules',
'FROM' => 'from',
'FSOCK_DISABLED' => 'The operation could not be completed because the <var>fsockopen</var> function has been disabled or the server being queried could not be found.',
+ 'FSOCK_TIMEOUT' => 'A timeout occurred while reading from the network stream.',
'FTP_FSOCK_HOST' => 'FTP host',
'FTP_FSOCK_HOST_EXPLAIN' => 'FTP server used to connect your site.',
diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt
index 2397868323..cfdb69bdcb 100644
--- a/phpBB/language/en/email/admin_welcome_activated.txt
+++ b/phpBB/language/en/email/admin_welcome_activated.txt
@@ -2,7 +2,7 @@ Subject: Account activated
Hello {USERNAME},
-Your account on "{SITENAME}" has now been activated, you may login using the username you received in a previous e-mail.
+Your account on "{SITENAME}" has been activated by an administrator, you may login now.
Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt
index d363df7973..d3a86cc73c 100644
--- a/phpBB/language/en/email/privmsg_notify.txt
+++ b/phpBB/language/en/email/privmsg_notify.txt
@@ -8,7 +8,7 @@ You have received a new private message from "{AUTHOR_NAME}" to your account on
You can view your new message by clicking on the following link:
-{U_INBOX}
+{U_VIEW_MESSAGE}
You have requested that you be notified on this event, remember that you can always choose not to be notified of new messages by changing the appropriate setting in your profile.
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 3b7dc02d3f..b915a3da19 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -60,7 +60,7 @@ $help = array(
),
array(
0 => 'I registered in the past but cannot login any more?!',
- 1 => 'Attempt to locate the e-mail sent to you when you first registered, check your username and password and try again. It is possible an administrator has deactivated or deleted your account for some reason. Also, many boards periodically remove users who have not posted for a long time to reduce the size of the database. If this has happened, try registering again and being more involved in discussions.'
+ 1 => 'It is possible an administrator has deactivated or deleted your account for some reason. Also, many boards periodically remove users who have not posted for a long time to reduce the size of the database. If this has happened, try registering again and being more involved in discussions.'
),
array(
0 => 'What is COPPA?',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index befa7c6f40..f69ca40613 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -151,7 +151,7 @@ $lang = array_merge($lang, array(
'DLL_MYSQL' => 'MySQL',
'DLL_MYSQLI' => 'MySQL with MySQLi Extension',
'DLL_ORACLE' => 'Oracle',
- 'DLL_POSTGRES' => 'PostgreSQL 7.x/8.x',
+ 'DLL_POSTGRES' => 'PostgreSQL',
'DLL_SQLITE' => 'SQLite',
'DLL_XML' => 'XML support [ Jabber ]',
'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]',
@@ -232,6 +232,7 @@ $lang = array_merge($lang, array(
'INST_ERR' => 'Installation error',
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
+ 'INST_ERR_DB_INVALID_PREFIX'=> 'The prefix you entered is invalid. It must start with a letter and must only contain letters, numbers and underscores.',
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
@@ -352,6 +353,7 @@ $lang = array_merge($lang, array(
'TABLES_MISSING' => 'Could not find these tables<br />» <strong>%s</strong>.',
'TABLE_PREFIX' => 'Prefix for tables in database',
+ 'TABLE_PREFIX_EXPLAIN' => 'The prefix must start with a letter and must only contain letters, numbers and underscores.',
'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s.',
'TESTS_PASSED' => 'Tests passed',
'TESTS_FAILED' => 'Tests failed',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index c1e3c06c43..3ebc863447 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -138,6 +138,7 @@ $lang = array_merge($lang, array(
'CURRENT_IMAGE' => 'Current image',
'CURRENT_PASSWORD' => 'Current password',
'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your e-mail address or username.',
+ 'CUR_PASSWORD_EMPTY' => 'You did not enter your current password.',
'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.',
'CUSTOM_DATEFORMAT' => 'Custom…',
@@ -268,9 +269,11 @@ $lang = array_merge($lang, array(
'MOVE_TO_FOLDER' => 'Move to folder',
'MOVE_UP' => 'Move up',
+ 'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.',
'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.',
'NEW_FOLDER_NAME' => 'New folder name',
'NEW_PASSWORD' => 'New password',
+ 'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.',
'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.',
'NOTIFY_METHOD' => 'Notification method',
'NOTIFY_METHOD_BOTH' => 'Both',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 8169ee7a3e..b3c0bae16a 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -899,10 +899,7 @@ switch ($mode)
$notify_type = NOTIFY_EMAIL;
}
- $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
- $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
- $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
- $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
+ $messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'BOARD_CONTACT' => $config['board_contact'],
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 1bc498efe7..76c8100c78 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -895,7 +895,7 @@ if ($submit || $preview || $refresh)
$message_parser->parse_poll($poll);
- $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
+ $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array();
$post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
/* We reset votes, therefore also allow removing options
@@ -904,6 +904,24 @@ if ($submit || $preview || $refresh)
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
}*/
}
+ else if ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && $auth->acl_get('f_poll', $forum_id))
+ {
+ // The user removed all poll options, this is equal to deleting the poll.
+ $poll = array(
+ 'poll_title' => '',
+ 'poll_length' => 0,
+ 'poll_max_options' => 0,
+ 'poll_option_text' => '',
+ 'poll_start' => 0,
+ 'poll_last_vote' => 0,
+ 'poll_vote_change' => 0,
+ 'poll_options' => array(),
+ );
+
+ $post_data['poll_options'] = array();
+ $post_data['poll_title'] = '';
+ $post_data['poll_start'] = $post_data['poll_length'] = $post_data['poll_max_options'] = $post_data['poll_last_vote'] = $post_data['poll_vote_change'] = 0;
+ }
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.
@@ -917,7 +935,7 @@ if ($submit || $preview || $refresh)
$message_parser->parse_poll($poll);
- $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
+ $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array();
$post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
}
else
diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg
index 72252079d6..5a703d9e47 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.9
+version = 3.0.10
# Images
img_site_logo = site_logo.gif*52*139
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index 83e762f65b..95d8d287e4 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.9 \ No newline at end of file
+version = 3.0.10 \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js
index cfdb54f54b..5aa486d320 100644
--- a/phpBB/styles/prosilver/template/editor.js
+++ b/phpBB/styles/prosilver/template/editor.js
@@ -28,8 +28,8 @@ function helpline(help)
/**
* Fix a bug involving the TextRange object. From
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
+*/
+function initInsertions()
{
var doc;
@@ -37,7 +37,7 @@ function initInsertions()
{
doc = document;
}
- else
+ else
{
doc = opener.document;
}
@@ -60,12 +60,12 @@ function initInsertions()
* bbstyle
*/
function bbstyle(bbnumber)
-{
+{
if (bbnumber != -1)
{
bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
+ }
+ else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
@@ -86,14 +86,10 @@ function bbfontstyle(bbopen, bbclose)
if ((clientVer >= 4) && is_ie && is_win)
{
// Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
+ if (textarea.createTextRange && textarea.caretPos)
{
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
+ textarea.caretPos.text = bbopen + textarea.caretPos.text + bbclose;
+ textarea.focus();
return;
}
}
@@ -104,10 +100,10 @@ function bbfontstyle(bbopen, bbclose)
theSelection = '';
return;
}
-
+
//The new position for the cursor after adding the bbcode
var caret_pos = getCaretPosition(textarea).start;
- var new_pos = caret_pos + bbopen.length;
+ var new_pos = caret_pos + bbopen.length;
// Open tag
insert_text(bbopen + bbclose);
@@ -118,12 +114,12 @@ function bbfontstyle(bbopen, bbclose)
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
- }
+ }
// IE
else if (document.selection)
{
- var range = textarea.createTextRange();
- range.move("character", new_pos);
+ var range = textarea.createTextRange();
+ range.move("character", new_pos);
range.select();
storeCaret(textarea);
}
@@ -138,16 +134,16 @@ function bbfontstyle(bbopen, bbclose)
function insert_text(text, spaces, popup)
{
var textarea;
-
- if (!popup)
+
+ if (!popup)
{
textarea = document.forms[form_name].elements[text_name];
- }
- else
+ }
+ else
{
textarea = opener.document.forms[form_name].elements[text_name];
}
- if (spaces)
+ if (spaces)
{
text = ' ' + text + ' ';
}
@@ -165,7 +161,7 @@ function insert_text(text, spaces, popup)
}
else if (textarea.createTextRange && textarea.caretPos)
{
- if (baseHeight != textarea.caretPos.boundingHeight)
+ if (baseHeight != textarea.caretPos.boundingHeight)
{
textarea.focus();
storeCaret(textarea);
@@ -178,7 +174,7 @@ function insert_text(text, spaces, popup)
{
textarea.value = textarea.value + text;
}
- if (!popup)
+ if (!popup)
{
textarea.focus();
}
@@ -295,7 +291,7 @@ function split_lines(text)
do
{
var splitAt = line.indexOf(' ', 80);
-
+
if (splitAt == -1)
{
splitLines[j] = line;
@@ -323,7 +319,7 @@ function mozWrap(txtarea, open, close)
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;
- if (selEnd == 1 || selEnd == 2)
+ if (selEnd == 1 || selEnd == 2)
{
selEnd = selLength;
}
@@ -347,7 +343,17 @@ function mozWrap(txtarea, open, close)
*/
function storeCaret(textEl)
{
- if (textEl.createTextRange)
+ var keyCode = false;
+ if (is_ie)
+ {
+ keyCode = (event.keyCode) ? event.keyCode : event.charCode;
+ }
+
+ // Did the user press Shift (16), Ctrl (17) or Alt (18)?
+ // If so, we do not update the caretPos, so BBCodes can still be applied correctly.
+ var is_control_key = (keyCode == 16 || keyCode == 17 || keyCode == 18);
+
+ if ((!is_ie || !is_control_key) && (textEl.createTextRange))
{
textEl.caretPos = document.selection.createRange().duplicate();
}
@@ -383,7 +389,7 @@ function colorPalette(dir, width, height)
{
document.writeln('<tr>');
}
-
+
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
@@ -423,36 +429,35 @@ function caretPosition()
function getCaretPosition(txtarea)
{
var caretPos = new caretPosition();
-
+
// simple Gecko/Opera way
- if(txtarea.selectionStart || txtarea.selectionStart == 0)
+ if (!is_ie && (txtarea.selectionStart || txtarea.selectionStart == 0))
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
}
// dirty and slow IE way
- else if(document.selection)
+ else if (document.selection)
{
-
// get current selection
var range = document.selection.createRange();
// a new selection of the whole textarea
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea);
-
+
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
+ {
range_all.moveStart('character', 1);
}
-
+
txtarea.sel_start = sel_start;
-
+
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
- caretPos.end = txtarea.sel_start;
+ caretPos.end = txtarea.sel_start;
}
return caretPos;
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index 2c2a242a9f..bf672e16fc 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -11,9 +11,9 @@
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
- <li class="header">
+ <li class="header widescreen-optimised">
<dl class="icon">
- <dt><div class="wrap-content"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></div></dt>
+ <dt><span class="wrap-content"><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></span></dt>
<dd class="topics">{L_TOPICS}</dd>
<dd class="posts">{L_POSTS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -25,8 +25,8 @@
<!-- IF not forumrow.S_IS_CAT -->
<li class="row">
- <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt title="{forumrow.FORUM_FOLDER_IMG_ALT}"><div class="wrap-content">
+ <dl class="icon widescreen-optimised" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dt title="{forumrow.FORUM_FOLDER_IMG_ALT}"><span class="wrap-content">
<!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
@@ -36,7 +36,7 @@
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
- </div></dt>
+ </span></dt>
<!-- IF forumrow.CLICKS -->
<dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd>
<!-- ELSEIF not forumrow.S_IS_LINK -->
diff --git a/phpBB/styles/prosilver/template/mcp_approve.html b/phpBB/styles/prosilver/template/mcp_approve.html
index 329205e2a2..185dd49c1b 100644
--- a/phpBB/styles/prosilver/template/mcp_approve.html
+++ b/phpBB/styles/prosilver/template/mcp_approve.html
@@ -8,7 +8,7 @@
<div class="content">
<h2>{MESSAGE_TITLE}</h2>
- <!-- IF ADDITIONAL_MSG --><p>{ADDITIONAL_MSG}</p><!-- ENDIF -->
+ <!-- IF ADDITIONAL_MSG --><p class="error">{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
<!-- IF S_NOTIFY_POSTER -->
diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html
index c7c089ecad..7e92445476 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_user.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_user.html
@@ -78,7 +78,7 @@
<td style="text-align: center">{usernotes.REPORT_AT}</td>
<td>{usernotes.ACTION}</td>
- <!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
+ <!-- IF S_CLEAR_ALLOWED --><td style="width: 5%; text-align: center;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
<tr>
diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html
index 9d4997e576..f8403ffccd 100644
--- a/phpBB/styles/prosilver/template/mcp_post.html
+++ b/phpBB/styles/prosilver/template/mcp_post.html
@@ -74,6 +74,7 @@
<p class="rules">
<input class="button2" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" /> &nbsp;
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
+ <!-- IF not S_FIRST_POST --><input type="hidden" name="mode" value="unapproved_posts" /><!-- ENDIF -->
<input type="hidden" name="post_id_list[]" value="{POST_ID}" />
{S_FORM_TOKEN}
</p>
diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html
index 896f0b826e..3a970769b7 100644
--- a/phpBB/styles/prosilver/template/message_body.html
+++ b/phpBB/styles/prosilver/template/message_body.html
@@ -1,4 +1,8 @@
-<!-- INCLUDE overall_header.html -->
+<!-- IF S_SIMPLE_MESSAGE -->
+ <!-- INCLUDE simple_header.html -->
+<!-- ELSE -->
+ <!-- INCLUDE overall_header.html -->
+<!-- ENDIF -->
<div class="panel" id="message">
<div class="inner"><span class="corners-top"><span></span></span>
@@ -8,4 +12,8 @@
<span class="corners-bottom"><span></span></span></div>
</div>
-<!-- INCLUDE overall_footer.html --> \ No newline at end of file
+<!-- IF S_SIMPLE_MESSAGE -->
+ <!-- INCLUDE simple_footer.html -->
+<!-- ELSE -->
+ <!-- INCLUDE overall_footer.html -->
+<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index f2a4435103..014b39de87 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -39,8 +39,8 @@
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
- <dl class="icon">
- <dt>{L_TOPICS}</dt>
+ <dl class="icon widescreen-optimised">
+ <dt><span class="wrap-content">{L_TOPICS}</span></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -51,8 +51,8 @@
<!-- BEGIN searchresults -->
<li class="row<!-- IF searchresults.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({searchresults.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
+ <dl class="icon widescreen-optimised" style="background-image: url({searchresults.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->><span class="wrap-content">
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
<a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
<!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
@@ -60,7 +60,7 @@
<!-- IF searchresults.PAGINATION --><strong class="pagination"><span>{searchresults.PAGINATION}</span></strong><!-- ENDIF -->
{L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} &raquo; {searchresults.FIRST_POST_TIME}
<!-- IF not searchresults.S_TOPIC_GLOBAL -->{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE --> ({L_GLOBAL})<!-- ENDIF -->
- </dt>
+ </span></dt>
<dd class="posts">{searchresults.TOPIC_REPLIES}</dd>
<dd class="views">{searchresults.TOPIC_VIEWS}</dd>
<dd class="lastpost"><span>
diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg
index 42383a022f..d31dcb7356 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.9
+version = 3.0.10
# Defining a different template bitfield
template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html
index 8052fdc435..c76316d93e 100644
--- a/phpBB/styles/prosilver/template/ucp_attachments.html
+++ b/phpBB/styles/prosilver/template/ucp_attachments.html
@@ -20,7 +20,7 @@
<ul class="topiclist">
<li class="header">
<dl>
- <dt style="width: 40%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></dt>
+ <dt><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></dt>
<dd class="extra"><a href="{U_SORT_DOWNLOADS}">{L_DOWNLOADS}</a></dd>
<dd class="time"><span><a href="{U_SORT_POST_TIME}">{L_POST_TIME}</a></span></dd>
<dd class="mark">{L_MARK}</dd>
@@ -32,7 +32,7 @@
<!-- BEGIN attachrow -->
<li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
<dl>
- <dt style="width: 40%"><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
+ <dt><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a> ({attachrow.SIZE})<br />
<!-- IF attachrow.S_IN_MESSAGE -->{L_PM}: <!-- ELSE -->{L_TOPIC}: <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt>
<dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd>
<dd class="time"><span>{attachrow.POST_TIME}</span></dd>
diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html
index bce31431cb..87b548c23b 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_manage.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html
@@ -143,8 +143,15 @@
</tr>
<!-- ENDIF -->
<!-- BEGINELSE -->
+ <table class="table1" cellspacing="1">
+ <thead>
<tr>
- <td class="bg1" colspan="5">{L_GROUPS_NO_MEMBERS}</td>
+ <th class="name">{L_MEMBERS}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td class="bg1">{L_GROUPS_NO_MEMBERS}</td>
</tr>
<!-- END member -->
</tbody>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index b1a93296bd..ce2a376768 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -1,120 +1,57 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
+
<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
-<title>{SITENAME} :: {PAGE_TITLE}</title>
-
-<style type="text/css">
-/* <![CDATA[ */
-body {
- font-family: Verdana,serif;
- font-size: 10pt;
-}
-
-td {
- font-family: Verdana,serif;
- font-size: 10pt;
- line-height: 150%;
-}
-
-.code, .quote {
- font-size: smaller;
- border: black solid 1px;
-}
-
-.forum {
- font-family: Arial,Helvetica,sans-serif;
- font-weight: bold;
- font-size: 18pt;
-}
-
-.topic {
- font-family: Arial,Helvetica,sans-serif;
- font-size: 14pt;
- font-weight: bold;
-}
-
-.gensmall {
- font-size: 8pt;
-}
-
-hr {
- color: #888888;
- height: 3px;
- border-style: solid;
-}
-
-hr.sep {
- color: #AAAAAA;
- height: 1px;
- border-style: dashed;
-}
-/* ]]> */
-</style>
-
+<meta http-equiv="imagetoolbar" content="no" />
+<meta name="resource-type" content="document" />
+<meta name="distribution" content="global" />
+<meta name="keywords" content="" />
+<meta name="description" content="" />
+<meta name="robots" content="noindex" />
+{META}
+<title>{SITENAME} &bull; {PAGE_TITLE}</title>
+
+<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />
</head>
-<body>
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td colspan="2" align="center"><span class="forum">{SITENAME}</span><br /><span class="gensmall">{L_PRIVATE_MESSAGING}</a></span></td>
-</tr>
-<tr>
- <td colspan="2"><br /></td>
-</tr>
-<tr>
- <td><span class="topic">{SUBJECT}</span><br /></td>
- <td align="right" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td>
-</tr>
-</table>
-
-<hr width="85%" />
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td width="10%" nowrap="nowrap">{L_PM_FROM}:&nbsp;</td>
- <td><strong>{MESSAGE_AUTHOR}</strong> [ {SENT_DATE} ]</td>
-</tr>
-
-<!-- IF S_TO_RECIPIENT -->
- <tr>
- <td width="10%" nowrap="nowrap">{L_TO}:</td>
- <td>
- <!-- BEGIN to_recipient -->
- <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span>&nbsp;
- <!-- END to_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_BCC_RECIPIENT -->
- <tr>
- <td width="10%" nowrap="nowrap">{L_BCC}:</td>
- <td>
- <!-- BEGIN bcc_recipient -->
- <!-- IF bcc_recipient.COLOUR --><span style="color:{bcc_recipient.COLOUR}"><!-- ELSE --><span<!-- IF bcc_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</span>&nbsp;
- <!-- END bcc_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td colspan="2"><hr class="sep" />{MESSAGE}</td>
-</tr>
-</table>
-
-<hr width="85%" />
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td><span class="gensmall">{PAGE_NUMBER}</span></td>
- <td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
-</tr>
-<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</span></td>
-</tr>
-</table>
+<body id="phpbb">
+<div id="wrap">
+ <a id="top" name="top" accesskey="t"></a>
+
+ <div id="page-header">
+ <h1>{SITENAME}</h1>
+ <p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p>
+
+ <h2>{TOPIC_TITLE}</h2>
+ <p><a href="{U_TOPIC}">{U_TOPIC}</a></p>
+ </div>
+
+ <div id="page-body">
+ <div class="page-number">{PAGE_NUMBER}</div>
+ <div class="post">
+ <h3>{SUBJECT}</h3>
+ <div class="date">{L_SENT_AT} <strong>{SENT_DATE}</strong></div>
+ <div class="author">{L_PM_FROM} <strong>{MESSAGE_AUTHOR}</strong></div>
+ <!-- IF S_TO_RECIPIENT -->
+ <div class="author">{L_TO} <strong><!-- BEGIN to_recipient -->{to_recipient.NAME}&nbsp;<!-- END to_recipient --></strong></div>
+ <!-- ENDIF -->
+ <!-- IF S_BCC_RECIPIENT -->
+ <div class="author">{L_BCC} <strong><!-- BEGIN bcc_recipient -->{bcc_recipient.NAME}&nbsp;<!-- END bcc_recipient --></strong></div>
+ <!-- ENDIF -->
+ <hr />
+ <div class="content">{MESSAGE}</div>
+ </div>
+ <hr />
+ </div>
+
+ <div id="page-footer">
+ <div class="page-number">{S_TIMEZONE}<br />{PAGE_NUMBER}</div>
+ <div class="copyright">Powered by phpBB&reg; Forum Software &copy; phpBB Group<br />http://www.phpbb.com/</div>
+ </div>
+</div>
</body>
</html> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 4ad0990d98..d2952bff2a 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -126,8 +126,8 @@
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
- <dl class="icon">
- <dt><div class="wrap-content"><!-- 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 --></div></dt>
+ <dl class="icon widescreen-optimised">
+ <dt><span class="wrap-content"><!-- 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 --></span></dt>
<dd class="posts">{L_REPLIES}</dd>
<dd class="views">{L_VIEWS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
@@ -138,13 +138,13 @@
<!-- 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}"><div class="wrap-content"><!-- 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>
+ <dl class="icon widescreen-optimised" 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}"><span class="wrap-content"><!-- 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 -->
<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
<!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
- </div></dt>
+ </span></dt>
<dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
<dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
<dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 32292f89ef..57de96d853 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -4,13 +4,10 @@
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
-<!-- IF MODERATORS or U_MCP -->
- <p>
- <!-- IF MODERATORS -->
- <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}
- <!-- ENDIF -->
-
- </p>
+<!-- IF MODERATORS -->
+<p>
+ <strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}
+</p>
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index f441784d85..d1cff9c8be 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -1,4 +1,4 @@
-/* proSilver RTL definitions
+/* RTL definitions
---------------------------------------- */
/**
@@ -519,7 +519,7 @@
/**
* cp.css
*/
-/* proSilver Control Panel Styles
+/* Control Panel Styles
---------------------------------------- */
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index 6cffdc5930..a9ded9cf98 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -1,4 +1,4 @@
-/* proSilver Button Styles
+/* Button Styles
---------------------------------------- */
/* Rollover buttons
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index a86f723f81..8b5e09297e 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1,4 +1,4 @@
-/* General proSilver Markup Styles
+/* General Markup Styles
---------------------------------------- */
* {
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 2dad706bf5..696d5e1cc0 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -1,4 +1,4 @@
-/* proSilver Content Styles
+/* Content Styles
---------------------------------------- */
ul.topiclist {
@@ -29,14 +29,19 @@ ul.topiclist li.row dl {
ul.topiclist dt {
display: block;
float: left;
- width: 100%;
+ width: 50%;
font-size: 1.1em;
padding-left: 5px;
padding-right: 5px;
+}
+
+ul.topiclist .widescreen-optimised dt {
+ width: 100%;
margin-right: -465px;
}
-ul.topiclist dt .wrap-content {
+ul.topiclist .widescreen-optimised dt .wrap-content {
+ display: block;
padding-right: 465px;
}
@@ -101,6 +106,9 @@ li.header dt, li.header dd {
li.header dt {
font-weight: bold;
+}
+
+li.header .widescreen-optimised dt {
margin-right: -465px;
}
@@ -184,7 +192,7 @@ dd.extra {
dd.mark {
float: right !important;
- width: 9%;
+ width: 90px;
text-align: center;
line-height: 200%;
font-size: 1.2em;
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index b574b0ae1f..708bfbaf83 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -1,4 +1,4 @@
-/* proSilver Control Panel Styles
+/* Control Panel Styles
---------------------------------------- */
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 803c608bcf..43888733cc 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -1,4 +1,4 @@
-/* proSilver Form Styles
+/* Form Styles
---------------------------------------- */
/* General form styles
@@ -26,6 +26,7 @@ select {
border: 1px solid #666666;
padding: 1px;
background-color: #FAFAFA;
+ font-size: 1em;
}
option {
diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css
index 1f6c2af550..05662b9b44 100644
--- a/phpBB/styles/prosilver/theme/links.css
+++ b/phpBB/styles/prosilver/theme/links.css
@@ -1,4 +1,4 @@
-/* proSilver Link Styles
+/* Link Styles
---------------------------------------- */
/* Links adjustment to correctly display an order of rtl/ltr mixed content */
diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css
index 2cfcd4da20..bc3ca80fdc 100644
--- a/phpBB/styles/prosilver/theme/print.css
+++ b/phpBB/styles/prosilver/theme/print.css
@@ -1,10 +1,5 @@
-/* proSilver Print Style Sheet
--------------------------------------------------
- Author: subBlue ( http://www.subBlue.com/ )
- Version: 25 August 2004
-
- Copyright 2004 phpBB Group
--------------------------------------------------*/
+/* Print Style Sheet
+---------------------------------------- */
/* Lots still TODO here! */
diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css
index c7db605bbb..4a7356fbaa 100644
--- a/phpBB/styles/prosilver/theme/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/stylesheet.css
@@ -1,11 +1,9 @@
-/* phpBB 3.0 Style Sheet
+/* phpBB3 Style Sheet
--------------------------------------------------------------
- Style name: proSilver
- Based on style: proSilver (this is the default phpBB 3 style)
- Original author: subBlue ( http://www.subBlue.com/ )
- Modified by:
-
- Copyright 2006 phpBB Group ( http://www.phpbb.com/ )
+ Style name: prosilver (the default phpBB 3.0.x style)
+ Based on style:
+ Original author: Tom Beddard ( http://www.subblue.com/ )
+ Modified by: phpBB Group ( http://www.phpbb.com/ )
--------------------------------------------------------------
*/
diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg
index 4270094eab..e8698f7fe4 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.9
+version = 3.0.10
# Some configuration options
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 30fe5fb986..f7322c2cce 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -1,4 +1,4 @@
-/* proSilver Style Sheet Tweaks
+/* Style Sheet Tweaks
These style definitions are mainly IE specific
tweaks required due to its poor CSS support.
diff --git a/phpBB/styles/subsilver2/imageset/imageset.cfg b/phpBB/styles/subsilver2/imageset/imageset.cfg
index d8cfabcb02..75a4aad038 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.9
+version = 3.0.10
# Images
img_site_logo = site_logo.gif*94*170
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 0cdb7204bb..13e44435c6 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.9
+version = 3.0.10
diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js
index 7cc5de9034..5aa486d320 100644
--- a/phpBB/styles/subsilver2/template/editor.js
+++ b/phpBB/styles/subsilver2/template/editor.js
@@ -6,8 +6,8 @@
// Startup variables
var imageTag = false;
var theSelection = false;
-var bbcodeEnabled = true;
+var bbcodeEnabled = true;
// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
@@ -15,7 +15,6 @@ var clientVer = parseInt(navigator.appVersion); // Get browser version
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
-
var baseHeight;
/**
@@ -29,8 +28,8 @@ function helpline(help)
/**
* Fix a bug involving the TextRange object. From
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
-*/
-function initInsertions()
+*/
+function initInsertions()
{
var doc;
@@ -38,14 +37,15 @@ function initInsertions()
{
doc = document;
}
- else
+ else
{
doc = opener.document;
}
var textarea = doc.forms[form_name].elements[text_name];
+
if (is_ie && typeof(baseHeight) != 'number')
- {
+ {
textarea.focus();
baseHeight = doc.selection.createRange().duplicate().boundingHeight;
@@ -60,12 +60,12 @@ function initInsertions()
* bbstyle
*/
function bbstyle(bbnumber)
-{
+{
if (bbnumber != -1)
{
bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
- }
- else
+ }
+ else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
@@ -78,7 +78,7 @@ function bbstyle(bbnumber)
function bbfontstyle(bbopen, bbclose)
{
theSelection = false;
-
+
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
@@ -86,14 +86,10 @@ function bbfontstyle(bbopen, bbclose)
if ((clientVer >= 4) && is_ie && is_win)
{
// Get text selection
- theSelection = document.selection.createRange().text;
-
- if (theSelection)
+ if (textarea.createTextRange && textarea.caretPos)
{
- // Add tags around selection
- document.selection.createRange().text = bbopen + theSelection + bbclose;
- document.forms[form_name].elements[text_name].focus();
- theSelection = '';
+ textarea.caretPos.text = bbopen + textarea.caretPos.text + bbclose;
+ textarea.focus();
return;
}
}
@@ -104,7 +100,7 @@ function bbfontstyle(bbopen, bbclose)
theSelection = '';
return;
}
-
+
//The new position for the cursor after adding the bbcode
var caret_pos = getCaretPosition(textarea).start;
var new_pos = caret_pos + bbopen.length;
@@ -118,12 +114,12 @@ function bbfontstyle(bbopen, bbclose)
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
- }
+ }
// IE
else if (document.selection)
{
- var range = textarea.createTextRange();
- range.move("character", new_pos);
+ var range = textarea.createTextRange();
+ range.move("character", new_pos);
range.select();
storeCaret(textarea);
}
@@ -138,16 +134,16 @@ function bbfontstyle(bbopen, bbclose)
function insert_text(text, spaces, popup)
{
var textarea;
-
- if (!popup)
+
+ if (!popup)
{
textarea = document.forms[form_name].elements[text_name];
- }
- else
+ }
+ else
{
textarea = opener.document.forms[form_name].elements[text_name];
}
- if (spaces)
+ if (spaces)
{
text = ' ' + text + ' ';
}
@@ -162,28 +158,26 @@ function insert_text(text, spaces, popup)
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
- }
-
+ }
else if (textarea.createTextRange && textarea.caretPos)
{
- if (baseHeight != textarea.caretPos.boundingHeight)
+ if (baseHeight != textarea.caretPos.boundingHeight)
{
textarea.focus();
storeCaret(textarea);
- }
+ }
+
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
-
}
else
{
textarea.value = textarea.value + text;
}
- if (!popup)
+ if (!popup)
{
textarea.focus();
- }
-
+ }
}
/**
@@ -279,7 +273,6 @@ function addquote(post_id, username, l_wrote)
return;
}
-
function split_lines(text)
{
var lines = text.split('\n');
@@ -298,7 +291,7 @@ function split_lines(text)
do
{
var splitAt = line.indexOf(' ', 80);
-
+
if (splitAt == -1)
{
splitLines[j] = line;
@@ -316,7 +309,6 @@ function split_lines(text)
}
return splitLines;
}
-
/**
* From http://www.massless.org/mozedit/
*/
@@ -327,7 +319,7 @@ function mozWrap(txtarea, open, close)
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;
- if (selEnd == 1 || selEnd == 2)
+ if (selEnd == 1 || selEnd == 2)
{
selEnd = selLength;
}
@@ -351,7 +343,17 @@ function mozWrap(txtarea, open, close)
*/
function storeCaret(textEl)
{
- if (textEl.createTextRange)
+ var keyCode = false;
+ if (is_ie)
+ {
+ keyCode = (event.keyCode) ? event.keyCode : event.charCode;
+ }
+
+ // Did the user press Shift (16), Ctrl (17) or Alt (18)?
+ // If so, we do not update the caretPos, so BBCodes can still be applied correctly.
+ var is_control_key = (keyCode == 16 || keyCode == 17 || keyCode == 18);
+
+ if ((!is_ie || !is_control_key) && (textEl.createTextRange))
{
textEl.caretPos = document.selection.createRange().duplicate();
}
@@ -387,7 +389,7 @@ function colorPalette(dir, width, height)
{
document.writeln('<tr>');
}
-
+
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
@@ -427,15 +429,15 @@ function caretPosition()
function getCaretPosition(txtarea)
{
var caretPos = new caretPosition();
-
+
// simple Gecko/Opera way
- if(txtarea.selectionStart || txtarea.selectionStart == 0)
+ if (!is_ie && (txtarea.selectionStart || txtarea.selectionStart == 0))
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
}
// dirty and slow IE way
- else if(document.selection)
+ else if (document.selection)
{
// get current selection
var range = document.selection.createRange();
@@ -443,16 +445,16 @@ function getCaretPosition(txtarea)
// a new selection of the whole textarea
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea);
-
+
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
- {
+ {
range_all.moveStart('character', 1);
}
-
+
txtarea.sel_start = sel_start;
-
+
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
caretPos.end = txtarea.sel_start;
diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg
index 92ccfef35a..4e5c36af99 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.9
+version = 3.0.10
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
index 6753a5bc33..24194e4c26 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
@@ -61,7 +61,7 @@ hr.sep {
<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
<tr>
- <td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{L_PRIVATE_MESSAGING}</a></span></td>
+ <td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{L_PRIVATE_MESSAGING}</span></td>
</tr>
<tr>
<td colspan="2"><br /></td>
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index c2b6718d87..444104ae3c 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -1,14 +1,9 @@
-/* phpBB 3.0 Style Sheet
+/* phpBB3 Style Sheet
--------------------------------------------------------------
- Style name: subsilver2
- Based on style: subSilver (the default phpBB 2 style)
- Original author: subBlue ( http://www.subBlue.com/ )
- Modified by: psoTFX and the phpBB team ( http://www.phpbb.com )
-
- This is an alternative style for phpBB3 for those wishing to stay with
- the familiar subSilver style of phpBB version 2.x
-
- Copyright 2006 phpBB Group ( http://www.phpbb.com/ )
+ Style name: subsilver2
+ Based on style: subSilver (the default phpBB 2.0.x style)
+ Original author: Tom Beddard ( http://www.subblue.com/ )
+ Modified by: phpBB Group ( http://www.phpbb.com/ )
--------------------------------------------------------------
*/
diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg
index 94e2f6d53d..d7837a3766 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.9
+version = 3.0.10
# Some configuration options
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 8fa022668b..45caeb12ea 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -254,6 +254,12 @@ if (!$user->data['is_registered'])
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
+ if ($id == 'pm' && $mode == 'view' && isset($_GET['p']))
+ {
+ $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0));
+ login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']);
+ }
+
login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index e0b51bf782..8a6b777bea 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -205,7 +205,7 @@ $s_watching_forum = array(
'is_watching' => false,
);
-if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && $auth->acl_get('f_subscribe', $forum_id))
+if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS))
{
$notify_status = (isset($forum_data['notify_status'])) ? $forum_data['notify_status'] : NULL;
watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']);
@@ -376,6 +376,12 @@ if ($forum_data['forum_type'] == FORUM_POST)
while ($row = $db->sql_fetchrow($result))
{
+ if (!$row['topic_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
+ {
+ // Do not display announcements that are waiting for approval.
+ continue;
+ }
+
$rowset[$row['topic_id']] = $row;
$announcement_list[] = $row['topic_id'];
@@ -533,10 +539,13 @@ if ($s_display_active)
$topics_count = 1;
}
+// We need to readd the local announcements to the forums total topic count, otherwise the number is different from the one on the forum list
+$total_topic_count = $topics_count + sizeof($announcement_list) - sizeof($global_announce_list);
+
$template->assign_vars(array(
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '')), $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)))
+ 'TOTAL_TOPICS' => ($s_display_active) ? false : (($total_topic_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_topic_count)))
);
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 203b8586ce..df631a474c 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -493,9 +493,10 @@ $s_watching_topic = array(
'is_watching' => false,
);
-if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered'])
+if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'])
{
- watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start, $topic_data['topic_title']);
+ $notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null;
+ watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']);
// Reset forum notification if forum notify is set
if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id))
diff --git a/tests/dbal/cross_join_test.php b/tests/dbal/cross_join_test.php
new file mode 100644
index 0000000000..7110c7a2ea
--- /dev/null
+++ b/tests/dbal/cross_join_test.php
@@ -0,0 +1,55 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
+
+class phpbb_dbal_cross_join_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/massmail_crossjoin.xml');
+ }
+
+ public function test_cross_join()
+ {
+ $db = $this->new_dbal();
+
+ // http://tracker.phpbb.com/browse/PHPBB3-10296
+ // Test CROSS JOIN with INNER JOIN
+ // Failed on Postgres, MSSQL and Oracle
+ $db->sql_return_on_error(true);
+
+ $sql_ary = array(
+ 'SELECT' => 'u.username',
+ 'FROM' => array(
+ 'phpbb_users' => 'u',
+ 'phpbb_user_group' => 'ug',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(
+ 'phpbb_banlist' => 'b',
+ ),
+ 'ON' => 'u.user_id = b.ban_userid',
+ ),
+ ),
+ 'WHERE' => 'ug.group_id = 1
+ AND u.user_id = ug.user_id
+ AND b.ban_id IS NULL',
+ 'ORDER_BY' => 'u.username',
+ );
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
+ $result = $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ $this->assertEquals(array(array('username' => 'mass email')), $db->sql_fetchrowset($result));
+ }
+}
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 753cc08fc5..c0c66b5be7 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -234,6 +234,14 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertEquals($row2, $row_actual);
}
+ public function test_list_columns()
+ {
+ $this->assertEquals(
+ array_keys($this->table_data['COLUMNS']),
+ array_values($this->tools->sql_list_columns('prefix_table_name'))
+ );
+ }
+
public function test_column_exists()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@@ -258,6 +266,13 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
}
+ public function test_list_tables()
+ {
+ $tables = $this->tools->sql_list_tables();
+ $this->assertTrue(isset($tables['prefix_table_name']));
+ $this->assertFalse(isset($tables['prefix_does_not_exist']));
+ }
+
public function test_table_exists()
{
$this->assertTrue($this->tools->sql_table_exists('prefix_table_name'));
@@ -333,4 +348,15 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
),
));
}
+
+ public function test_index_exists()
+ {
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_simple'));
+ }
+
+ public function test_create_index_against_index_exists()
+ {
+ $this->tools->sql_create_index('prefix_table_name', 'fookey', array('c_timestamp', 'c_decimal'));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'fookey'));
+ }
}
diff --git a/tests/dbal/fixtures/massmail_crossjoin.xml b/tests/dbal/fixtures/massmail_crossjoin.xml
new file mode 100644
index 0000000000..ef0a2b7149
--- /dev/null
+++ b/tests/dbal/fixtures/massmail_crossjoin.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_banlist">
+ <column>ban_id</column>
+ <column>ban_userid</column>
+ <row>
+ <value>1</value>
+ <value>2</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
+ <row>
+ <value>1</value>
+ <value>mass email</value>
+ <value>mass email</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>banned</value>
+ <value>banned</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>not in group</value>
+ <value>not in group</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+ <table name="phpbb_user_group">
+ <column>user_id</column>
+ <column>group_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/dbal/fixtures/three_users.xml b/tests/dbal/fixtures/three_users.xml
index a6789f4a01..a50e3e8634 100644
--- a/tests/dbal/fixtures/three_users.xml
+++ b/tests/dbal/fixtures/three_users.xml
@@ -3,17 +3,33 @@
<table name="phpbb_users">
<column>user_id</column>
<column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
<row>
<value>1</value>
<value>barfoo</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>foobar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>bertie</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index e0d08d9306..8ddd27465d 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -319,7 +319,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$db->sql_freeresult($result);
}
- function test_nested_transactions()
+ public function test_nested_transactions()
{
$db = $this->new_dbal();
@@ -341,4 +341,20 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
$this->assertEquals('1', $row['user_id']);
}
+
+ /**
+ * fix for PHPBB3-10307
+ */
+ public function test_sql_fetchrow_returns_false_when_empty()
+ {
+ $db = $this->new_dbal();
+
+ $sql = 'SELECT * FROM (SELECT 1) AS TBL WHERE 1 = 0';
+ $result = $db->sql_query($sql);
+
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $this->assertSame(false, $row);
+ }
}
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php
new file mode 100644
index 0000000000..e1ac32f5ac
--- /dev/null
+++ b/tests/error_collector_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../phpBB/includes/error_collector.php';
+
+class phpbb_error_collector_test extends phpbb_test_case
+{
+ public function test_collection()
+ {
+ $collector = new phpbb_error_collector;
+ $collector->install();
+
+ // Cause a warning
+ 1/0; $line = __LINE__;
+
+ $collector->uninstall();
+
+ list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];
+ $error_contents = $collector->format_errors();
+
+ $this->assertEquals($errno, 2);
+
+ // Unfortunately $error_contents will contain the full path here,
+ // because the tests directory is outside of phpbb root path.
+ $this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
+ $this->assertStringEndsWith(" line $line", $error_contents);
+ }
+}
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 11e525ff79..020574b0bb 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -41,6 +41,28 @@ class phpbb_mock_cache
{
return $this->data['_bots'];
}
+
+ /**
+ * Obtain list of word censors. We don't need to parse them here,
+ * that is tested elsewhere.
+ */
+ public function obtain_word_list()
+ {
+ return array(
+ 'match' => array(
+ '#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword1[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
+ '#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword2)(?![\\p{Nd}\\p{L}_-])#iu',
+ '#(?<![\\p{Nd}\\p{L}_-])(badword3[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
+ '#(?<![\\p{Nd}\\p{L}_-])(badword4)(?![\\p{Nd}\\p{L}_-])#iu',
+ ),
+ 'replace' => array(
+ 'replacement1',
+ 'replacement2',
+ 'replacement3',
+ 'replacement4',
+ ),
+ );
+ }
public function set_bots($bots)
{
diff --git a/tests/mock_user.php b/tests/mock_user.php
index 74d31c4c4a..5b89ea3e19 100644
--- a/tests/mock_user.php
+++ b/tests/mock_user.php
@@ -17,4 +17,20 @@ class phpbb_mock_user
{
public $host = "testhost";
public $page = array('root_script_path' => '/');
+
+ private $options = array();
+ public function optionget($item)
+ {
+ if (!isset($this->options[$item]))
+ {
+ throw new Exception(sprintf("You didn't set the option '%s' on the mock user using optionset.", $item));
+ }
+
+ return $this->options[$item];
+ }
+
+ public function optionset($item, $value)
+ {
+ $this->options[$item] = $value;
+ }
}
diff --git a/tests/profile/custom_test.php b/tests/profile/custom_test.php
index 0e0a851243..585182e583 100644
--- a/tests/profile/custom_test.php
+++ b/tests/profile/custom_test.php
@@ -48,7 +48,7 @@ class phpbb_profile_custom_test extends phpbb_database_test_case
);
$cp = new custom_profile;
- $result = $cp->validate_profile_field(FIELD_DROPDOWN, &$field_value, $field_data);
+ $result = $cp->validate_profile_field(FIELD_DROPDOWN, $field_value, $field_data);
$this->assertEquals($expected, $result, $description);
}
diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php
new file mode 100644
index 0000000000..67a18b4fbc
--- /dev/null
+++ b/tests/regex/table_prefix_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_regex_table_prefix_test extends phpbb_test_case
+{
+ public function table_prefix_test_data()
+ {
+ return array(
+ array('phpbb_', 1),
+ array('phpBB3', 1),
+ array('a', 1),
+
+ array('', 0),
+ array('_', 0),
+ array('a-', 0),
+ array("'", 0),
+ );
+ }
+
+ /**
+ * @dataProvider table_prefix_test_data
+ */
+ public function test_table_prefix($prefix, $expected)
+ {
+ $this->assertEquals($expected, preg_match(get_preg_expression('table_prefix'), $prefix));
+ }
+}
diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php
new file mode 100644
index 0000000000..1a3ad633e3
--- /dev/null
+++ b/tests/session/append_sid_test.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_session_append_sid_test extends phpbb_test_case
+{
+
+ public function append_sid_data()
+ {
+ return array(
+ array('viewtopic.php?t=1&amp;f=2', false, true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in url-argument'),
+ array('viewtopic.php', 't=1&amp;f=2', true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument using amp'),
+ array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument as array'),
+
+ // Custom sid parameter
+ array('viewtopic.php', 't=1&amp;f=2', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
+
+ // Testing anchors
+ array('viewtopic.php?t=1&amp;f=2#anchor', false, true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in url-argument'),
+ array('viewtopic.php', 't=1&amp;f=2#anchor', true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+
+ // Anchors and custom sid
+ array('viewtopic.php?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
+ array('viewtopic.php', 't=1&amp;f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
+ array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+
+ // Empty parameters should not append the ?
+ array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'),
+ array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'),
+ array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'),
+ );
+ }
+
+ /**
+ * @dataProvider append_sid_data
+ */
+ public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
+ {
+ $this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
+ }
+}
+
diff --git a/tests/session/fixtures/sessions_empty.xml b/tests/session/fixtures/sessions_empty.xml
index f94337314e..0e6ddccd88 100644
--- a/tests/session/fixtures/sessions_empty.xml
+++ b/tests/session/fixtures/sessions_empty.xml
@@ -3,17 +3,33 @@
<table name="phpbb_users">
<column>user_id</column>
<column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_full.xml b/tests/session/fixtures/sessions_full.xml
index bf6fc65997..509687f4d2 100644
--- a/tests/session/fixtures/sessions_full.xml
+++ b/tests/session/fixtures/sessions_full.xml
@@ -3,17 +3,33 @@
<table name="phpbb_users">
<column>user_id</column>
<column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <column>user_occ</column>
+ <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 33c82d53ad..5005710220 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -63,9 +63,10 @@ class phpbb_template_template_test extends phpbb_test_case
// Test the engine can be used
$this->setup_engine();
- if (!is_writable(dirname($this->template->cachepath)))
+ $template_cache_dir = dirname($this->template->cachepath);
+ if (!is_writable($template_cache_dir))
{
- $this->markTestSkipped("Template cache directory is not writable.");
+ $this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable.");
}
foreach (glob($this->template->cachepath . '*') as $file)
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 770cc84d7e..7a45d87583 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -71,6 +71,11 @@ class phpbb_database_test_connection_manager
default:
$dsn .= 'host=' . $this->config['dbhost'];
+ if ($this->config['dbport'])
+ {
+ $dsn .= ';port=' . $this->config['dbport'];
+ }
+
if ($use_db)
{
$dsn .= ';dbname=' . $this->config['dbname'];
diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php
new file mode 100644
index 0000000000..2843f0b20b
--- /dev/null
+++ b/tests/text_processing/censor_text_test.php
@@ -0,0 +1,85 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+require_once dirname(__FILE__) . '/../mock_user.php';
+require_once dirname(__FILE__) . '/../mock/cache.php';
+
+class phpbb_text_processing_censor_text_test extends phpbb_test_case
+{
+ public function censor_text_data()
+ {
+ global $cache, $user;
+ $cache = new phpbb_mock_cache;
+ $user = new phpbb_mock_user;
+
+ $user->optionset('viewcensors', false);
+
+ return array(
+ array('', ''),
+
+ array('badword1', 'replacement1'),
+ array(' badword1', ' replacement1'),
+ array('badword1 ', 'replacement1 '),
+ array(' badword1 ', ' replacement1 '),
+ array('abadword1', 'replacement1'),
+ array('badword1w', 'replacement1'),
+ array('abadword1w', 'replacement1'),
+ array('anotherbadword1test', 'replacement1'),
+ array('this badword1', 'this replacement1'),
+ array('this badword1 word', 'this replacement1 word'),
+
+ array('badword2', 'replacement2'),
+ array('bbadword2', 'replacement2'),
+ array('bbbadword2', 'replacement2'),
+ array('badword2d', 'badword2d'),
+ array('bbadword2d', 'bbadword2d'),
+ array('test badword2', 'test replacement2'),
+ array('test badword2 word', 'test replacement2 word'),
+
+ array('badword3', 'replacement3'),
+ array('bbadword3', 'bbadword3'),
+ array('badword3d', 'replacement3'),
+ array('badword3ddd', 'replacement3'),
+ array('bbadword3d', 'bbadword3d'),
+ array(' badword3 ', ' replacement3 '),
+ array(' badword3', ' replacement3'),
+
+ array('badword4', 'replacement4'),
+ array('this badword4 word', 'this replacement4 word'),
+ array('abadword4', 'abadword4'),
+ array('badword4d', 'badword4d'),
+ array('abadword4d', 'abadword4d'),
+
+ array('badword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'),
+ array('badword1 badword2 badword3 badword4d', 'replacement1 replacement2 replacement3 badword4d'),
+ array('abadword1 badword2 badword3 badword4', 'replacement1 replacement2 replacement3 replacement4'),
+
+ array("new\nline\ntest", "new\nline\ntest"),
+ array("tab\ttest\t", "tab\ttest\t"),
+ array('öäü', 'öäü'),
+ array('badw' . chr(1) . 'ord1', 'badw' . chr(1) . 'ord1'),
+ array('badw' . chr(2) . 'ord1', 'badw' . chr(2) . 'ord1'),
+ array('badw' . chr(3) . 'ord1', 'badw' . chr(3) . 'ord1'),
+ array('badw' . chr(4) . 'ord1', 'badw' . chr(4) . 'ord1'),
+ array('badw' . chr(5) . 'ord1', 'badw' . chr(5) . 'ord1'),
+ array('badw' . chr(6) . 'ord1', 'badw' . chr(6) . 'ord1'),
+ );
+ }
+
+ /**
+ * @dataProvider censor_text_data
+ */
+ public function test_censor_text($input, $expected)
+ {
+ $label = 'Testing word censor: ' . $input;
+ $this->assertEquals($expected, censor_text($input), $label);
+ }
+}
diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php
index a0ba470416..1dc69e283e 100644
--- a/tests/utf/normalizer_test.php
+++ b/tests/utf/normalizer_test.php
@@ -102,7 +102,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case
foreach ($tests as $test)
{
$utf_result = $utf_expected;
- call_user_func(array('utf_normalizer', $form), &$utf_result);
+ call_user_func_array(array('utf_normalizer', $form), array(&$utf_result));
$hex_result = $this->utf_to_hexseq($utf_result);
$this->assertEquals($utf_expected, $utf_result, "$expected == $form($test) ($hex_expected != $hex_result)");
@@ -154,7 +154,7 @@ class phpbb_utf_normalizer_test extends phpbb_test_case
foreach (array('nfc', 'nfkc', 'nfd', 'nfkd') as $form)
{
$utf_result = $utf_expected;
- call_user_func(array('utf_normalizer', $form), &$utf_result);
+ call_user_func_array(array('utf_normalizer', $form), array(&$utf_result));
$hex_result = $this->utf_to_hexseq($utf_result);
$this->assertEquals($utf_expected, $utf_result, "$hex_expected == $form($hex_tested) ($hex_expected != $hex_result)");