aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/acp_main.html30
-rw-r--r--phpBB/adm/style/acp_users.html2
-rw-r--r--phpBB/develop/create_schema_files.php41
-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.php2
-rw-r--r--phpBB/includes/acp/acp_email.php5
-rw-r--r--phpBB/includes/acp/acp_forums.php10
-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.php2
-rw-r--r--phpBB/includes/auth/auth_db.php11
-rw-r--r--phpBB/includes/db/db_tools.php175
-rw-r--r--phpBB/includes/db/mysqli.php8
-rw-r--r--phpBB/includes/functions.php8
-rw-r--r--phpBB/includes/functions_admin.php13
-rw-r--r--phpBB/includes/functions_display.php24
-rw-r--r--phpBB/includes/functions_install.php57
-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_topic.php4
-rw-r--r--phpBB/includes/startup.php4
-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.php12
-rw-r--r--phpBB/install/database_update.php5
-rw-r--r--phpBB/install/install_install.php7
-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.sql1
-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/forums.php2
-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.php2
-rw-r--r--phpBB/language/en/ucp.php3
-rw-r--r--phpBB/styles/prosilver/template/message_body.html12
-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/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.css4
-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/tweaks.css2
-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/ucp.php6
-rw-r--r--phpBB/viewforum.php13
-rw-r--r--phpBB/viewtopic.php5
-rw-r--r--tests/dbal/db_tools_test.php26
-rw-r--r--tests/dbal/select_test.php18
-rw-r--r--tests/regex/table_prefix_test.php35
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php5
73 files changed, 604 insertions, 492 deletions
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/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/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..3ed5f40368 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' => ' %'),
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 133fe47e09..e98b7a19a5 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'];
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_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..abf1481000 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -818,7 +818,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/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 10ca6c0a1f..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]);
}
/**
@@ -2092,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':
@@ -2145,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/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/functions.php b/phpBB/includes/functions.php
index c2b099d48a..817111491f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2127,7 +2127,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 +2138,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
{
@@ -3486,6 +3486,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 '';
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index f7e19f3e7d..513b7a68b2 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -3130,7 +3130,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;
@@ -3140,6 +3140,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;
@@ -3162,6 +3165,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 992e8d6bb0..2c640e0999 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -211,61 +211,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_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_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_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..65b32bd0c4 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'))
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a167e79308..21246a215e 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1994,6 +1994,11 @@ 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':
+ set_config('email_max_chunk_size', '50');
+ break;
}
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 9fe0c8aed5..ccdcf211f1 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']);
@@ -2032,7 +2037,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..84b25d676e 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');
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/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/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..f038177df4 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -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 an alphanumeric character and must only contain alphanumeric characters, 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 an alphanumeric character and must only contain alphanumeric characters, 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/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/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/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..c278a16dc5 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 {
@@ -184,7 +184,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/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/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/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/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/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/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/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index a7559e2183..68e09add94 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -69,6 +69,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'];