Merge branch 'prep-release-3.0.10'

* prep-release-3.0.10: (221 commits)
  [prep-release-3.0.10] Bumping version number for 3.0.10 final.
  [prep-release-3.0.10] Update Changelog for 3.0.10-RC3 release.
  [ticket/10531] Disallow deleting of the last style
  [ticket/8996] Revert initial fix to keep old behaviour on empty selection Part2
  [ticket/8996] Revert initial fix to keep old behaviour on empty selection
  [ticket/10319] Missing hidden fields in search form
  [ticket/10504] Revert the changes for widescreen optimisation PHPBB3-6632
  [ticket/10504] Revert the changes for widescreen optimisation PHPBB3-10408
  [ticket/10504] Revert the changes for widescreen optimisation PHPBB3-10485
  [prep-release-3.0.10] Bumping version number for 3.0.10-RC3.
  [ticket/10480] Add a build target for changelog building.
  [ticket/10480] Add a build script for exporting the changelog from tracker.
  [ticket/10502] Fix typo in changelog. 'red' should have been 'read'.
  [prep-release-3.0.10] Remove duplicate ticket PHPBB3-10490 from changelog.
  [ticket/10501] Fix description of table prefixes
  [ticket/10503] Debug error "Invalid arguments" when previewing edits
  [prep-release-3.0.10] Update Changelog for 3.0.10-RC2 release.
  [ticket/10497] Fix SQL error when guest visits forum with unread topic
  [prep-release-3.0.10] Bumping version number for 3.0.10-RC2.
  [ticket/10461] Add a comment explaining the logic here.
  ...
This commit is contained in:
Andreas Fischer 2012-01-02 18:53:55 +01:00
commit 2345be38b6
157 changed files with 2285 additions and 3145 deletions

22
.gitignore vendored
View file

@ -1,12 +1,12 @@
*~
phpunit.xml
phpBB/cache/*.php
phpBB/cache/queue.php.lock
phpBB/config.php
phpBB/files/*
phpBB/images/avatars/gallery/*
phpBB/images/avatars/upload/*
phpBB/store/*
tests/phpbb_unit_tests.sqlite2
tests/test_config.php
tests/utf/data/*.txt
/phpunit.xml
/phpBB/cache/*.php
/phpBB/cache/queue.php.lock
/phpBB/config.php
/phpBB/files/*
/phpBB/images/avatars/gallery/*
/phpBB/images/avatars/upload/*
/phpBB/store/*
/tests/phpbb_unit_tests.sqlite2
/tests/test_config.php
/tests/tmp/*

View file

@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
<property name="newversion" value="3.0.9" />
<property name="prevversion" value="3.0.8" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.9-RC1, 3.0.9-RC2, 3.0.9-RC3, 3.0.9-RC4" />
<property name="newversion" value="3.0.10" />
<property name="prevversion" value="3.0.9" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.10-RC1, 3.0.10-RC2, 3.0.10-RC3" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@ -49,19 +49,16 @@
--coverage-clover build/logs/clover.xml
--coverage-html build/coverage"
passthru="true" />
</target>
<!-- Does not allow changing the working directory to tests/
so this approach does not work for us unfortunately
<phpunit codecoverage="true" haltonfailure="true">
<formatter todir="build/logs" type="xml"/>
<batchtest>
<fileset dir="tests">
<include name="all_tests.php"/>
</fileset>
</batchtest>
</phpunit>
-->
<target name="test-slow" depends="clean,prepare">
<exec dir="."
command="phpunit --log-junit build/logs/phpunit.xml
--configuration phpunit.xml.all
--group slow
--coverage-clover build/logs/clover-slow.xml
--coverage-html build/coverage-slow"
passthru="true" />
</target>
<target name="docs">
@ -122,6 +119,29 @@
<target name="create-package" depends="prepare-new-version,old-version-diffs">
<exec dir="build" command="php -f package.php '${versions}' > logs/package.log" escape="false" />
<exec dir="build" command="php -f build_diff.php '${prevversion}' '${newversion}' > logs/build_diff.log" escape="false" />
<exec dir="build" escape="false"
command="diff -crNEBwd old_versions/release-${prevversion}/language new_version/phpBB3/language >
save/save_${prevversion}_to_${newversion}/language/phpbb-${prevversion}_to_${newversion}_language.patch" />
<exec dir="build" escape="false"
command="diff -crNEBwd old_versions/release-${prevversion}/styles/prosilver new_version/phpBB3/styles/prosilver >
save/save_${prevversion}_to_${newversion}/prosilver/phpbb-${prevversion}_to_${newversion}_prosilver.patch" />
<exec dir="build" escape="false"
command="diff -crNEBwd old_versions/release-${prevversion}/styles/subsilver2 new_version/phpBB3/styles/subsilver2 >
save/save_${prevversion}_to_${newversion}/subsilver2/phpbb-${prevversion}_to_${newversion}_subsilver2.patch" />
<exec dir="build" escape="false"
command="git shortlog --summary --numbered release-${prevversion}...HEAD >
save/save_${prevversion}_to_${newversion}/phpbb-${prevversion}_to_${newversion}_git_shortlog.txt" />
<exec dir="build" escape="false"
command="git diff --stat release-${prevversion}...HEAD >
save/save_${prevversion}_to_${newversion}/phpbb-${prevversion}_to_${newversion}_git_diffstat.txt" />
</target>
<target name="changelog" depends="prepare">
<exec dir="build" escape="false"
command="php -f build_changelog.php '${newversion}' >
save/changelog_${newversion}.html" />
</target>
<!--

53
build/build_changelog.php Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
/**
*
* @package build
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
*
*/
if ($_SERVER['argc'] != 2)
{
echo "Please specify the new version as argument (e.g. build_changelog.php '1.0.2').\n";
exit(1);
}
$fixVersion = $_SERVER['argv'][1];
$query = 'project = PHPBB3
AND resolution = Fixed
AND fixVersion = "' . $fixVersion . '"
AND status IN ("Unverified Fix", Closed)';
$url = 'http://tracker.phpbb.com/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=' . urlencode($query) . '&tempMax=1000';
$xml = simplexml_load_string(file_get_contents($url));
foreach ($xml->xpath('//item') as $item)
{
$key = (string) $item->key;
$keyUrl = 'http://tracker.phpbb.com/browse/' . $key;
$keyLink = '<a href="' . $keyUrl . '">' . $key . '</a>';
$value = str_replace($key, $keyLink, htmlspecialchars($item->title));
$value = str_replace(']', '] -', $value);
$types[(string) $item->type][$key] = $value;
}
ksort($types);
foreach ($types as $type => $tickets)
{
echo "<h4>$type</h4>\n";
echo "<ul>\n";
uksort($tickets, 'strnatcasecmp');
foreach ($tickets as $ticket)
{
echo "<li>$ticket</li>\n";
}
echo "</ul>\n";
}

View file

@ -74,7 +74,7 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
<table cellspacing="1">
<table cellspacing="1" id="smilies">
<thead>
<tr>
<th colspan="{COLSPAN}">{L_CONFIG}</th>
@ -94,7 +94,7 @@
<td>{L_ORDER}</td>
<!-- ENDIF -->
<!-- IF S_ADD -->
<td>{L_ADD}</td>
<td>{L_ADD} <a href="#" onclick="marklist('smilies', 'add_img', true); return false;">({L_MARK_ALL})</a></td>
<!-- ENDIF -->
</tr>
</thead>

View file

@ -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>

View file

@ -35,7 +35,7 @@
</dl>
<dl>
<dt><label for="special_rank">{L_RANK_SPECIAL}:</label></dt>
<dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> />{L_YES}</label>
<dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input onclick="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<!-- IF S_SPECIAL_RANK --><div id="posts" style="display: none;"><!-- ELSE --><div id="posts"><!-- ENDIF -->

View file

@ -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>

View file

@ -22,9 +22,8 @@
w: '{LA_BBCODE_W_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
y: '{LA_BBCODE_Y_HELP}',
d: '{LA_BBCODE_D_HELP}',
t: '{LA_BBCODE_T_HELP}',
tip: '{L_STYLES_TIP}'
<!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
@ -56,7 +55,7 @@
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="y" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('y')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF -->

View file

@ -899,12 +899,15 @@ html>body dd label input { vertical-align: text-bottom;} /* Tweak for Moz to ali
dd input {
font-size: 1.00em;
max-width: 100%;
margin: 2px 0;
}
dd select {
font-size: 100%;
font-size: 1em;
width: auto;
max-width: 100%;
margin: 2px 0;
}
dd textarea {
@ -912,11 +915,6 @@ dd textarea {
width: 90%;
}
dd select {
width: auto;
font-size: 1.00em;
}
fieldset dl {
margin-bottom: 10px;
font-size: 0.85em;

View file

@ -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;

View file

@ -53,6 +53,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#v309">Changes since 3.0.9</a></li>
<li><a href="#v308">Changes since 3.0.8</a></li>
<li><a href="#v307-PL1">Changes since 3.0.7-PL1</a></li>
<li><a href="#v307">Changes since 3.0.7</a></li>
@ -90,7 +91,143 @@
<div class="content">
<a name="v308"></a><h3>1.i. Changes since 3.0.8</h3>
<a name="v309"></a><h3>1.i. Changes since 3.0.9</h3>
<h4>Bug</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-5506">PHPBB3-5506</a>] - Deleting all items from last page results in empty list display</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6458">PHPBB3-6458</a>] - Width of Topics and Posts columns in Board Index is causing problems with language packs</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7138">PHPBB3-7138</a>] - Cannot display simple header/footer with trigger_error()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7291">PHPBB3-7291</a>] - Broken links of char selection in memberlist</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-7932">PHPBB3-7932</a>] - Fix font size in select boxes</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8094">PHPBB3-8094</a>] - Text in the forums.php and install.php not matching</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8173">PHPBB3-8173</a>] - Redundant BBCode helpline in JS</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8177">PHPBB3-8177</a>] - February 29th birthdays not shown in non-leap year</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8571">PHPBB3-8571</a>] - Users can make their age a negative number on memberlist</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8691">PHPBB3-8691</a>] - Error creating log_time index</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8937">PHPBB3-8937</a>] - Code tags - single space indent</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9008">PHPBB3-9008</a>] - Incorrect unread topic tracking for unapproved topics</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9066">PHPBB3-9066</a>] - Invalid Prefix Names Allowed</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9416">PHPBB3-9416</a>] - HTML entities in poll titles and options incorrectly re-encoded</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9525">PHPBB3-9525</a>] - Minimum characters per post/message should never be '0'</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9645">PHPBB3-9645</a>] - XHTML error on phpinfo page in ACP</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9776">PHPBB3-9776</a>] - When deleting and recreating a poll, old options aren't deleted and reappear with the new ones</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9956">PHPBB3-9956</a>] - No error message displayed when disapprove reason is invalid or empty</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9976">PHPBB3-9976</a>] - Direct post links open the wrong page of viewtopic when multiple posts are posted in the same second</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9978">PHPBB3-9978</a>] - Missing semicolons in // &lt;![CDATA[ part of overall_header.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10087">PHPBB3-10087</a>] - Limited browser support for ban exclusion emphasis</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10157">PHPBB3-10157</a>] - Missing error handling when a custom profile field is not defined for current language</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10166">PHPBB3-10166</a>] - Post-admin activation email confusingly refers to username</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10187">PHPBB3-10187</a>] - XHTML error in ucp_groups_manage.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10190">PHPBB3-10190</a>] - Misleading information about permissions displayed after editing forum settings</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10212">PHPBB3-10212</a>] - Captcha not displayed when username not exists</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10216">PHPBB3-10216</a>] - Updater's failed query language grammatically incorrect</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10226">PHPBB3-10226</a>] - Mysqli dbal extension does not allow connection via pipes</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10227">PHPBB3-10227</a>] - Mysqli dbal extension does not allow persistent connection for PHP &gt;= 5.3.0</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10237">PHPBB3-10237</a>] - Unwatching a forum/topic does not check for correct hash parameter</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10240">PHPBB3-10240</a>] - Word filter evasion</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10253">PHPBB3-10253</a>] - IE9 Quote problem</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10255">PHPBB3-10255</a>] - gitignore ignores too much</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10257">PHPBB3-10257</a>] - AAAA record parsing fails on older versions of Windows</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10259">PHPBB3-10259</a>] - Incorrect email on joining Open group</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10265">PHPBB3-10265</a>] - Unit test tests/random/mt_rand.php is not run because of missing _test suffix.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10266">PHPBB3-10266</a>] - Poor navigation links after reporting a post</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10267">PHPBB3-10267</a>] - Missing strlen() on $table_prefix in db tools index name length check</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10274">PHPBB3-10274</a>] - Hardcoded module ID in &quot;Re-check version&quot; link on ACP front page</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10275">PHPBB3-10275</a>] - Wrong information about sent passwords in FAQ</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10292">PHPBB3-10292</a>] - Whitespace inconsistency in acp_ranks</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10293">PHPBB3-10293</a>] - Jumpbox allows jumping to invalid forums in prosilver</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10294">PHPBB3-10294</a>] - sqlsrv_rows_affected non-functional in MSSQLNative.php</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10296">PHPBB3-10296</a>] - incorrect cross join in SQL Server</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10298">PHPBB3-10298</a>] - EMBED Tag Not Closed Properly In subSilver2 attachment.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10299">PHPBB3-10299</a>] - Typo in comment about $max_store_length in truncate_string() (in functions_content.php)</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10303">PHPBB3-10303</a>] - send_status_line() doesn't validate user input</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10304">PHPBB3-10304</a>] - Bad url in U_ICQ on /ucp_mp_viewmessage.php</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10307">PHPBB3-10307</a>] - Return value of $db-&gt;sql_fetchrow() on empty tables is not consistent</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10309">PHPBB3-10309</a>] - Utf tests download data into temporary locations deep in source tree</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10320">PHPBB3-10320</a>] - &quot;Most active topic&quot; can leak topic title of topics in password-protected forums</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10321">PHPBB3-10321</a>] - Link to page 1 of the Memberlist has a useless question mark at the end</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10324">PHPBB3-10324</a>] - XHTML error in Prosilver - MCP - User Notes</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10339">PHPBB3-10339</a>] - Typo in prosilver's mcp_front.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10341">PHPBB3-10341</a>] - Topic title of &quot;0&quot; does not show as &quot;Most active topic&quot;</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10351">PHPBB3-10351</a>] - Invalid syntax for Oracle's sql_column_remove()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10352">PHPBB3-10352</a>] - Missing break for Oracle's sql_table_drop()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10365">PHPBB3-10365</a>] - Moderators can view forbidden information</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10377">PHPBB3-10377</a>] - All moderators can change topic type</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10394">PHPBB3-10394</a>] - Tests use call-time pass by reference which results in Fatal error on PHP 5.4</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10397">PHPBB3-10397</a>] - Pagination code inconsistency </li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10400">PHPBB3-10400</a>] - '0' (zero) not allowed as forum name</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10413">PHPBB3-10413</a>] - Make create_schema_files usable</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10416">PHPBB3-10416</a>] - Use dbport in phpbb_database_test_connection_manager::connect()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10420">PHPBB3-10420</a>] - Update startup to account for PHP 5.4</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10421">PHPBB3-10421</a>] - Interchanged parameters in includes/acp/acp_users.php</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10422">PHPBB3-10422</a>] - Unnecessary &lt;!-- IF --&gt; statement in viewtopic_body.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10435">PHPBB3-10435</a>] - Topic count mismatch on viewforum</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10437">PHPBB3-10437</a>] - Announcements on moderation queue are not hidden</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10446">PHPBB3-10446</a>] - Unencoded 8bit characters in email headers</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10452">PHPBB3-10452</a>] - XHTML error when printing a PM</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10461">PHPBB3-10461</a>] - MCP's recent actions list is empty</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10479">PHPBB3-10479</a>] - Remove PostgreSQL version numbers from driver's language string</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10485">PHPBB3-10485</a>] - XHTML error in Prosilver - index and viewforum</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10488">PHPBB3-10488</a>] - Database updater for 3.0.10-RC1 overwrites config variable email_max_chunk_size without checking for custom value</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10497">PHPBB3-10497</a>] - SQL error when guest visits forum with unread topic</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10319">PHPBB3-10319</a>] - Missing hidden fields in search form</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10501">PHPBB3-10501</a>] - Description of table prefix is wrong</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10502">PHPBB3-10502</a>] - CHANGELOG.html has a typo: 'red' should be 'read'.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10503">PHPBB3-10503</a>] - Debug error when previewing edits</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10504">PHPBB3-10504</a>] - MCP Layout STILL broken in ProSilver when screen is resized to less 1200 pixels</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10531">PHPBB3-10531</a>] - Last remaining style can be uninstalled</li>
</ul>
<h4>Improvement</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8616">PHPBB3-8616</a>] - Add direct link to PM to notification message</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9036">PHPBB3-9036</a>] - Forums that can be listed but not read expose forum information</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9297">PHPBB3-9297</a>] - Add support for Extended Passive Mode (EPSV) in class ftp_fsock to better support IPv6 connections.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9307">PHPBB3-9307</a>] - Mass email $max_chunk_size</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9361">PHPBB3-9361</a>] - Edit account settings - Improved clarification needed</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9778">PHPBB3-9778</a>] - Member Search from the Admin Control Panel is not Intuitive</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9898">PHPBB3-9898</a>] - Readme needs updating to reflect more opening for patches</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9995">PHPBB3-9995</a>] - Unnecessary coding in display_forums() in functions_display.php</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10032">PHPBB3-10032</a>] - BBCode Add List Item Control Name Contains Typo</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10074">PHPBB3-10074</a>] - Change default value of 'Set as special rank' to No for Add new rank</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10185">PHPBB3-10185</a>] - Board startdate not being set</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10189">PHPBB3-10189</a>] - Add &quot;automatically generated&quot; comment into schema-files.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10199">PHPBB3-10199</a>] - Performance: viewtopic has a useless join</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10222">PHPBB3-10222</a>] - Also build language and styles changes in diff/patch format</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10239">PHPBB3-10239</a>] - Add &quot;Are you sure&quot; confirmation to backup restore in ACP</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10243">PHPBB3-10243</a>] - Add gmgetdate() wrapper for getdate() which returns dates in UTC.</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10245">PHPBB3-10245</a>] - Messenger uses output buffering for error collection, should use error collector instead</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10246">PHPBB3-10246</a>] - Remove VCS section from docs/coding-guidelines.html</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10254">PHPBB3-10254</a>] - Remove style names from themes and fix some information on it</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10263">PHPBB3-10263</a>] - Add phpbb_version_compare() wrapper for version_compare()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10278">PHPBB3-10278</a>] - Improve timeout handling in get_remote_file()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10315">PHPBB3-10315</a>] - Radio Buttons in ACP are clipped in Safari - Fix suggested</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10327">PHPBB3-10327</a>] - Use &quot;ALTER TABLE ... ADD INDEX&quot; instead of &quot;CREATE INDEX&quot;</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10334">PHPBB3-10334</a>] - Birthday List display not dependent on user privileges</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10335">PHPBB3-10335</a>] - Responses to bots should have extra header to be used by reverse proxies</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10346">PHPBB3-10346</a>] - Add drop_tables key for database updater</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10354">PHPBB3-10354</a>] - When template tests are skipped because cache is not writable, print cache directory path</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10369">PHPBB3-10369</a>] - Change error collector to always report errfile and errline</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10370">PHPBB3-10370</a>] - Various improvements for get_backtrace()</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10402">PHPBB3-10402</a>] - Displaying report texts with linebreaks and clickable links</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10419">PHPBB3-10419</a>] - Add mbstring PHP ini parameters checks to ACP</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10430">PHPBB3-10430</a>] - Some typos and the like in docs/coding-guidelines.html</li>
</ul>
<h4>New Feature</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8240">PHPBB3-8240</a>] - Request: db_tools to have two additional functions, table list and column list</li>
</ul>
<h4>Task</h4>
<ul>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9689">PHPBB3-9689</a>] - Scripts and utilities</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10003">PHPBB3-10003</a>] - Resolve db_tools proliferation</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10313">PHPBB3-10313</a>] - Include slow unit tests when running build script</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10483">PHPBB3-10483</a>] - Test suite does not run with MySQL strict mode</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10486">PHPBB3-10486</a>] - Create git shortlog and git diff --stat in build script</li>
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
</ul>
<a name="v308"></a><h3>1.ii. Changes since 3.0.8</h3>
<h4> Bug
</h4>
@ -458,7 +595,7 @@
</ul>
<a name="v307-PL1"></a><h3>1.ii. Changes since 3.0.7-PL1</h3>
<a name="v307-PL1"></a><h3>1.iii. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@ -916,13 +1053,13 @@
</ul>
<a name="v307"></a><h3>1.iii. Changes since 3.0.7</h3>
<a name="v307"></a><h3>1.iiv. Changes since 3.0.7</h3>
<ul>
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
</ul>
<a name="v306"></a><h3>1.iv. Changes since 3.0.6</h3>
<a name="v306"></a><h3>1.v. Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@ -1026,7 +1163,7 @@
</ul>
<a name="v305"></a><h3>1.v. Changes since 3.0.5</h3>
<a name="v305"></a><h3>1.vi. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@ -1248,7 +1385,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
<a name="v304"></a><h3>1.vi. Changes since 3.0.4</h3>
<a name="v304"></a><h3>1.vii. Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@ -1337,7 +1474,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
<a name="v303"></a><h3>1.vii. Changes since 3.0.3</h3>
<a name="v303"></a><h3>1.viii. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@ -1369,7 +1506,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
<a name="v302"></a><h3>1.viii. Changes since 3.0.2</h3>
<a name="v302"></a><h3>1.ix. Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@ -1468,7 +1605,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
<a name="v301"></a><h3>1.ix. Changes since 3.0.1</h3>
<a name="v301"></a><h3>1.x. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@ -1516,7 +1653,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
<a name="v300"></a><h3>1.x Changes since 3.0.0</h3>
<a name="v300"></a><h3>1.xi Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@ -1587,7 +1724,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
<a name="v30rc8"></a><h3>1.xi. Changes since 3.0.RC8</h3>
<a name="v30rc8"></a><h3>1.xii. Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@ -1596,7 +1733,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
<a name="v30rc7"></a><h3>1.xii. Changes since 3.0.RC7</h3>
<a name="v30rc7"></a><h3>1.xiii. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@ -1631,7 +1768,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
<a name="v30rc6"></a><h3>1.xiii. Changes since 3.0.RC6</h3>
<a name="v30rc6"></a><h3>1.xiv. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@ -1641,7 +1778,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
<a name="v30rc5"></a><h3>1.xiv. Changes since 3.0.RC5</h3>
<a name="v30rc5"></a><h3>1.xv. Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@ -1704,7 +1841,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
<a name="v30rc4"></a><h3>1.xv. Changes since 3.0.RC4</h3>
<a name="v30rc4"></a><h3>1.xvi. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@ -1755,7 +1892,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
<a name="v30rc3"></a><h3>1.xvi. Changes since 3.0.RC3</h3>
<a name="v30rc3"></a><h3>1.xvii. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@ -1864,7 +2001,7 @@
</ul>
<a name="v30rc2"></a><h3>1.xvii. Changes since 3.0.RC2</h3>
<a name="v30rc2"></a><h3>1.xviii. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@ -1910,7 +2047,7 @@
</ul>
<a name="v30rc1"></a><h3>1.xviii. Changes since 3.0.RC1</h3>
<a name="v30rc1"></a><h3>1.xix. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>

View file

@ -274,7 +274,7 @@
<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.8</samp> you should select the phpBB-3.0.8_to_3.0.9.zip/tar.gz file.</p>
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.9</samp> you should select the phpBB-3.0.9_to_3.0.10.zip/tar.gz file.</p>
<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
@ -286,7 +286,7 @@
<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <samp>3.0.8</samp> you need the phpBB-3.0.8_to_3.0.9.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is <samp>3.0.9</samp> you need the phpBB-3.0.9_to_3.0.10.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>

View file

@ -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>

View file

@ -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>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 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>

View file

@ -173,6 +173,12 @@ if (defined('DEBUG_EXTRA') && request_var('explain', 0) && $auth->acl_get('a_'))
header("Content-Type: application/atom+xml; charset=UTF-8");
header("Last-Modified: " . gmdate('D, d M Y H:i:s', $feed_updated_time) . ' GMT');
if (!empty($user->data['is_bot']))
{
// Let reverse proxies know we detected a bot.
header('X-PHPBB-IS-BOT: yes');
}
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="' . $global_vars['FEED_LANG'] . '">' . "\n";
echo '<link rel="self" type="application/atom+xml" href="' . $global_vars['SELF_LINK'] . '" />' . "\n\n";
@ -604,30 +610,9 @@ class phpbb_feed_base
function get_passworded_forums()
{
global $db, $user;
global $user;
// Exclude passworded forums
$sql = 'SELECT f.forum_id, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
WHERE f.forum_password <> ''";
$result = $db->sql_query($sql);
$forum_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$forum_id = (int) $row['forum_id'];
if ($row['user_id'] != $user->data['user_id'])
{
$forum_ids[$forum_id] = $forum_id;
}
}
$db->sql_freeresult($result);
return $forum_ids;
return $user->get_passworded_forums();
}
function get_item()

View file

@ -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,
));
}
}

View file

@ -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' => ' %'),

View file

@ -221,6 +221,7 @@ class acp_database
case 'submit':
$delete = request_var('delete', '');
$file = request_var('file', '');
$download = request_var('download', '');
if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
@ -247,10 +248,8 @@ class acp_database
confirm_box(false, $user->lang['DELETE_SELECTED_BACKUP'], build_hidden_fields(array('delete' => $delete, 'file' => $file)));
}
}
else
else if ($download || confirm_box(true))
{
$download = request_var('download', '');
if ($download)
{
$name = $matches[0];
@ -411,6 +410,10 @@ class acp_database
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
}
else if (!$download)
{
confirm_box(false, $user->lang['RESTORE_SELECTED_BACKUP'], build_hidden_fields(array('file' => $file)));
}
default:
$methods = array('sql');

View file

@ -136,8 +136,9 @@ class acp_email
$i = $j = 0;
// Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
$max_chunk_size = 50;
// Send with BCC
// Maximum number of bcc recipients
$max_chunk_size = (int) $config['email_max_chunk_size'];
$email_list = array();
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
@ -194,10 +195,7 @@ class acp_email
$messenger->template('admin_send_email', $used_lang);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);

View file

@ -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'];
}

View file

@ -118,10 +118,7 @@ class acp_inactive
$messenger->to($row['user_email'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']))
@ -209,10 +206,7 @@ class acp_inactive
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
@ -301,7 +295,7 @@ class acp_inactive
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start, true),
'USERS_PER_PAGE' => $per_page,
'U_ACTION' => $this->u_action . '&amp;start=' . $start,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page&amp;start=$start",
));
$this->tpl_name = 'acp_inactive';

View file

@ -919,6 +919,9 @@ class acp_language
$default_lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
// We want to notify the admin that custom profile fields need to be updated for the new language.
$notify_cpf_update = false;
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
@ -932,6 +935,7 @@ class acp_language
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
$notify_cpf_update = true;
}
$db->sql_freeresult($result);
@ -944,12 +948,15 @@ class acp_language
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
$notify_cpf_update = true;
}
$db->sql_freeresult($result);
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
$message = sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']);
$message .= ($notify_cpf_update) ? '<br /><br />' . $user->lang['LANGUAGE_PACK_CPF_UPDATE'] : '';
trigger_error($message . adm_back_link($this->u_action));
break;

View file

@ -127,12 +127,12 @@ class acp_logs
// Grab log data
$log_data = array();
$log_count = 0;
view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
$start = view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
$template->assign_vars(array(
'L_TITLE' => $l_title,
'L_EXPLAIN' => $l_title_explain,
'U_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . "&amp;$u_sort_param$keywords_param&amp;start=$start",
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),

View file

@ -415,11 +415,8 @@ class acp_main
{
$latest_version_info = explode("\n", $latest_version_info);
$latest_version = str_replace('rc', 'RC', strtolower(trim($latest_version_info[0])));
$current_version = str_replace('rc', 'RC', strtolower($config['version']));
$template->assign_vars(array(
'S_VERSION_UP_TO_DATE' => version_compare($current_version, $latest_version, '<') ? false : true,
'S_VERSION_UP_TO_DATE' => phpbb_version_compare(trim($latest_version_info[0]), $config['version'], '<='),
));
}
@ -521,7 +518,7 @@ class acp_main
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&amp;versioncheck_force=1'),
'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
@ -603,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']))
{

View file

@ -67,6 +67,9 @@ class acp_php_info
$output = preg_replace('#<img border="0"#i', '<img', $output);
$output = str_replace(array('class="e"', 'class="v"', 'class="h"', '<hr />', '<font', '</font>'), array('class="row1"', 'class="row2"', '', '', '<span', '</span>'), $output);
// Fix invalid anchor names (eg "module_Zend Optimizer")
$output = preg_replace_callback('#<a name="([^"]+)">#', array($this, 'remove_spaces'), $output);
if (empty($output))
{
trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING);
@ -79,6 +82,11 @@ class acp_php_info
$template->assign_var('PHPINFO', $output);
}
function remove_spaces($matches)
{
return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
}
}
?>

View file

@ -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)
);

View file

@ -1634,6 +1634,13 @@ parse_css_file = {PARSE_CSS_FILE}
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$s_only_component = $this->display_component_options($mode, $style_row[$mode . '_id'], $style_row);
if ($s_only_component)
{
trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($update)
{
if ($mode == 'style')
@ -1678,8 +1685,6 @@ parse_css_file = {PARSE_CSS_FILE}
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
}
$this->display_component_options($mode, $style_row[$mode . '_id'], $style_row);
$this->page_title = 'DELETE_' . $l_prefix;
$template->assign_vars(array(
@ -1765,11 +1770,14 @@ parse_css_file = {PARSE_CSS_FILE}
/**
* Display the options which can be used to replace a style/template/theme/imageset
*
* @return boolean Returns true if the component is the only component and can not be deleted.
*/
function display_component_options($component, $component_id, $style_row = false, $style_id = false)
{
global $db, $template, $user;
$is_only_component = true;
$component_in_use = array();
if ($component != 'style')
{
@ -1801,6 +1809,9 @@ parse_css_file = {PARSE_CSS_FILE}
$s_options = '';
if (($component != 'style') && empty($component_in_use))
{
// If it is not in use, there must be another component
$is_only_component = false;
$sql = "SELECT {$component}_id, {$component}_name
FROM $sql_from
WHERE {$component}_id = {$component_id}";
@ -1824,6 +1835,7 @@ parse_css_file = {PARSE_CSS_FILE}
{
if ($row[$component . '_id'] != $component_id)
{
$is_only_component = false;
$s_options .= '<option value="' . $row[$component . '_id'] . '">' . sprintf($user->lang['REPLACE_WITH_OPTION'], $row[$component . '_name']) . '</option>';
}
else if ($component != 'style')
@ -1851,6 +1863,8 @@ parse_css_file = {PARSE_CSS_FILE}
}
}
}
return $is_only_component;
}
/**

View file

@ -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)
{
@ -69,12 +69,9 @@ class acp_update
$current_version = (!empty($version_update_from)) ? $version_update_from : $config['version'];
$up_to_date_automatic = (version_compare(str_replace('rc', 'RC', strtolower($current_version)), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true;
$up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($config['version'])), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true;
$template->assign_vars(array(
'S_UP_TO_DATE' => $up_to_date,
'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
'S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='),
'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='),
'S_VERSION_CHECK' => true,
'U_ACTION' => $this->u_action,
'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),

View file

@ -348,10 +348,7 @@ class acp_users
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
@ -406,10 +403,7 @@ class acp_users
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))
@ -818,7 +812,7 @@ class acp_users
// Which updates do we need to do?
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
$update_password = ($data['new_password'] && !phpbb_check_hash($user_row['user_password'], $data['new_password'])) ? true : false;
$update_password = ($data['new_password'] && !phpbb_check_hash($data['new_password'], $user_row['user_password'])) ? true : false;
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
@ -1124,7 +1118,7 @@ class acp_users
// Grab log data
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
$start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
$template->assign_vars(array(
'S_FEEDBACK' => true,

View file

@ -349,6 +349,14 @@ class auth
/**
* Get permission listing based on user_id/options/forum_ids
*
* Be careful when using this function with permissions a_, m_, u_ and f_ !
* It may not work correctly. When a user group grants an a_* permission,
* e.g. a_foo, but the user's a_foo permission is set to "Never", then
* the user does not in fact have the a_ permission.
* But the user will still be listed as having the a_ permission.
*
* For more information see: http://tracker.phpbb.com/browse/PHPBB3-10252
*/
function acl_get_list($user_id = false, $opts = false, $forum_id = false)
{

View file

@ -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
);
}
?>
?>

View file

@ -584,6 +584,13 @@ class bbcode
$code = str_replace("\t", '&nbsp; &nbsp;', $code);
$code = str_replace(' ', '&nbsp; ', $code);
$code = str_replace(' ', ' &nbsp;', $code);
$code = str_replace("\n ", "\n&nbsp;", $code);
// keep space at the beginning
if (!empty($code) && $code[0] == ' ')
{
$code = '&nbsp;' . substr($code, 1);
}
// remove newline at the beginning
if (!empty($code) && $code[0] == "\n")

View file

@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
define('PHPBB_VERSION', '3.0.9');
define('PHPBB_VERSION', '3.0.10');
// QA-related
// define('PHPBB_QA', 1);

View file

@ -347,6 +347,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
*
@ -649,6 +709,23 @@ class phpbb_db_tools
$sqlite = true;
}
// Drop tables?
if (!empty($schema_changes['drop_tables']))
{
foreach ($schema_changes['drop_tables'] as $table)
{
// only drop table if it exists
if ($this->sql_table_exists($table))
{
$result = $this->sql_table_drop($table);
if ($this->return_statements)
{
$statements = array_merge($statements, $result);
}
}
}
}
// Add tables?
if (!empty($schema_changes['add_tables']))
{
@ -994,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
@ -1032,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
@ -1055,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)
@ -1134,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]);
}
/**
@ -1788,7 +1828,7 @@ class phpbb_db_tools
break;
case 'oracle':
$statements[] = 'ALTER TABLE ' . $table_name . ' DROP ' . $column_name;
$statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
break;
case 'postgres':
@ -1939,6 +1979,7 @@ class phpbb_db_tools
$statements[] = "DROP SEQUENCE {$row['referenced_name']}";
}
$this->db->sql_freeresult($result);
break;
case 'postgres':
// PGSQL does not "tightly" bind sequences and tables, we must guess...
@ -2059,7 +2100,7 @@ class phpbb_db_tools
$table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
{
$max_length = $table_prefix + 24;
$max_length = strlen($table_prefix) + 24;
trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
}
@ -2074,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':
@ -2096,7 +2137,7 @@ class phpbb_db_tools
$table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
{
$max_length = $table_prefix + 24;
$max_length = strlen($table_prefix) + 24;
trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
}
@ -2127,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':

View file

@ -609,7 +609,7 @@ class dbal
}
}
$sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array));
$sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array));
if (!empty($array['LEFT_JOIN']))
{

View file

@ -396,7 +396,7 @@ class dbal_mssqlnative extends dbal
*/
function sql_affectedrows()
{
return ($this->db_connect_id) ? @sqlsrv_rows_affected($this->db_connect_id) : false;
return (!empty($this->query_result)) ? @sqlsrv_rows_affected($this->query_result) : false;
}
/**

View file

@ -33,14 +33,33 @@ class dbal_mysqli extends dbal
*/
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false , $new_link = false)
{
$this->persistency = $persistency;
// Mysqli extension supports persistent connection since PHP 5.3.0
$this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false;
$this->user = $sqluser;
$this->server = $sqlserver;
// If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix
$this->server = ($this->persistency) ? 'p:' . (($sqlserver) ? $sqlserver : 'localhost') : $sqlserver;
$this->dbname = $database;
$port = (!$port) ? NULL : $port;
// Persistant connections not supported by the mysqli extension?
$this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port);
// If port is set and it is not numeric, most likely mysqli socket is set.
// Try to map it to the $socket parameter.
$socket = NULL;
if ($port)
{
if (is_numeric($port))
{
$port = (int) $port;
}
else
{
$socket = $port;
$port = NULL;
}
}
$this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket);
if ($this->db_connect_id && $this->dbname != '')
{
@ -230,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;
}
/**

View file

@ -49,13 +49,15 @@ class phpbb_error_collector
{
$text .= "<br />\n";
}
list($errno, $msg_text, $errfile, $errline) = $error;
$text .= "Errno $errno: $msg_text";
if (defined('DEBUG_EXTRA') || defined('IN_INSTALL'))
{
$text .= " at $errfile line $errline";
}
// Prevent leakage of local path to phpBB install
$errfile = phpbb_filter_root_path($errfile);
$text .= "Errno $errno: $msg_text at $errfile line $errline";
}
return $text;
}
}

View file

@ -265,6 +265,27 @@ function phpbb_mt_rand($min, $max)
return ($min > $max) ? mt_rand($max, $min) : mt_rand($min, $max);
}
/**
* Wrapper for getdate() which returns the equivalent array for UTC timestamps.
*
* @param int $time Unix timestamp (optional)
*
* @return array Returns an associative array of information related to the timestamp.
* See http://www.php.net/manual/en/function.getdate.php
*/
function phpbb_gmgetdate($time = false)
{
if ($time === false)
{
$time = time();
}
// getdate() interprets timestamps in local time.
// What follows uses the fact that getdate() and
// date('Z') balance each other out.
return getdate($time - date('Z'));
}
/**
* Return formatted string for filesizes
*
@ -598,6 +619,34 @@ function phpbb_email_hash($email)
return sprintf('%u', crc32(strtolower($email))) . strlen($email);
}
/**
* Wrapper for version_compare() that allows using uppercase A and B
* for alpha and beta releases.
*
* See http://www.php.net/manual/en/function.version-compare.php
*
* @param string $version1 First version number
* @param string $version2 Second version number
* @param string $operator Comparison operator (optional)
*
* @return mixed Boolean (true, false) if comparison operator is specified.
* Integer (-1, 0, 1) otherwise.
*/
function phpbb_version_compare($version1, $version2, $operator = null)
{
$version1 = strtolower($version1);
$version2 = strtolower($version2);
if (is_null($operator))
{
return version_compare($version1, $version2);
}
else
{
return version_compare($version1, $version2, $operator);
}
}
/**
* Global function for chmodding directories and files for internal use
*
@ -1831,7 +1880,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
*/
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
{
global $db, $tracking_topics, $user, $config;
global $db, $tracking_topics, $user, $config, $auth;
// Determine the users last forum mark time if not given.
if ($mark_time_forum === false)
@ -1854,6 +1903,10 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
}
// Handle update of unapproved topics info.
// Only update for moderators having m_approve permission for the forum.
$sql_update_unapproved = ($auth->acl_get('m_approve', $forum_id)) ? '': 'AND t.topic_approved = 1';
// Check the forum for any left unread topics.
// If there are none, we mark the forum as read.
if ($config['load_db_lastread'] && $user->data['is_registered'])
@ -1869,7 +1922,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
AND t.topic_moved_id = 0
AND t.topic_moved_id = 0 ' .
$sql_update_unapproved . '
AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
GROUP BY t.forum_id';
$result = $db->sql_query_limit($sql, 1);
@ -1889,11 +1943,12 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
}
else
{
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE forum_id = ' . $forum_id . '
AND topic_last_post_time > ' . $mark_time_forum . '
AND topic_moved_id = 0';
$sql = 'SELECT t.topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE t.forum_id = ' . $forum_id . '
AND t.topic_last_post_time > ' . $mark_time_forum . '
AND t.topic_moved_id = 0 ' .
$sql_update_unapproved;
$result = $db->sql_query($sql);
$check_forum = $tracking_topics['tf'][$forum_id];
@ -2078,7 +2133,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
$end_cnt = max(min($total_pages, $on_page + 4), 6);
$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;
$page_string .= ($start_cnt > 1) ? '<span class="page-dots"> ... </span>' : $seperator;
for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
{
@ -2089,7 +2144,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
}
}
$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
$page_string .= ($end_cnt < $total_pages) ? '<span class="page-dots"> ... </span>' : $seperator;
}
else
{
@ -2176,6 +2231,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
{
global $_SID, $_EXTRA_URL, $phpbb_hook;
if ($params === '' || (is_array($params) && empty($params)))
{
// Do not append the ? if the param-list is empty anyway.
$params = false;
}
// Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropriately.
// They could mimic most of what is within this function
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
@ -2659,12 +2720,6 @@ function send_status_line($code, $message)
{
$version = $_SERVER['SERVER_PROTOCOL'];
}
else if (!empty($_SERVER['HTTP_VERSION']))
{
// I cannot remember where I got this from.
// This code path may never be reachable in reality.
$version = $_SERVER['HTTP_VERSION'];
}
else
{
$version = 'HTTP/1.0';
@ -3338,61 +3393,44 @@ function add_log()
}
/**
* Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com)
* Return a nicely formatted backtrace.
*
* Turns the array returned by debug_backtrace() into HTML markup.
* Also filters out absolute paths to phpBB root.
*
* @return string HTML markup
*/
function get_backtrace()
{
global $phpbb_root_path;
$output = '<div style="font-family: monospace;">';
$backtrace = debug_backtrace();
$path = phpbb_realpath($phpbb_root_path);
foreach ($backtrace as $number => $trace)
// We skip the first one, because it only shows this file/function
unset($backtrace[0]);
foreach ($backtrace as $trace)
{
// We skip the first one, because it only shows this file/function
if ($number == 0)
{
continue;
}
// Strip the current directory from path
if (empty($trace['file']))
{
$trace['file'] = '';
}
else
{
$trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']);
$trace['file'] = substr($trace['file'], 1);
}
$args = array();
$trace['file'] = (empty($trace['file'])) ? '(not given by php)' : htmlspecialchars(phpbb_filter_root_path($trace['file']));
$trace['line'] = (empty($trace['line'])) ? '(not given by php)' : $trace['line'];
// If include/require/include_once is not called, do not show arguments - they may contain sensible information
if (!in_array($trace['function'], array('include', 'require', 'include_once')))
// Only show function arguments for include etc.
// Other parameters may contain sensible information
$argument = '';
if (!empty($trace['args'][0]) && in_array($trace['function'], array('include', 'require', 'include_once', 'require_once')))
{
unset($trace['args']);
}
else
{
// Path...
if (!empty($trace['args'][0]))
{
$argument = htmlspecialchars($trace['args'][0]);
$argument = str_replace(array($path, '\\'), array('', '/'), $argument);
$argument = substr($argument, 1);
$args[] = "'{$argument}'";
}
$argument = htmlspecialchars(phpbb_filter_root_path($trace['args'][0]));
}
$trace['class'] = (!isset($trace['class'])) ? '' : $trace['class'];
$trace['type'] = (!isset($trace['type'])) ? '' : $trace['type'];
$output .= '<br />';
$output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />';
$output .= '<b>FILE:</b> ' . $trace['file'] . '<br />';
$output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />';
$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />';
$output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']);
$output .= '(' . (($argument !== '') ? "'$argument'" : '') . ')<br />';
}
$output .= '</div>';
return $output;
@ -3454,6 +3492,10 @@ function get_preg_expression($mode)
$inline = ($mode == 'relative_url') ? ')' : '';
return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'table_prefix':
return '#^[a-zA-Z][a-zA-Z0-9_]*$#';
break;
}
return '';
@ -3686,10 +3728,19 @@ function phpbb_checkdnsrr($host, $type = 'MX')
{
return true;
}
break;
default:
case 'A':
case 'AAAA':
// AAAA records returned by nslookup on Windows XP/2003 have this format.
// Later Windows versions use the A record format below for AAAA records.
if (stripos($line, "$host AAAA IPv6 address") === 0)
{
return true;
}
// No break
case 'A':
if (!empty($host_matches))
{
// Second line
@ -3758,9 +3809,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false)
{
// remove complete path to installation, with the risk of changing backslashes meant to be there
$errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
$msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
$errfile = phpbb_filter_root_path($errfile);
$msg_text = phpbb_filter_root_path($msg_text);
$error_name = ($errno === E_WARNING) ? 'PHP Warning' : 'PHP Notice';
echo '<b>[phpBB Debug] ' . $error_name . '</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
@ -3938,6 +3988,29 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
return false;
}
/**
* Removes absolute path to phpBB root directory from error messages
* and converts backslashes to forward slashes.
*
* @param string $errfile Absolute file path
* (e.g. /var/www/phpbb3/phpBB/includes/functions.php)
* Please note that if $errfile is outside of the phpBB root,
* the root path will not be found and can not be filtered.
* @return string Relative file path
* (e.g. /includes/functions.php)
*/
function phpbb_filter_root_path($errfile)
{
static $root_path;
if (empty($root_path))
{
$root_path = phpbb_realpath(dirname(__FILE__) . '/../');
}
return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile);
}
/**
* Queries the session table to get information about online guests
* @param int $item_id Limits the search to the item with this id
@ -4305,7 +4378,7 @@ function phpbb_http_login($param)
*/
function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
{
global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
if (defined('HEADER_INC'))
{
@ -4458,6 +4531,15 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
$s_search_hidden_fields['sid'] = $_SID;
}
if (!empty($_EXTRA_URL))
{
foreach ($_EXTRA_URL as $url_param)
{
$url_param = explode('=', $url_param, 2);
$s_hidden_fields[$url_param[0]] = $url_param[1];
}
}
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
'SITENAME' => $config['sitename'],
@ -4589,6 +4671,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
header('Expires: 0');
header('Pragma: no-cache');
if (!empty($user->data['is_bot']))
{
// Let reverse proxies know we detected a bot.
header('X-PHPBB-IS-BOT: yes');
}
return;
}

View file

@ -2595,6 +2595,35 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';
}
if ($log_count !== false)
{
$sql = 'SELECT COUNT(l.log_id) AS total_entries
FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
WHERE l.log_type = $log_type
AND l.user_id = u.user_id
AND l.log_time >= $limit_days
$sql_keywords
$sql_forum";
$result = $db->sql_query($sql);
$log_count = (int) $db->sql_fetchfield('total_entries');
$db->sql_freeresult($result);
}
// $log_count may be false here if false was passed in for it,
// because in this case we did not run the COUNT() query above.
// If we ran the COUNT() query and it returned zero rows, return;
// otherwise query for logs below.
if ($log_count === 0)
{
// Save the queries, because there are no logs to display
return 0;
}
if ($offset >= $log_count)
{
$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
}
$sql = "SELECT l.*, u.username, u.username_clean, u.user_colour
FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u
WHERE l.log_type = $log_type
@ -2762,21 +2791,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
}
}
if ($log_count !== false)
{
$sql = 'SELECT COUNT(l.log_id) AS total_entries
FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
WHERE l.log_type = $log_type
AND l.user_id = u.user_id
AND l.log_time >= $limit_days
$sql_keywords
$sql_forum";
$result = $db->sql_query($sql);
$log_count = (int) $db->sql_fetchfield('total_entries');
$db->sql_freeresult($result);
}
return;
return $offset;
}
/**
@ -2908,6 +2923,12 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
$user_count = (int) $db->sql_fetchfield('user_count');
$db->sql_freeresult($result);
if ($user_count == 0)
{
// Save the queries, because there are no users to display
return 0;
}
if ($offset >= $user_count)
{
$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
@ -3113,7 +3134,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;
@ -3123,6 +3144,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;
@ -3145,6 +3169,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);
}

View file

@ -1107,7 +1107,7 @@ function extension_allowed($forum_id, $extension, &$extensions)
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
* @param bool $allow_reply Allow Re: in front of string
* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_legnth) and is deprecated.
* NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_length) and is deprecated.
* @param string $append String to be appended
*/
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')

View file

@ -51,6 +51,27 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
}
// Handle marking everything read
if ($mark_read == 'all')
{
$redirect = build_url(array('mark', 'hash'));
meta_refresh(3, $redirect);
if (check_link_hash(request_var('hash', ''), 'global'))
{
markread('all');
trigger_error(
$user->lang['FORUMS_MARKED'] . '<br /><br />' .
sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>')
);
}
else
{
trigger_error(sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
}
// Display list of active topics for this category?
$show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
@ -120,13 +141,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_id = $row['forum_id'];
// Mark forums read?
if ($mark_read == 'forums' || $mark_read == 'all')
if ($mark_read == 'forums')
{
if ($auth->acl_get('f_list', $forum_id))
{
$forum_ids[] = $forum_id;
continue;
}
continue;
}
// Category with no members
@ -152,8 +174,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
continue;
}
$forum_ids[] = $forum_id;
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
$forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
@ -255,24 +275,16 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$db->sql_freeresult($result);
// Handle marking posts
if ($mark_read == 'forums' || $mark_read == 'all')
if ($mark_read == 'forums')
{
$redirect = build_url(array('mark', 'hash'));
$token = request_var('hash', '');
if (check_link_hash($token, 'global'))
{
if ($mark_read == 'all')
{
markread('all');
$message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
}
else
{
// Add 0 to forums array to mark global announcements correctly
$forum_ids[] = 0;
markread('topics', $forum_ids);
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
}
// Add 0 to forums array to mark global announcements correctly
$forum_ids[] = 0;
markread('topics', $forum_ids);
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
meta_refresh(3, $redirect);
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
}
@ -453,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,
@ -662,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;
@ -996,13 +1009,17 @@ function display_user_activity(&$userdata)
}
// Obtain active topic
// We need to exclude passworded forums here so we do not leak the topic title
$forum_ary_topic = array_unique(array_merge($forum_ary, $user->get_passworded_forums()));
$forum_sql_topic = (!empty($forum_ary_topic)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary_topic, true) : '';
$sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
AND (post_approved = 1
$sql_m_approve)
$forum_sql
$forum_sql_topic
GROUP BY topic_id
ORDER BY num_posts DESC";
$result = $db->sql_query_limit($sql, 1);
@ -1058,7 +1075,7 @@ function display_user_activity(&$userdata)
/**
* Topic and forum watching common code
*/
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0)
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '')
{
global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
@ -1067,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)
@ -1091,28 +1109,51 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
if (isset($_GET['unwatch']))
{
$uid = request_var('uid', 0);
if ($uid != $user_id)
$token = request_var('hash', '');
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
$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>');
trigger_error($message);
}
if ($_GET['unwatch'] == $mode)
{
$is_watching = 0;
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>');
trigger_error($message);
}
$sql = 'DELETE FROM ' . $table_sql . "
WHERE $where_sql = $match_id
AND user_id = $user_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 />';
$message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
meta_refresh(3, $redirect_url);
trigger_error($message);
}
else
{
$s_hidden_fields = array(
'uid' => $user->data['user_id'],
'unwatch' => $mode,
'start' => $start,
'f' => $forum_id,
);
if ($mode != 'forum')
{
$s_hidden_fields['t'] = $topic_id;
}
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
meta_refresh(3, $redirect_url);
$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
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));
}
}
else
{
@ -1132,26 +1173,45 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
{
if (isset($_GET['watch']))
{
$uid = request_var('uid', 0);
$token = request_var('hash', '');
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$match_id"))
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
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>');
trigger_error($message);
}
$is_watching = true;
$sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status)
VALUES ($user_id, $match_id, " . NOTIFY_YES . ')';
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
meta_refresh(3, $redirect_url);
trigger_error($message);
}
else
{
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
$s_hidden_fields = array(
'uid' => $user->data['user_id'],
'watch' => $mode,
'start' => $start,
'f' => $forum_id,
);
if ($mode != 'forum')
{
$s_hidden_fields['t'] = $topic_id;
}
$confirm_box_message = (($item_title == '') ? 'WATCH_' . strtoupper($mode) : $user->lang('WATCH_' . strtoupper($mode) . '_DETAILED', $item_title));
confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields));
}
meta_refresh(3, $redirect_url);
trigger_error($message);
}
else
{
@ -1161,7 +1221,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
}
else
{
if (isset($_GET['unwatch']) && $_GET['unwatch'] == $mode)
if ((isset($_GET['unwatch']) && $_GET['unwatch'] == $mode) || (isset($_GET['watch']) && $_GET['watch'] == $mode))
{
login_box();
}

View file

@ -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)
if (!class_exists('phpbb_db_tools'))
{
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;
global $phpbb_root_path, $phpEx;
require($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
}
$result = $db->sql_query($sql);
$db_tools = new phpbb_db_tools($db);
$tables = array();
while ($row = $db->sql_fetchrow($result))
{
$tables[] = current($row);
}
$db->sql_freeresult($result);
return $tables;
return $db_tools->sql_list_tables();
}
/**

View file

@ -162,6 +162,22 @@ class messenger
$this->extra_headers[] = trim($headers);
}
/**
* Adds X-AntiAbuse headers
*
* @param array $config Configuration array
* @param user $user A user object
*
* @return null
*/
function anti_abuse_headers($config, $user)
{
$this->headers('X-AntiAbuse: Board servername - ' . mail_encode($config['server_name']));
$this->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$this->headers('X-AntiAbuse: Username - ' . mail_encode($user->data['username']));
$this->headers('X-AntiAbuse: User IP - ' . $user->ip);
}
/**
* Set the email priority
*/
@ -975,9 +991,16 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
$smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']);
// Ok we have error checked as much as we can to this point let's get on it already.
ob_start();
if (!class_exists('phpbb_error_collector'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
}
$collector = new phpbb_error_collector;
$collector->install();
$smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);
$error_contents = ob_get_clean();
$collector->uninstall();
$error_contents = $collector->format_errors();
if (!$smtp->socket)
{
@ -1608,18 +1631,27 @@ function mail_encode($str, $eol = "\r\n")
*/
function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
{
global $config;
global $config, $phpbb_root_path, $phpEx;
// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
// Reference: http://bugs.php.net/bug.php?id=15841
$headers = implode($eol, $headers);
ob_start();
if (!class_exists('phpbb_error_collector'))
{
include($phpbb_root_path . 'includes/error_collector.' . $phpEx);
}
$collector = new phpbb_error_collector;
$collector->install();
// On some PHP Versions mail() *may* fail if there are newlines within the subject.
// Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
// Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)
$result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
$err_msg = ob_get_clean();
$collector->uninstall();
$err_msg = $collector->format_errors();
return $result;
}

View file

@ -1870,9 +1870,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_topic':
case 'edit_first_post':
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
if (isset($poll['poll_options']))
{
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
$poll_start = ($poll['poll_start'] || empty($poll['poll_options'])) ? $poll['poll_start'] : $current_time;
$poll_length = $poll['poll_length'] * 86400;
if ($poll_length < 0)
{
@ -2075,11 +2075,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
}
// Update Poll Tables
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
if (isset($poll['poll_options']))
{
$cur_poll_options = array();
if ($poll['poll_start'] && $mode == 'edit')
if ($mode == 'edit')
{
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . '

View file

@ -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']);
}

View file

@ -808,23 +808,56 @@ class ftp_fsock extends transfer
*/
function _open_data_connection()
{
$this->_send_command('PASV', '', false);
if (!$ip_port = $this->_check_command(true))
// Try to find out whether we have a IPv4 or IPv6 (control) connection
if (function_exists('stream_socket_get_name'))
{
return false;
$socket_name = stream_socket_get_name($this->connection, true);
$server_ip = substr($socket_name, 0, strrpos($socket_name, ':'));
}
// open the connection to start sending the file
if (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp))
if (!isset($server_ip) || preg_match(get_preg_expression('ipv4'), $server_ip))
{
// bad ip and port
return false;
// Passive mode
$this->_send_command('PASV', '', false);
if (!$ip_port = $this->_check_command(true))
{
return false;
}
// open the connection to start sending the file
if (!preg_match('#[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+#', $ip_port, $temp))
{
// bad ip and port
return false;
}
$temp = explode(',', $temp[0]);
$server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3];
$server_port = $temp[4] * 256 + $temp[5];
}
else
{
// Extended Passive Mode - RFC2428
$this->_send_command('EPSV', '', false);
if (!$epsv_response = $this->_check_command(true))
{
return false;
}
// Response looks like "229 Entering Extended Passive Mode (|||12345|)"
// where 12345 is the tcp port for the data connection
if (!preg_match('#\(\|\|\|([0-9]+)\|\)#', $epsv_response, $match))
{
return false;
}
$server_port = (int) $match[1];
// fsockopen expects IPv6 address in square brackets
$server_ip = "[$server_ip]";
}
$temp = explode(',', $temp[0]);
$server_ip = $temp[0] . '.' . $temp[1] . '.' . $temp[2] . '.' . $temp[3];
$server_port = $temp[4] * 256 + $temp[5];
$errno = 0;
$errstr = '';

View file

@ -170,7 +170,7 @@ class mcp_logs
// Grab log data
$log_data = array();
$log_count = 0;
view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
$start = view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
@ -179,7 +179,7 @@ class mcp_logs
'L_TITLE' => $user->lang['MCP_LOGS'],
'U_POST_ACTION' => $this->u_action,
'U_POST_ACTION' => $this->u_action . "&amp;$u_sort_param$keywords_param&amp;start=$start",
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,

View file

@ -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(

View file

@ -198,7 +198,7 @@ class mcp_notes
$log_data = array();
$log_count = 0;
view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
$start = view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
if ($log_count)
{

View file

@ -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

View file

@ -216,6 +216,7 @@ class mcp_queue
'POST_IP' => $post_info['poster_ip'],
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id . '&amp;lookup=' . $post_info['poster_ip']) . '#ip' : '',
));
@ -778,6 +779,8 @@ function disapprove_post($post_id_list, $id, $mode)
if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
unset($_REQUEST['confirm_key']);
unset($_POST['confirm_key']);
unset($_POST['confirm']);
}
else

View file

@ -148,6 +148,7 @@ class mcp_reports
$message = bbcode_nl2br($message);
$message = smiley_text($message);
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{

View file

@ -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,

View file

@ -2410,6 +2410,39 @@ class user extends session
return true;
}
/**
* Returns all password protected forum ids the user is currently NOT authenticated for.
*
* @return array Array of forum ids
* @access public
*/
function get_passworded_forums()
{
global $db;
$sql = 'SELECT f.forum_id, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($this->session_id) . "')
WHERE f.forum_password <> ''";
$result = $db->sql_query($sql);
$forum_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$forum_id = (int) $row['forum_id'];
if ($row['user_id'] != $this->data['user_id'])
{
$forum_ids[$forum_id] = $forum_id;
}
}
$db->sql_freeresult($result);
return $forum_ids;
}
}
?>

View file

@ -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

View file

@ -117,10 +117,7 @@ class ucp_activate
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))

View file

@ -193,48 +193,44 @@ 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();
$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);
while ($row = $db->sql_fetchrow($result))
{
$messenger->template('group_request', $row['user_lang']);
$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'],
'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->save_queue();
}
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 ' . (($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($email_template, $row['user_lang']);
$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'],
'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->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']);
meta_refresh(3, $this->u_action);

View file

@ -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'];

View file

@ -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) : '',

View file

@ -78,14 +78,14 @@ class ucp_profile
$error = validate_data($data, $check_ary);
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
{
$error[] = 'NEW_PASSWORD_ERROR';
$error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
}
if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password']))
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{
$error[] = 'CUR_PASSWORD_ERROR';
$error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
}
// Only check the new password against the previous password if there have been no errors
@ -94,9 +94,9 @@ class ucp_profile
$error[] = 'SAME_PASSWORD_ERROR';
}
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
if (!phpbb_check_hash($data['cur_password'], $user->data['user_password']))
{
$error[] = 'NEW_EMAIL_ERROR';
$error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
}
if (!check_form_key('ucp_reg_details'))
@ -150,10 +150,7 @@ class ucp_profile
$messenger->to($data['email'], $data['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username']),

View file

@ -155,8 +155,8 @@ class ucp_register
$this->tpl_name = 'ucp_agreement';
return;
}
// The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
if ($config['enable_confirm'])
{
@ -366,10 +366,7 @@ class ucp_register
$messenger->to($data['email'], $data['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),

View file

@ -94,10 +94,7 @@ class ucp_resend
$messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
$messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
@ -133,10 +130,7 @@ class ucp_resend
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']),

View file

@ -81,15 +81,23 @@ $legend = implode(', ', $legend);
// Generate birthday list if required ...
$birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
{
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
// Display birthdays of 29th february on 28th february in non-leap-years
$leap_year_birthdays = '';
if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L'))
{
$leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'";
}
$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
FROM ' . USERS_TABLE . ' u
LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
WHERE (b.ban_id IS NULL
OR b.ban_exclude = 1)
AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
AND (u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' $leap_year_birthdays)
AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
@ -99,7 +107,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'])
if ($age = (int) substr($row['user_birthday'], -4))
{
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
$birthday_list .= ' (' . max(0, $now['year'] - $age) . ')';
}
}
$db->sql_freeresult($result);

View file

@ -32,7 +32,7 @@ unset($dbpasswd);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
'phpbb_version' => '3.0.9',
'phpbb_version' => '3.0.10',
'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
@ -504,7 +504,7 @@ if (!$get_info)
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
array('topic_last_view_time', 'posts.post_time', 'intval'),
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
array('poll_length', 'vote_desc.vote_length', 'null_to_zero'),
array('poll_max_options', 1, ''),
@ -537,7 +537,7 @@ if (!$get_info)
array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'),
array('topic_first_post_id', 'topics.topic_first_post_id', ''),
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')),
array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'htmlspecialchars_decode', 'function4' => 'utf8_htmlspecialchars')),
array('poll_start', 'vote_desc.vote_start', 'null_to_zero'),
array('poll_length', 'vote_desc.vote_length', 'null_to_zero'),
array('poll_max_options', 1, ''),
@ -582,7 +582,7 @@ if (!$get_info)
array('poll_option_id', 'vote_results.vote_option_id', ''),
array('topic_id', 'vote_desc.topic_id', ''),
array('', 'topics.topic_poster AS poster_id', 'phpbb_user_id'),
array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'htmlspecialchars_decode', 'function3' => 'utf8_htmlspecialchars')),
array('poll_option_total', 'vote_results.vote_result', ''),
'where' => 'vote_results.vote_id = vote_desc.vote_id',

File diff suppressed because it is too large Load diff

View file

@ -1716,19 +1716,16 @@ class install_convert extends module
fix_empty_primary_groups();
if (!isset($config['board_startdate']))
{
$sql = 'SELECT MIN(user_regdate) AS board_startdate
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT MIN(user_regdate) AS board_startdate
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0) || !isset($config['board_startdate']))
{
set_config('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
{
set_config('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
update_dynamic_config();

View file

@ -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']);
@ -1940,10 +1945,7 @@ class install_install extends module
$messenger->to($data['board_email1'], $data['admin_name']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['admin_name']),
@ -2032,7 +2034,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',

View file

@ -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 (

View file

@ -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'

View file

@ -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,

View file

@ -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,

View file

@ -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

View file

@ -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;

View file

@ -94,6 +94,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
@ -245,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.9');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');

View file

@ -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'

View file

@ -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',

View file

@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
'SYSTEM_TIMEZONE' => 'Guest timezone',
'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.',
'WARNINGS_EXPIRE' => 'Warning duration',
'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a users record.',
'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a users record. Set this value to 0 to make warnings permanent.',
));
// Board Features
@ -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',

View file

@ -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',

View file

@ -59,6 +59,7 @@ $lang = array_merge($lang, array(
'RESTORE_FAILURE' => 'The backup file may be corrupt.',
'RESTORE_OPTIONS' => 'Restore options',
'RESTORE_SELECTED_BACKUP' => 'Are you sure you want to restore the selected backup?',
'RESTORE_SUCCESS' => 'The database has been successfully restored.<br /><br />Your board should be back to the state it was when the backup was made.',
'SELECT_ALL' => 'Select all',

View file

@ -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.',

View file

@ -59,6 +59,7 @@ $lang = array_merge($lang, array(
'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been reset to the boards default language.',
'LANGUAGE_PACK_DETAILS' => 'Language pack details',
'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.',
'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields language strings were copied from the default language. Please change them if necessary.',
'LANGUAGE_PACK_ISO' => 'ISO',
'LANGUAGE_PACK_LOCALNAME' => 'Local name',
'LANGUAGE_PACK_NAME' => 'Name',

View file

@ -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.',
@ -652,6 +654,10 @@ $lang = array_merge($lang, array(
'UNREAD_PMS' => '<strong>%d</strong> unread messages',
'UNREAD_POST' => 'Unread post',
'UNREAD_POSTS' => 'Unread posts',
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
'UNWATCH_FORUM_DETAILED' => 'Are you sure you wish to unsubscribe from the forum “%s”?',
'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?',
'UNWATCH_TOPIC_DETAILED' => 'Are you sure you wish to unsubscribe from the topic “%s”?',
'UNWATCHED_FORUMS' => 'You are no longer subscribed to the selected forums.',
'UNWATCHED_TOPICS' => 'You are no longer subscribed to the selected topics.',
'UNWATCHED_FORUMS_TOPICS' => 'You are no longer subscribed to the selected entries.',
@ -700,6 +706,10 @@ $lang = array_merge($lang, array(
'WARNINGS' => 'Warnings',
'WARN_USER' => 'Warn user',
'WATCH_FORUM_CONFIRM' => 'Are you sure you wish to subscribe to this forum?',
'WATCH_FORUM_DETAILED' => 'Are you sure you wish to subscribe to the forum “%s”?',
'WATCH_TOPIC_CONFIRM' => 'Are you sure you wish to subscribe to this topic?',
'WATCH_TOPIC_DETAILED' => 'Are you sure you wish to subscribe to the topic “%s”?',
'WELCOME_SUBJECT' => 'Welcome to %s forums',
'WEBSITE' => 'Website',
'WHOIS' => 'Whois',

View file

@ -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.

View file

@ -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.

View file

@ -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?',

View file

@ -151,7 +151,7 @@ $lang = array_merge($lang, array(
'DLL_MYSQL' => 'MySQL',
'DLL_MYSQLI' => 'MySQL with MySQLi Extension',
'DLL_ORACLE' => 'Oracle',
'DLL_POSTGRES' => 'PostgreSQL 7.x/8.x',
'DLL_POSTGRES' => 'PostgreSQL',
'DLL_SQLITE' => 'SQLite',
'DLL_XML' => 'XML support [ Jabber ]',
'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]',
@ -232,6 +232,7 @@ $lang = array_merge($lang, array(
'INST_ERR' => 'Installation error',
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
'INST_ERR_DB_INVALID_PREFIX'=> 'The prefix you entered is invalid. It must start with a letter and must only contain letters, numbers and underscores.',
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension” option you have selected. Please try the “MySQL” option instead.',
'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
@ -352,6 +353,7 @@ $lang = array_merge($lang, array(
'TABLES_MISSING' => 'Could not find these tables<br />» <strong>%s</strong>.',
'TABLE_PREFIX' => 'Prefix for tables in database',
'TABLE_PREFIX_EXPLAIN' => 'The prefix must start with a letter and must only contain letters, numbers and underscores.',
'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s.',
'TESTS_PASSED' => 'Tests passed',
'TESTS_FAILED' => 'Tests failed',
@ -494,7 +496,7 @@ $lang = array_merge($lang, array(
'SHOW_DIFF_NEW' => 'Show file contents',
'SHOW_DIFF_NEW_CONFLICT' => 'Show differences',
'SHOW_DIFF_NOT_MODIFIED' => 'Show differences',
'SOME_QUERIES_FAILED' => 'Some queries failed, the statements and errors are listing below.',
'SOME_QUERIES_FAILED' => 'Some queries failed, the statements and errors are listed below.',
'SQL' => 'SQL',
'SQL_FAILURE_EXPLAIN' => 'This is probably nothing to worry about, update will continue. Should this fail to complete you may need to seek help at our support forums. See <a href="../docs/README.html">README</a> for details on how to obtain advice.',
'STAGE_FILE_CHECK' => 'Check files',

View file

@ -48,7 +48,7 @@ $lang = array_merge($lang, array(
'BBCODE_A_HELP' => 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]',
'BBCODE_B_HELP' => 'Bold text: [b]text[/b]',
'BBCODE_C_HELP' => 'Code display: [code]code[/code]',
'BBCODE_E_HELP' => 'List: Add list element',
'BBCODE_D_HELP' => 'Flash: [flash=width,height]http://url[/flash]',
'BBCODE_F_HELP' => 'Font size: [size=85]small text[/size]',
'BBCODE_IS_OFF' => '%sBBCode%s is <em>OFF</em>',
'BBCODE_IS_ON' => '%sBBCode%s is <em>ON</em>',
@ -61,7 +61,7 @@ $lang = array_merge($lang, array(
'BBCODE_S_HELP' => 'Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000',
'BBCODE_U_HELP' => 'Underline text: [u]text[/u]',
'BBCODE_W_HELP' => 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]',
'BBCODE_D_HELP' => 'Flash: [flash=width,height]http://url[/flash]',
'BBCODE_Y_HELP' => 'List: Add list element',
'BUMP_ERROR' => 'You cannot bump this topic so soon after the last post.',
'CANNOT_DELETE_REPLIED' => 'Sorry but you may only delete posts which have not been replied to.',

View file

@ -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',

View file

@ -899,10 +899,7 @@ switch ($mode)
$notify_type = NOTIFY_EMAIL;
}
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'BOARD_CONTACT' => $config['board_contact'],
@ -1293,13 +1290,6 @@ switch ($mode)
$total_users = $config['num_users'];
}
$s_char_options = '<option value=""' . ((!$first_char) ? ' selected="selected"' : '') . '>&nbsp; &nbsp;</option>';
for ($i = 97; $i < 123; $i++)
{
$s_char_options .= '<option value="' . chr($i) . '"' . (($first_char == chr($i)) ? ' selected="selected"' : '') . '>' . chr($i-32) . '</option>';
}
$s_char_options .= '<option value="other"' . (($first_char == 'other') ? ' selected="selected"' : '') . '>' . $user->lang['OTHER'] . '</option>';
// Build a relevant pagination_url
$params = $sort_params = array();
@ -1329,6 +1319,7 @@ switch ($mode)
'first_char' => array('first_char', ''),
);
$u_first_char_params = array();
foreach ($check_params as $key => $call)
{
if (!isset($_REQUEST[$key]))
@ -1340,6 +1331,10 @@ switch ($mode)
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
$params[] = $param;
if ($key != 'first_char')
{
$u_first_char_params[] = $param;
}
if ($key != 'sk' && $key != 'sd')
{
$sort_params[] = $param;
@ -1359,6 +1354,27 @@ switch ($mode)
unset($search_params, $sort_params);
$u_first_char_params = implode('&amp;', $u_first_char_params);
$u_first_char_params .= ($u_first_char_params) ? '&amp;' : '';
$first_characters = array();
$first_characters[''] = $user->lang['ALL'];
for ($i = 97; $i < 123; $i++)
{
$first_characters[chr($i)] = chr($i - 32);
}
$first_characters['other'] = $user->lang['OTHER'];
foreach ($first_characters as $char => $desc)
{
$template->assign_block_vars('first_char', array(
'DESC' => $desc,
'VALUE' => $char,
'S_SELECTED' => ($first_char == $char) ? true : false,
'U_SORT' => append_sid("{$phpbb_root_path}memberlist.$phpEx", $u_first_char_params . 'first_char=' . $char) . '#memberlist',
));
}
// Some search user specific data
if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_')))
{
@ -1603,7 +1619,6 @@ switch ($mode)
'S_LEADERS_SET' => $leaders_set,
'S_MODE_SELECT' => $s_sort_key,
'S_ORDER_SELECT' => $s_sort_dir,
'S_CHAR_OPTIONS' => $s_char_options,
'S_MODE_ACTION' => $pagination_url)
);
}
@ -1667,7 +1682,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
if ($bday_year)
{
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
$diff = $now['mon'] - $bday_month;
if ($diff == 0)
@ -1679,7 +1694,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
$diff = ($diff < 0) ? 1 : 0;
}
$age = (int) ($now['year'] - $bday_year - $diff);
$age = max(0, (int) ($now['year'] - $bday_year - $diff));
}
}

View file

@ -895,7 +895,7 @@ if ($submit || $preview || $refresh)
$message_parser->parse_poll($poll);
$post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
$post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array();
$post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
/* We reset votes, therefore also allow removing options
@ -904,6 +904,24 @@ if ($submit || $preview || $refresh)
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
}*/
}
else if ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && $auth->acl_get('f_poll', $forum_id))
{
// The user removed all poll options, this is equal to deleting the poll.
$poll = array(
'poll_title' => '',
'poll_length' => 0,
'poll_max_options' => 0,
'poll_option_text' => '',
'poll_start' => 0,
'poll_last_vote' => 0,
'poll_vote_change' => 0,
'poll_options' => array(),
);
$post_data['poll_options'] = array();
$post_data['poll_title'] = '';
$post_data['poll_start'] = $post_data['poll_length'] = $post_data['poll_max_options'] = $post_data['poll_last_vote'] = $post_data['poll_vote_change'] = 0;
}
else if (!$auth->acl_get('f_poll', $forum_id) && ($mode == 'edit') && ($post_id == $post_data['topic_first_post_id']) && ($original_poll_data['poll_title'] != ''))
{
// We have a poll but the editing user is not permitted to create/edit it.
@ -917,7 +935,7 @@ if ($submit || $preview || $refresh)
$message_parser->parse_poll($poll);
$post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
$post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : array();
$post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
}
else

View file

@ -39,11 +39,13 @@ if (!$post_id && (!$pm_id || !$config['allow_pm_report']))
if ($post_id)
{
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
$return_forum_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
$pm_id = 0;
}
else
{
$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&p=$pm_id");
$return_forum_url = '';
$post_id = 0;
$forum_id = 0;
}
@ -101,6 +103,7 @@ if ($post_id)
{
$message = $user->lang['ALREADY_REPORTED'];
$message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
trigger_error($message);
}
}
@ -209,6 +212,10 @@ if ($submit && $reason_id)
meta_refresh(3, $redirect_url);
$message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
if ($return_forum_url)
{
$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
}
trigger_error($message);
}

View file

@ -19,7 +19,7 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.0.9
version = 3.0.10
# Images
img_site_logo = site_logo.gif*52*139

View file

@ -19,4 +19,4 @@
# General Information about this style
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.0.9
version = 3.0.10

View file

@ -151,8 +151,10 @@ function insert_text(text, spaces, popup)
{
text = ' ' + text + ' ';
}
if (!isNaN(textarea.selectionStart))
// Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
// Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
if (!isNaN(textarea.selectionStart) && !is_ie)
{
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
@ -216,11 +218,12 @@ function addquote(post_id, username, l_wrote)
}
// Get text selection - not only the post content :(
if (window.getSelection)
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie)
{
theSelection = window.getSelection().toString();
}
else if (document.getSelection)
else if (document.getSelection && !is_ie)
{
theSelection = document.getSelection();
}

View file

@ -200,7 +200,7 @@ function selectCode(a)
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
// Not IE
// Not IE and IE9+
if (window.getSelection)
{
var s = window.getSelection();

View file

@ -10,7 +10,7 @@
<!-- ENDIF -->
<!-- IF S_DISPLAY_JUMPBOX -->
<form method="post" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
<form method="post" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(this.f.value == -1){return false;}">
<!-- IF $CUSTOM_FIELDSET_CLASS -->
<fieldset class="{$CUSTOM_FIELDSET_CLASS}">

View file

@ -8,7 +8,7 @@
<div class="content">
<h2>{MESSAGE_TITLE}</h2>
<!-- IF ADDITIONAL_MSG --><p>{ADDITIONAL_MSG}</p><!-- ENDIF -->
<!-- IF ADDITIONAL_MSG --><p class="error">{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
<!-- IF S_NOTIFY_POSTER -->

View file

@ -28,7 +28,6 @@
<dl>
<dt>
<a href="{unapproved.U_POST_DETAILS}" class="topictitle">{unapproved.SUBJECT}</a> {unapproved.ATTACH_ICON_IMG}<br />
<!-- IF report.PAGINATION --><strong class="pagination"><span>{report.PAGINATION}</span></strong><!-- ENDIF -->
{L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} &raquo; {unapproved.POST_TIME}
</dt>
<dd class="moderation"><span>

View file

@ -78,7 +78,7 @@
<td style="text-align: center">{usernotes.REPORT_AT}</td>
<td>{usernotes.ACTION}</td>
<!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
<!-- IF S_CLEAR_ALLOWED --><td style="width: 5%; text-align: center;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
<tr>

Some files were not shown because too many files have changed in this diff Show more