diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:36 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:36 +0100 |
| commit | 1ceddd9eeccde56ab307631a16e40b943eac883a (patch) | |
| tree | d1045042f004c0d551658e8192b75965139f3707 /phpBB | |
| parent | 0e0c8d78199cfa2dd56a62266df33655c93367ff (diff) | |
| parent | aadda939732ee163c3babedf4afcd914af12a2cc (diff) | |
| download | forums-1ceddd9eeccde56ab307631a16e40b943eac883a.tar forums-1ceddd9eeccde56ab307631a16e40b943eac883a.tar.gz forums-1ceddd9eeccde56ab307631a16e40b943eac883a.tar.bz2 forums-1ceddd9eeccde56ab307631a16e40b943eac883a.tar.xz forums-1ceddd9eeccde56ab307631a16e40b943eac883a.zip | |
Merge commit 'release-3.0-RC3'
Diffstat (limited to 'phpBB')
90 files changed, 872 insertions, 258 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 78c876808b..836d2556f8 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -430,6 +430,21 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) break; + // Absolute path + case 'lang': + if (!$cfg_array[$config_name]) + { + break; + } + + $cfg_array[$config_name] = basename($cfg_array[$config_name]); + + if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/')) + { + $error[] = $user->lang['WRONG_DATA_LANG']; + } + break; + // Relative path (appended $phpbb_root_path) case 'rpath': case 'rwpath': diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index abc115330c..cbafa554b1 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -60,11 +60,11 @@ </dl> <dl> <dt><label for="banreason">{L_BAN_REASON}:</label></dt> - <dd><input name="banreason" type="text" class="text medium" maxlength="3000" id="banreason" /></dd> + <dd><input name="banreason" type="text" class="text medium" maxlength="255" id="banreason" /></dd> </dl> <dl> <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> - <dd><input name="bangivereason" type="text" class="text medium" maxlength="3000" id="bangivereason" /></dd> + <dd><input name="bangivereason" type="text" class="text medium" maxlength="255" id="bangivereason" /></dd> </dl> <p class="submit-buttons"> diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 6b531f545e..a80c6db331 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -92,6 +92,7 @@ <fieldset class="quick" style="float: right;"> <select name="action">{S_BOT_OPTIONS}</select> <input class="button2" name="submit" type="submit" value="{L_SUBMIT}" /> + <p class="small"><a href="#" onclick="marklist('acp_bots', 'mark', true);">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('acp_bots', 'mark', false);">{L_UNMARK_ALL}</a></p> </fieldset> </form> diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html index eb4dbbdef4..e82aee0e87 100644 --- a/phpBB/adm/style/acp_update.html +++ b/phpBB/adm/style/acp_update.html @@ -8,7 +8,7 @@ <p>{L_VERSION_CHECK_EXPLAIN}</p> - <!-- IF S_UP_TO_DATE --> + <!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO --> <div class="successbox"> <p>{L_VERSION_UP_TO_DATE_ACP}</p> </div> @@ -22,7 +22,7 @@ <legend></legend> <dl> <dt><label>{L_CURRENT_VERSION}</label></dt> - <dd><strong>{CURRENT_VERSION}</strong></dd> + <dd><strong><!-- IF S_UP_TO_DATE and not S_UP_TO_DATE_AUTO -->{AUTO_VERSION}<!-- ELSE -->{CURRENT_VERSION}<!-- ENDIF --></strong></dd> </dl> <dl> <dt><label>{L_LATEST_VERSION}</label></dt> @@ -30,6 +30,12 @@ </dl> </fieldset> + <!-- IF S_UP_TO_DATE and not S_UP_TO_DATE_AUTO --> + {L_UPDATE_INSTRUCTIONS_INCOMPLETE} + <br /><br /> + {UPDATE_INSTRUCTIONS} + <br /><br /> + <!-- ENDIF --> <!-- IF not S_UP_TO_DATE --> {UPDATE_INSTRUCTIONS} <br /><br /> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index f81c56846d..b127462814 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1221,20 +1221,19 @@ input.disabled { } /* Nice method for clearing floated blocks without having to insert any extra markup - From http://www.positioniseverything.net/easyclearing.html */ + From http://www.positioniseverything.net/easyclearing.html .clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; -} +}*/ -/* Hide from Mac IE, Windows IE uses this as it doesn't support the :after method above \*/ .clearfix, #tabs, .row, #content, fieldset dl, #page-body { height: 1%; + overflow: hidden; } -/* End hide */ /* Syntax Highlighting ---------------------------------------- */ diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index e82b9d5d62..93d0059609 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -47,7 +47,7 @@ function initInsertions() { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - document.body.focus(); + // document.body.focus(); } } diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index 794d285574..54242d94b4 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -54,7 +54,7 @@ div#codepanel { } <!-- ENDIF --> -<!-- IF not IS_DIFF_NEW_FILE --> +<!-- IF not S_DIFF_NEW_FILE --> /** * Unified Diff */ diff --git a/phpBB/adm/style/viewsource.html b/phpBB/adm/style/viewsource.html index 7f0fde239c..f127c9626f 100644 --- a/phpBB/adm/style/viewsource.html +++ b/phpBB/adm/style/viewsource.html @@ -1,10 +1,10 @@ <!-- INCLUDE simple_header.html --> -<div id="acp"> +<div id="acp" style="padding: 0;"> <div class="panel" style="padding: 10px;"> <div style="overflow: auto;"> <h1>{FILENAME}</h1> - <table> + <table class="type2"> <tbody> <!-- BEGIN source --> <tr valign="top"> diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index d4821d0d5d..1261d4f57e 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -764,10 +764,10 @@ foreach ($supported_dbms as $dbms) * BOOL => tinyint(1) UNSIGNED * VCHAR => varchar(255) * CHAR:x => char(x) -* XSTEXT => text for storing 1000 characters (topic_title for example) -* STEXT => text for storing 3000 characters (normal input field with a max of 255 single-byte chars) -* TEXT => text for storing 8000 characters (short text, descriptions, comments, etc.) -* MTEXT => mediumtext (post text, large text) +* XSTEXT_UNI => text for storing 100 characters (topic_title for example) +* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI +* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.) +* MTEXT_UNI => mediumtext (post text, large text) * VCHAR:x => varchar(x) * TIMESTAMP => int(11) UNSIGNED * DECIMAL => decimal number (5,2) @@ -886,8 +886,8 @@ function get_schema_struct() 'ban_start' => array('TIMESTAMP', 0), 'ban_end' => array('TIMESTAMP', 0), 'ban_exclude' => array('BOOL', 0), - 'ban_reason' => array('STEXT', ''), - 'ban_give_reason' => array('STEXT', ''), + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), ), 'PRIMARY_KEY' => 'ban_id', 'KEYS' => array( diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index 8033dcea0b..8e648afb43 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -1,16 +1,25 @@ -/* ********************************************************************** *\ -/* *\ -/* phpBB3 © Copyright 2006 phpBB Group *\ -/* *\ -/* [ http://www.phpbb.com/ ] *\ -/* *\ -/* ********************************************************************** *\ +/** +* +* phpBB3 © Copyright 2000, 2002, 2005, 2007 phpBB Group +* http://www.phpbb.com +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, version 2 of the License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>. +* +*/ Please see: http://www.phpbb.com/about/team/ for a list of all the people currently involved in phpBB. -phpBB Project Manager : SHS` (Jonathan Stanley) - phpBB Lead Developer : Acyd Burn (Meik Sievertsen) phpBB Developers : DavidMJ (David M.) @@ -23,6 +32,7 @@ phpBB Developers : DavidMJ (David M.) -- Previous Contributors -- phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007] + SHS` (Jonathan Stanley) phpBB Lead Developer : psoTFX (Paul S. Owen) [2001 - 09/2005] diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 72fb2d5ad4..39593090f0 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -169,6 +169,7 @@ p a { <ol class="menu"> <li><a href="#changelog">Changelog</a> <ol type="i"> + <li><a href="#v30rc2">Changes since RC-2</a></li> <li><a href="#v30rc1">Changes since RC-1</a></li> </ol> </li> @@ -179,7 +180,61 @@ p a { <a name="changelog"></a><h1>1. Changelog</h1> - <a name="v30rc1"></a><b>1.i. Changes since 3.0.RC1</b> + <a name="v30rc2"></a><b>1.i. Changes since 3.0.RC2</b> + <br /><br /> + <div class="paragraph"> + + <ul class="menu"> + <li>[Fix] Re-allow searching within the memberlist</li> + <li>[Fix] Force prune related values to integers during conversions</li> + <li>[Fix] Updater now detects successfully merged files having conflicts and user chose to merge with modifications (Bug #12685)</li> + <li>[Fix] Updater is no longer listing missing language entries and styles if these had been removed (Bug #12655)</li> + <li>[Fix] Correct approval of posts in global announcements (Bug #12699)</li> + <li>[Sec] Do not allow setup spiders/robots to post, even if permissions are given. We see no reason why this should be possible. (Thanks to Frank Rizzo for convincing us regarding this)</li> + <li>[Sec] Do not display the last active column within the memberlist if u_viewonline permission is not given (Bug #12797)</li> + <li>[Fix] Display custom profile field "date" based on users language (Bug #12787)</li> + <li>[Fix] Allow adding of help language files within subdirectories (Bug #12783)</li> + <li>[Fix] Correctly apply smileys on posting having # within their emotion code</li> + <li>[Fix] Correctly convert smileys having double quotes within their emotion code (Bug #12731)</li> + <li>[Fix] The converter now adds the protocol to user website profile fields missing it (Bug #12819)</li> + <li>[Fix] Correctly escape banned ip/email using wildcard for ban check (Bug #12815)</li> + <li>[Fix] Fixed some very nasty opera bugs (dropdown list bug, cpu spike bug) (Bug #12763, #11609)</li> + <li>[Fix] Font colour list having the correct height in IE (Bug #9571)</li> + <li>[Feature] Added mark/unmark all links to the bots page (Bug #12461)</li> + <li>[Fix] Introduced check on duplicate usernames during bot creation/edit (Bug #12461)</li> + <li>[Fix] Allow multibyte letters for smilie codes(Bug #12321)</li> + <li>[Fix] Correctly chmod created cache files (Bug #12859)</li> + <li>[Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)</li> + <li>[Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)</li> + <li>[Fix] Correctly translate special group names in ucp_groups.php (Bug #12597)</li> + <li>[Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643)</li> + <li>[Fix] Make sure the automatic update is also working for those having fsockopen disabled</li> + <li>[Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed</li> + <li>[Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements</li> + <li>[Fix] Added login box to egosearch (Bug #12941)</li> + <li>[Fix] Deal with slashed quotes during quote bbcode conversion (Bug #12607)</li> + <li>[Fix] Minor language and style fixes (Bugs #12235, #12493, #11949)</li> + <li>[Feature] Added backlinks to mcp_report (Bug #12905)</li> + <li>[Fix] Only check usernames in guest posts upon edit (Bug #11349)</li> + <li>[Fix] Consider viewonline permission when viewing friends/foes (Bug #12955)</li> + <li>[Fix] Added proper unicode support to ban reasons (Bug #12947)</li> + <li>[Fix] The forum/topic sync code now recognizes other ways that the latest post in a topic can be expressed (Bug #12947) - patch provided by APTX</li> + <li>[Fix] Topic deletion via the user post deletion mechanism did not take into account statistics for forums that hold shadow topics (Bug #12981)</li> + <li>[Fix] Allow for negative and decimal numbers to be in transposed queries in the Oracle and Firebird DBAL (Bug #13033)</li> + <li>[Fix] Some jabber related bugs (Bug #12989, #11805, #11809)</li> + <li>[Fix] Added UTF-8 support for banning via the MCP (Bug #13013)</li> + <li>[Fix] Properly detect the script name in session::extract_current_page() if PHP_SELF is not defined (Bug #12705) - patch provided by ToonArmy</li> + <li>[Fix] Show role mask for global permission class under Permissions->Permission Roles (Bug #13057)</li> + + </ul> + + </div> + <a href="#top">Top</a> + <br /><br /> + + <hr /> + + <a name="v30rc1"></a><b>1.ii. Changes since 3.0.RC1</b> <br /><br /> <div class="paragraph"> diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 6a010dc5ec..5bda802cd4 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 185e18b7e0..8d9cac6cf3 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 3c77d11cc5..ff579c1ceb 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index 7481be50a8..8f86ae2740 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 5dd70928fd..14deabf135 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> @@ -780,6 +779,23 @@ $sql = 'SELECT * <p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p> + <h3>Avoid DB specific SQL: </h3> + <p>The "not equals operator", as defined by the SQL:2003 standard, is "<>"</p> + + <p class="bad">// This is wrong.</p> + <blockquote><pre> +$sql = 'SELECT * + FROM ' . SOME_TABLE . ' + WHERE a != 2'; + </pre></blockquote> + + <p class="good">// This is right. </p> + <blockquote><pre> +$sql = 'SELECT * + FROM ' . SOME_TABLE . ' + WHERE a <> 2'; + </pre></blockquote> + <h3>Common DBAL methods: </h3> <h3>sql_escape():</h3> diff --git a/phpBB/download.php b/phpBB/download.php index c24ea81425..382c528db9 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -544,7 +544,7 @@ function download_allowed() { foreach ($iplist as $ip) { - if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip)) + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_ip, '#')) . '$#i', $ip)) { if ($row['ip_exclude']) { @@ -561,7 +561,7 @@ function download_allowed() if ($site_hostname) { - if (preg_match('#^' . str_replace('*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname)) + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($site_hostname, '#')) . '$#i', $hostname)) { if ($row['ip_exclude']) { diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index f98873fdbf..63eaa341f5 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -79,6 +79,8 @@ class acm fwrite($fp, "<?php\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_dir . 'data_global.' . $phpEx, 0666); } else { @@ -119,7 +121,7 @@ class acm @include($this->cache_dir . $entry); if ($expired) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -181,6 +183,8 @@ class acm fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . var_export($var, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_dir . "data{$var_name}.$phpEx", 0666); } } else @@ -211,7 +215,7 @@ class acm continue; } - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } closedir($dir); @@ -269,7 +273,7 @@ class acm if ($found) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -284,7 +288,7 @@ class acm if ($var_name[0] == '_') { - @unlink($this->cache_dir . 'data' . $var_name . ".$phpEx"); + $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx"); } else if (isset($this->vars[$var_name])) { @@ -347,7 +351,7 @@ class acm } else if ($expired) { - @unlink($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); return false; } @@ -365,8 +369,9 @@ class acm // Remove extra spaces and tabs $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); + $filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx; - if ($fp = @fopen($this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx, 'wb')) + if ($fp = @fopen($filename, 'wb')) { @flock($fp, LOCK_EX); @@ -387,6 +392,8 @@ class acm @flock($fp, LOCK_UN); fclose($fp); + @chmod($filename, 0666); + $query_result = $query_id; } } @@ -454,6 +461,18 @@ class acm return true; } + + /** + * Removes/unlinks file + */ + function remove_file($filename) + { + if (!@unlink($filename)) + { + // E_USER_ERROR - not using language entry - intended. + trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR); + } + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1db18f6d5c..a0aaf8d67e 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -78,7 +78,7 @@ class acp_attachments } $db->sql_freeresult($result); - $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((sizeof($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; + $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; $display_vars = array( 'title' => 'ACP_ATTACHMENT_SETTINGS', diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 3c7fe9f1f3..5bab27d5b2 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -162,7 +162,32 @@ class acp_bots { $error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA']; } + + $bot_name = false; + if ($bot_id) + { + $sql = 'SELECT u.username_clean + FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . " u + WHERE b.bot_id = $bot_id + AND u.user_id = b.user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + if (!$bot_row) + { + $error[] = $user->lang['NO_BOT']; + } + else + { + $bot_name = $row['username_clean']; + } + } + if (!$this->validate_botname($bot_row['bot_name'], $bot_name)) + { + $error[] = $user->lang['BOT_NAME_TAKEN']; + } + if (!sizeof($error)) { // New bot? Create a new user and group entry @@ -180,6 +205,7 @@ class acp_bots { trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } + $user_id = user_add(array( 'user_type' => (int) USER_IGNORE, @@ -193,7 +219,7 @@ class acp_bots 'user_style' => (int) $bot_row['bot_style'], 'user_allow_massemail' => 0, )); - + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => (int) $user_id, 'bot_name' => (string) $bot_row['bot_name'], @@ -202,7 +228,7 @@ class acp_bots 'bot_ip' => (string) $bot_row['bot_ip']) ); $db->sql_query($sql); - + $log = 'ADDED'; } else if ($bot_id) @@ -249,11 +275,12 @@ class acp_bots $log = 'UPDATED'; } - + $cache->destroy('_bots'); - + add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']); trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&id=$bot_id&action=$action")); + } } else if ($bot_id) @@ -348,6 +375,31 @@ class acp_bots } $db->sql_freeresult($result); } + + function validate_botname($newname, $oldname = false) + { + global $db; + if ($oldname && utf8_clean_string($newname) === $oldname) + { + return true; + } + // Admins might want to use names otherwise forbidden, thus we only check for duplicates. + $sql = 'SELECT username + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($newname)) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + return false; + } + else + { + return true; + } + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 66bc377490..ebf058850f 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -276,14 +276,14 @@ class acp_icons $image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array(); $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array(); $image_emotion = request_var('emotion', array('' => ''), true); - $image_code = request_var('code', array('' => '')); + $image_code = request_var('code', array('' => ''), true); $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array(); // Ok, add the relevant bits if we are adding new codes to existing emoticons... if (!empty($_POST['add_additional_code'])) { $add_image = request_var('add_image', ''); - $add_code = request_var('add_code', ''); + $add_code = request_var('add_code', '', true); $add_emotion = request_var('add_emotion', '', true); if ($add_image && $add_emotion && $add_code) @@ -336,7 +336,7 @@ class acp_icons } // Image_order holds the 'new' order value - if (!empty($image_order[$image])) + if (!empty($image_order[$image]) && !empty($$image_id[$image])) { $img_sql = array_merge($img_sql, array( $fields . '_order' => $image_order[$image]) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index b944765011..f7205a6b7a 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -270,6 +270,10 @@ class acp_main global $cache; $cache->purge(); + + // Clear permissions + $auth->acl_clear_prefetch(); + add_log('admin', 'LOG_PURGE_CACHE'); break; } diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 342d89addd..d18d64b076 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -49,9 +49,16 @@ class acp_php_info $output = preg_replace('#<table[^>]+>#i', '<table>', $output); $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); - + + if (empty($output)) + { + trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); + } + + $orig_output = $output; + preg_match_all('#<div class="center">(.*)</div>#siU', $output, $output); - $output = $output[1][0]; + $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output; $template->assign_var('PHPINFO', $output); } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 9f2b3579e8..db5bca1ba6 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -249,8 +249,8 @@ parse_css_file = {PARSE_CSS_FILE} while ($row = $db->sql_fetchrow($result)) { - if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime']) - { +// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime']) +// { // get folder info from the filename if (($slash_pos = strrpos($row['template_filename'], '/')) === false) { @@ -258,9 +258,9 @@ parse_css_file = {PARSE_CSS_FILE} } else { - $filelist[substr($row['template_filename'], 0, $slash_pos + 1)] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1); + $filelist[substr($row['template_filename'], 0, $slash_pos + 1)][] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1); } - } +// } } $db->sql_freeresult($result); @@ -739,6 +739,8 @@ parse_css_file = {PARSE_CSS_FILE} // destroy the cached version of the template (filename without extension) $this->clear_template_cache($template_info, array(substr($template_file, 0, -5))); + $cache->destroy('sql', STYLES_TABLE); + add_log('admin', 'LOG_TEMPLATE_EDIT', $template_info['template_name'], $template_file); trigger_error($user->lang['TEMPLATE_FILE_UPDATED'] . $additional . adm_back_link($this->u_action . "&action=edit&id=$template_id&text_rows=$text_rows&template_file=$template_file")); } @@ -779,7 +781,7 @@ parse_css_file = {PARSE_CSS_FILE} } else { - $filelist[$file_info['dirname'] . '/'][] = "{$file_info['basename']}.{$file_info['extension']}"; + $filelist[$file_info['dirname'] . '/'][] = $file_info['basename']; } } @@ -2169,6 +2171,14 @@ parse_css_file = {PARSE_CSS_FILE} $filelist = filelist("{$phpbb_root_path}styles/{$style_row['template_path']}/template", '', 'html'); $this->store_templates('insert', $style_id, $style_row['template_path'], $filelist); } + else + { + // We no longer store within the db, but are also not able to update the file structure + // Since the admin want to switch this, we adhere to his decision. But we also need to remove the cache + $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . " + WHERE template_id = $style_id"; + $db->sql_query($sql); + } $sql_ary += array( 'template_storedb' => $store_db, diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 02d4c6bb3c..03f2db7d15 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -42,15 +42,28 @@ class acp_update $announcement_url = trim($info[1]); $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); + // Determine automatic update... + $sql = 'SELECT config_value + FROM ' . CONFIG_TABLE . " + WHERE config_name = 'version_update_from'"; + $result = $db->sql_query($sql); + $version_update_from = (string) $db->sql_fetchfield('config_value'); + $db->sql_freeresult($result); + + $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_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action, 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], + 'AUTO_VERSION' => $version_update_from, 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), )); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7d0b00cc25..a7518a287c 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -591,7 +591,7 @@ class auth_admin extends auth ORDER BY left_id'; $result = $db->sql_query($sql); - $forum_names = array(); + $forum_names = array(0 => ''); while ($row = $db->sql_fetchrow($result)) { $forum_names[$row['forum_id']] = $row['forum_name']; diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index d9200ee182..af8d523ab1 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -118,7 +118,7 @@ class dbal_firebird extends dbal { if (strlen($regs[3]) > 32767) { - preg_match_all('/\'(?:[^\']++|\'\')*+\'|\\d+/', $regs[3], $vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); $inserts = $vals[0]; unset($vals); @@ -135,13 +135,13 @@ class dbal_firebird extends dbal $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; } } - else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data)) + else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data)) { if (strlen($data[3]) > 32767) { $update = $data[1]; $where = $data[4]; - preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[3], $temp, PREG_SET_ORDER); + preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[3], $temp, PREG_SET_ORDER); unset($data); $cols = array(); @@ -164,7 +164,7 @@ class dbal_firebird extends dbal } } - if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+))*+\s+(WHERE.*)$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*WHERE\s*(.*)$/s', $query, $regs))) + if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+\s+(WHERE.*)$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*WHERE\s*(.*)$/s', $query, $regs))) { $affected_sql = 'SELECT COUNT(*) as num_rows_affected FROM ' . $regs[1] . ' ' . $regs[2]; diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 76a920d4b8..888a9fd4bf 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -115,7 +115,7 @@ class dbal_oracle extends dbal */ function _rewrite_where($where_clause) { - preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<>)\s*((?>\'(?>[^\']++|\'\')*+\'|\d+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); + preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<>)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); $out = ''; foreach ($result as $val) { @@ -143,7 +143,7 @@ class dbal_oracle extends dbal $in_clause = array(); $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1); $extra = false; - preg_match_all('/\'(?>[^\']++|\'\')*+\'|\d++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?>[^\']++|\'\')*+\'|[\d-.]++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); $i = 0; foreach ($sub_vals[0] as $sub_val) { @@ -239,7 +239,7 @@ class dbal_oracle extends dbal if (strlen($regs[3]) > 4000) { $cols = explode(', ', $regs[2]); - preg_match_all('/\'(?:[^\']++|\'\')*+\'|\\d+/', $regs[3], $vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?:[^\']++|\'\')*+\'|\[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); $inserts = $vals[0]; unset($vals); @@ -256,13 +256,13 @@ class dbal_oracle extends dbal $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; } } - else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) + else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) { if (strlen($data[0][2]) > 4000) { $update = $data[0][1]; $where = $data[0][3]; - preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER); + preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[0][2], $temp, PREG_SET_ORDER); unset($data); $cols = array(); @@ -288,7 +288,7 @@ class dbal_oracle extends dbal switch (substr($query, 0, 6)) { case 'DELETE': - if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))*+)$/', $query, $regs)) + if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))*+)$/', $query, $regs)) { $query = $regs[1] . $this->_rewrite_where($regs[2]); unset($regs); @@ -296,7 +296,7 @@ class dbal_oracle extends dbal break; case 'UPDATE': - if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) + if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) { $query = $regs[1] . $this->_rewrite_where($regs[2]); unset($regs); @@ -304,7 +304,7 @@ class dbal_oracle extends dbal break; case 'SELECT': - $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); + $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); break; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a91bddd9b8..caf26bf379 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -472,7 +472,7 @@ if (!function_exists('stripos')) if (!function_exists('realpath')) { - if (substr(PHP_OS, 0, 3) != 'WIN' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) + if (DIRECTORY_SEPARATOR != '\\' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) { /** * @author Chris Smith <chris@project-minerva.org> @@ -497,7 +497,7 @@ if (!function_exists('realpath')) */ function is_absolute($path) { - return ($path[0] == '/' || (substr(PHP_OS, 0, 3) == 'WIN' && preg_match('#^[a-z]:/#i', $path))) ? true : false; + return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false; } /** @@ -3608,7 +3608,7 @@ function phpbb_checkdnsrr($host, $type = '') { $type = (!$type) ? 'MX' : $type; - if (strpos(PHP_OS, 'WIN') !== false) + if (DIRECTORY_SEPARATOR == '\\') { if (!function_exists('exec')) { diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 414f6f2f20..4037fb4872 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -224,7 +224,13 @@ function make_uid($timestamp) */ function validate_website($url) { - return ($url == 'http://') ? '' : $url; + if ($url === 'http://'){ + return ''; + } + else if (strpos(strtolower($url), 'http://') !== 0) + { + return 'http://' . $url; + } } /** @@ -2413,4 +2419,14 @@ function get_smiley_display() return ($smiley_count < 50) ? 1 : 0; } + +function fill_dateformat($user_dateformat) +{ + global $config; + + return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat); +} + + + ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 61ac1883b3..133ef294b0 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -13,14 +13,7 @@ */ function can_load_dll($dll) { - global $suffix; - - if (empty($suffix)) - { - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - } - - return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . ".$suffix")) ? true : false; + return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false; } /** diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index eb2a7245a5..def15c67c7 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -12,7 +12,7 @@ * * Jabber class from Flyspray project * -* @version class.jabber2.php 1244 2007-05-28 +* @version class.jabber2.php 1306 2007-06-21 * @copyright 2006 Flyspray.org * @author: Florian Schmitz (floele) * @@ -31,6 +31,7 @@ class jabber var $username; var $password; var $use_ssl; + var $resource = 'functions_jabber.phpbb.php'; var $enable_logging; var $log_array; @@ -76,18 +77,32 @@ class jabber return false; } - // Make sure the encryption stream is supported + /** + * Make sure the encryption stream is supported + * Also seem to work without the crypto stream if correctly compiled + $streams = stream_get_wrappers(); if (!in_array('streams.crypto', $streams)) { return false; } + */ return true; } /** + * Sets the resource which is used. No validation is done here, only escaping. + * @param string $name + * @access public + */ + function set_resource($name) + { + $this->resource = $name; + } + + /** * Connect */ function connect() @@ -126,7 +141,7 @@ class jabber // disconnect gracefully if (isset($this->session['sent_presence'])) { - $this->presence('offline', '', true); + $this->send_presence('offline', '', true); } $this->send('</stream:stream>'); @@ -379,7 +394,7 @@ class jabber } // go on with authentication? - if (isset($this->features['stream:features'][0]['#']['bind'])) + if (isset($this->features['stream:features'][0]['#']['bind']) || $this->session['tls']) { return $this->response($this->features); } @@ -394,9 +409,9 @@ class jabber $this->send("<iq type='set' id='bind_1'> <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'> - <resource>functions_jabber.phpbb.php</resource> + <resource>" . utf8_htmlspecialchars($this->resource) . '</resource> </bind> - </iq>"); + </iq>'); return $this->response($this->listen()); } diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 26ff1491fb..b2cb5ec054 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -52,7 +52,7 @@ class messenger $this->addresses['to'][$pos]['email'] = trim($address); // If empty sendmail_path on windows, PHP changes the to line - if (!$config['smtp_delivery'] && strpos(strtolower(PHP_OS), 'win') === 0) + if (!$config['smtp_delivery'] && DIRECTORY_SEPARATOR == '\\') { $this->addresses['to'][$pos]['name'] = ''; } @@ -556,6 +556,7 @@ class queue $fp = @fopen($this->cache_file . '.lock', 'wb'); fclose($fp); + @chmod($this->cache_file . '.lock', 0666); include($this->cache_file); @@ -683,6 +684,8 @@ class queue fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_file, 0666); } } @@ -722,6 +725,8 @@ class queue fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_file, 0666); } } } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index bbb44d4b3d..1010de643b 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -123,6 +123,22 @@ class p_master // Re-index (this is needed, else we are not able to array_slice later) $this->module_cache['modules'] = array_merge($this->module_cache['modules']); + // Include MOD _info files for populating language entries within the menus + if (file_exists($user->lang_path . 'mods')) + { + $add_files = array(); + + foreach (glob($user->lang_path . 'mods/info_' . strtolower($this->p_class) . '_*.' . $phpEx, GLOB_NOSORT) as $file) + { + $add_files[] = 'mods/' . substr(basename($file), 0, -(strlen($phpEx) + 1)); + } + + if (sizeof($add_files)) + { + $user->add_lang($add_files); + } + } + // Now build the module array, but exclude completely empty categories... $right_id = false; $names = array(); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 282e74fa7c..21b2677483 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -115,11 +115,16 @@ function update_post_information($type, $ids, $return_update_sql = false) { global $db; + if (empty($ids)) + { + return; + } if (!is_array($ids)) { $ids = array($ids); } + $update_sql = $empty_forums = $not_empty_forums = array(); if ($type != 'topic') @@ -1310,6 +1315,29 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $db->sql_transaction('begin'); + // we must make sure to update forums that contain the shadow'd topic + if ($post_mode == 'delete_topic') + { + $shadow_forum_ids = array(); + + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_id); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($shadow_forum_ids[(int) $row['forum_id']])) + { + $shadow_forum_ids[(int) $row['forum_id']] = 1; + } + else + { + $shadow_forum_ids[(int) $row['forum_id']]++; + } + } + $db->sql_freeresult($result); + } + if (!delete_posts('post_id', array($post_id), false, false)) { // Try to delete topic, we may had an previous error causing inconsistency @@ -1327,6 +1355,15 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) switch ($post_mode) { case 'delete_topic': + + foreach ($shadow_forum_ids as $updated_forum => $topic_count) + { + // counting is fun! we only have to do sizeof($forum_ids) number of queries, + // even if the topic is moved back to where its shadow lives (we count how many times it is in a forum) + $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_topics_real = forum_topics_real - ' . $topic_count . ', forum_topics = forum_topics - ' . $topic_count . ' WHERE forum_id = ' . $updated_forum); + update_post_information('forum', $updated_forum); + } + delete_topics('topic_id', array($topic_id), false); if ($data['topic_type'] != POST_GLOBAL) @@ -2005,6 +2042,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // We make a new topic // We reply to a topic // We edit the last post in a topic and this post is the latest in the forum (maybe) + // We edit the only post in the topic + // We edit the first post in the topic and all the other posts are not approved if (($post_mode == 'post' || $post_mode == 'reply') && $post_approved) { $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . $data['post_id']; @@ -2014,9 +2053,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'"; } - else if ($post_mode == 'edit_last_post') + else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) { - // edit_last_post does not _necessarily_ mean that we must update the info again, + // this does not _necessarily_ mean that we must update the info again, // it just means that we might have to $sql = 'SELECT forum_last_post_id, forum_last_post_subject FROM ' . FORUMS_TABLE . ' @@ -2025,7 +2064,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // this post is the last post in the forum, better update + // this post is the latest post in the forum, better update if ($row['forum_last_post_id'] == $data['post_id']) { if ($post_approved && $row['forum_last_post_subject'] !== $subject) @@ -2065,7 +2104,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } else { - // just our luck, the last topic in the forum has just been globalized... + // just our luck, the last topic in the forum has just been turned unapproved... $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = 0'; $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = ''"; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = 0'; @@ -2164,13 +2203,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $current_time; } - else if ($post_mode == 'edit_last_post') + else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) { // only the subject can be changed from edit $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; } } - else if (!$data['post_approved'] && $post_mode == 'edit_last_post') + else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))) { // like having the rug pulled from under us $sql = 'SELECT MAX(post_id) as last_post_id @@ -2248,7 +2287,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error('NO_SUCH_SEARCH_MODULE'); } - require_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + if (!class_exists($search_type)) + { + include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + } $error = false; $search = new $search_type($error); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 47d3ae03a9..7c5e39c3a7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -469,8 +469,8 @@ class custom_profile // case 'datetime': case 'date': $date = explode('-', $value); - $month = (isset($date[0])) ? (int) $date[0] : 0; - $day = (isset($date[1])) ? (int) $date[1] : 0; + $day = (isset($date[0])) ? (int) $date[0] : 0; + $month = (isset($date[1])) ? (int) $date[1] : 0; $year = (isset($date[2])) ? (int) $date[2] : 0; if (!$day && !$month && !$year) @@ -479,7 +479,8 @@ class custom_profile } else if ($day && $month && $year) { - return sprintf('%4d-%02d-%02d', $year, $month, $day); + global $user; + return $user->format_date(mktime(0, 0, 0, $month, $day, $year), $user->lang['DATE_FORMAT'], true); } return $value; diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index aacb4c6ddb..0d8a39eaee 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -752,8 +752,7 @@ class template_compile @flock($fp, LOCK_UN); @fclose($fp); - @umask(0); - @chmod($filename, 0644); + @chmod($filename, 0666); } return; diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index c317260a2e..f2ecbdef5b 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -37,7 +37,7 @@ class mcp_ban { // Grab the list of entries - $ban = request_var('ban', ''); + $ban = request_var('ban', '', ($mode === 'user') true ? false); $ban_len = request_var('banlength', 0); $ban_len_other = request_var('banlengthother', ''); $ban_exclude = request_var('banexclude', 0); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index be94521b14..8617cb5ca7 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -451,6 +451,8 @@ function close_report($report_id_list, $mode, $action) $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); } $success_msg = ''; + $forum_ids = array(); + $topic_ids = array(); $s_hidden_fields = build_hidden_fields(array( 'i' => 'reports', @@ -586,6 +588,13 @@ function close_report($report_id_list, $mode, $action) $messenger->send($reporter['user_notify_type']); } } + + foreach($post_info as $post) + { + $forum_ids[$post['forum_id']] = $post['forum_id']; + $topic_ids[$post['topic_id']] = $post['topic_id']; + } + unset($notify_reporters, $post_info, $reports); $messenger->save_queue(); @@ -607,7 +616,18 @@ function close_report($report_id_list, $mode, $action) else { meta_refresh(3, $redirect); - trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); + $return_forum = ''; + if (sizeof($forum_ids == 1)) + { + $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; + } + $return_topic = ''; + if (sizeof($topic_ids == 1)) + { + $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; + } + + trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); } } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 1a70a7fd80..3579467bff 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1229,7 +1229,7 @@ class parse_message extends bbcode_firstpass while ($row = $db->sql_fetchrow($result)) { // (assertion) - $match[] = '#(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)#'; + $match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)'; $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result); @@ -1239,7 +1239,7 @@ class parse_message extends bbcode_firstpass { if ($max_smilies) { - $num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches); + $num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches); unset($matches); if ($num_matches !== false && $num_matches > $max_smilies) @@ -1249,7 +1249,8 @@ class parse_message extends bbcode_firstpass } } - $this->message = trim(preg_replace($match, $replace, $this->message)); + // Make sure the delimiter # is added in front and at the end of every element within $match + $this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message)); } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index c297a961a8..495fdcee48 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -43,6 +43,7 @@ class session if (!$script_name) { $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, strpos($script_name, '?')) : $script_name; $page_array['failover'] = 1; } @@ -884,13 +885,13 @@ class session { if (!is_array($user_ips)) { - $ip_banned = preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips); + $ip_banned = preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips); } else { foreach ($user_ips as $user_ip) { - if (preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ip)) { $ip_banned = true; break; @@ -901,7 +902,7 @@ class session if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || $ip_banned || - (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $user_email))) + (!empty($row['ban_email']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_email'], '#')) . '$#i', $user_email))) { if (!empty($row['ban_exclude'])) { @@ -917,7 +918,7 @@ class session { $ban_triggered_by = 'user'; } - else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips)) + else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips)) { $ban_triggered_by = 'ip'; } @@ -1510,29 +1511,32 @@ class user extends session } } - // Make sure the user is able to hide his session - if (!$this->data['session_viewonline']) + if (isset($this->data['session_viewonline'])) { - // Reset online status if not allowed to hide the session... - if (!$auth->acl_get('u_hideonline')) + // Make sure the user is able to hide his session + if (!$this->data['session_viewonline']) { - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET session_viewonline = 1 - WHERE session_user_id = ' . $this->data['user_id']; - $db->sql_query($sql); - $this->data['session_viewonline'] = 1; + // Reset online status if not allowed to hide the session... + if (!$auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 1 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 1; + } } - } - else if (!$this->data['user_allow_viewonline']) - { - // the user wants to hide and is allowed to -> cloaking device on. - if ($auth->acl_get('u_hideonline')) + else if (!$this->data['user_allow_viewonline']) { - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET session_viewonline = 0 - WHERE session_user_id = ' . $this->data['user_id']; - $db->sql_query($sql); - $this->data['session_viewonline'] = 0; + // the user wants to hide and is allowed to -> cloaking device on. + if ($auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 0 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 0; + } } } @@ -1624,9 +1628,18 @@ class user extends session // - add appropriate variables here, name them as they are used within the language file... if (!$use_db) { - if ((include($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx")) === false) + if ($use_help && strpos($lang_file, '/') !== false) + { + $language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx; + } + else + { + $language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx; + } + + if ((include($language_filename)) === false) { - trigger_error("Language file {$this->lang_path}" . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx couldn't be opened.", E_USER_ERROR); + trigger_error("Language file $language_filename couldn't be opened.", E_USER_ERROR); } } else if ($use_db) diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index d926801b2f..d517ca2d1b 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -812,7 +812,7 @@ class ucp_groups $user->add_lang('acp/groups'); // Approve, demote or promote - group_user_attributes('approve', $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false); + group_user_attributes('approve', $group_id, $mark_ary, false, false); trigger_error($user->lang['USERS_APPROVED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); @@ -836,6 +836,8 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } + $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + if (confirm_box(true)) { if (!sizeof($mark_ary)) @@ -910,6 +912,8 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } + $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + if (confirm_box(true)) { if (!$group_id) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 105dda1d8c..e296ad12b1 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -345,6 +345,8 @@ function compose_pm($id, $mode, $action) // "{$phpbb_root_path}ucp.$phpEx?i=pm&mode=compose" confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields)); } + + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id)); } // Handle User/Group adding/removing diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 8a10254a6e..b0e8f098c2 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -123,6 +123,7 @@ class ucp_prefs 'S_DST' => $data['dst'], 'DATE_FORMAT' => $data['dateformat'], + 'A_DATE_FORMAT' => addslashes($data['dateformat']), 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 796c2e19d4..2a542dd6fa 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -31,7 +31,7 @@ unset($dbpasswd); */ $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', - 'version' => '1.0.RC2', + 'version' => '1.0.RC3', 'phpbb_version' => '3.0.0', 'author' => '<a href="http://www.phpbb.com/">phpBB Group</a>', 'dbms' => $dbms, @@ -540,7 +540,7 @@ if (!$get_info) 'autoincrement' => 'smiley_id', array('smiley_id', 'smilies.smilies_id', ''), - array('code', 'smilies.code', 'phpbb_set_encoding'), + array('code', 'smilies.code', array('function1' => 'phpbb_smilie_html_decode', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), array('emotion', 'smilies.emoticon', 'phpbb_set_encoding'), array('smiley_url', 'smilies.smile_url', 'import_smiley'), array('smiley_width', 'smilies.smile_url', 'get_smiley_width'), @@ -862,7 +862,7 @@ if (!$get_info) array('user_lang', $config['default_lang'], ''), array('', 'users.user_lang', ''), array('user_timezone', 'users.user_timezone', ''), - array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding')), + array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding', 'function2' => 'fill_dateformat')), array('user_inactive_reason', '', 'phpbb_inactive_reason'), array('user_inactive_time', '', 'phpbb_inactive_time'), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index eca72b64bd..443855403b 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -216,10 +216,10 @@ function phpbb_insert_forums() 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), 'enable_prune' => ($prune_enabled) ? $row['prune_enable'] : 0, - 'prune_next' => null_to_zero($row['prune_next']), - 'prune_days' => null_to_zero($row['prune_days']), + 'prune_next' => (int) null_to_zero($row['prune_next']), + 'prune_days' => (int) null_to_zero($row['prune_days']), 'prune_viewed' => 0, - 'prune_freq' => null_to_zero($row['prune_freq']), + 'prune_freq' => (int) null_to_zero($row['prune_freq']), 'forum_flags' => phpbb_forum_flags(), @@ -1439,6 +1439,16 @@ function phpbb_avatar_type($type) return 0; } + +/** +* Just undos the replacing of '<' and '>' +*/ +function phpbb_smilie_html_decode($code) +{ + $code = str_replace('<', '<', $code); + return str_replace('>', '>', $code); +} + /** * Transfer avatars, copying the image if it was uploaded */ diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 56327f3a8c..fc5851804c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.RC2'; +$updates_to_version = '3.0.RC3'; if (defined('IN_PHPBB') && defined('IN_INSTALL')) { @@ -332,6 +332,16 @@ $database_update_info = array( ), ), ), + // Changes from 3.0.RC2 to the next version + '3.0.RC2' => array( + // Remove the following keys + 'change_columns' => array( + BANLIST_TABLE => array( + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), + ), + ), + ), ); // Determine mapping database type @@ -620,10 +630,47 @@ if (version_compare($current_version, '3.0.RC1', '<=')) $no_updates = false; } -//if (version_compare($current_version, '3.0.RC2', '<=')) -//{ -// $no_updates = false; -//} +if (version_compare($current_version, '3.0.RC2', '<=')) +{ + $smileys = array(); + $sql = 'SELECT smiley_id, code + FROM ' . SMILIES_TABLE; + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $smileys[$row['smiley_id']] = $row['code']; + } + $db->sql_freeresult($result); + + foreach($smileys as $id => $code) + { + // 2.0 only entitized lt and gt; We need to do something about double quotes. + if (strchr($code, '"') === false) + { + continue; + } + $new_code = str_replace('&', '&', $code); + $new_code = str_replace('<', '<', $new_code); + $new_code = str_replace('>', '>', $new_code); + $new_code = utf8_htmlspecialchars($new_code); + $sql = 'UPDATE ' . SMILIES_TABLE . ' + SET code = \'' . $db->sql_escape($new_code) . '\' + WHERE smiley_id = ' . (int)$id; + $db->sql_query($sql); + } + + $index_list = sql_list_index($map_dbms, ACL_ROLES_DATA_TABLE); + + if (in_array('ath_opt_id', $index_list)) + { + sql_index_drop($map_dbms, 'ath_opt_id', ACL_ROLES_DATA_TABLE); + sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id')); + } + + $no_updates = false; +} _write_result($no_updates, $errored, $error_ary); @@ -647,6 +694,10 @@ $sql = "UPDATE " . CONFIG_TABLE . " WHERE config_name = 'version'"; _sql($sql, $errored, $error_ary); +// Reset permissions +$sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = ''"; +_sql($sql, $errored, $error_ary); /* Optimize/vacuum analyze the tables where appropriate // this should be done for each version in future along with @@ -777,8 +828,8 @@ function _write_result($no_updates, $errored, $error_ary) for ($i = 0; $i < sizeof($error_ary['sql']); $i++) { - echo '<li>' . $lang['ERROR'] . ' :: <strong>' . $error_ary['error_code'][$i]['message'] . '</strong><br />'; - echo $lang['SQL'] . ' :: <strong>' . $error_ary['sql'][$i] . '</strong><br /><br /></li>'; + echo '<li>' . $lang['ERROR'] . ' :: <strong>' . htmlspecialchars($error_ary['error_code'][$i]['message']) . '</strong><br />'; + echo $lang['SQL'] . ' :: <strong>' . htmlspecialchars($error_ary['sql'][$i]) . '</strong><br /><br /></li>'; } echo '</ul> <br /><br />' . $lang['SQL_FAILURE_EXPLAIN'] . '</p>'; @@ -1338,6 +1389,86 @@ function sql_create_index($dbms, $index_name, $table_name, $column) } } +// List all of the indices that belong to a table, +// does not count: +// * UNIQUE indices +// * PRIMARY keys +function sql_list_index($dbms, $table_name) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + $index_array = array(); + + if ($dbms == 'mssql') + { + $sql = "EXEC sp_statistics '$table_name'"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['TYPE'] == 3) + { + $index_array[] = $row['INDEX_NAME']; + } + } + $db->sql_freeresult($result); + } + else + { + switch ($dbms) + { + case 'firebird': + $sql = "SELECT LOWER(RDB$INDEX_NAME) as index_name + FROM RDB$INDICES + WHERE RDB$RELATION_NAME = " . strtoupper($table_name) . " + AND RDB$UNIQUE_FLAG IS NULL + AND RDB$FOREIGN_KEY IS NULL"; + $col = 'index_name'; + break; + + case 'postgres': + $sql = "SELECT ic.relname as index_name + FROM pg_class bc, pg_class ic, pg_index i + WHERE (bc.oid = i.indrelid) + AND (ic.oid = i.indexrelid) + AND (bc.relname = '" . $table_name . "') + AND (i.indisunique != 't') + AND (i.indisprimary != 't')"; + $col = 'index_name'; + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'SHOW KEYS + FROM ' . $table_name .' + WHERE Non_unique = 1'; + $col = 'Key_name'; + break; + + case 'oracle': + $sql = "SELECT index_name + FROM user_indexes + WHERE table_name = '" . $table_name . "' + AND generated = 'N'"; + break; + + case 'sqlite': + $sql = "PRAGMA index_info('" . $table_name . "');"; + $col = 'name'; + break; + } + + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $index_array[] = $row[$col]; + } + $db->sql_freeresult($result); + } + + return array_map('strtolower', $index_array); +} + /** * Change column type (not name!) */ @@ -1373,7 +1504,16 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data) break; case 'postgres': - $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql']; + $default_pos = strpos($column_data['column_type_sql'], ' DEFAULT'); + + if ($default_pos === false) + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type_sql']; + } + else + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . substr($column_data['column_type_sql'], 0, $default_pos) . ', ALTER COLUMN ' . $column_name . ' SET ' . substr($column_data['column_type_sql'], $default_pos + 1); + } _sql($sql, $errored, $error_ary); break; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 5244e656c9..7fd4c881c6 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -380,7 +380,7 @@ class install_install extends module } // Can we find Imagemagick anywhere on the system? - $exe = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? '.exe' : ''; + $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : ''; $magic_home = getenv('MAGICK_HOME'); $img_imagick = ''; @@ -868,8 +868,6 @@ class install_install extends module $available_dbms = get_available_dbms($dbms); $check_exts = array_merge(array($available_dbms[$dbms]['MODULE']), $this->php_dlls_other); - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - foreach ($check_exts as $dll) { if (!@extension_loaded($dll)) @@ -879,7 +877,7 @@ class install_install extends module continue; } - $load_extensions[] = "$dll.$suffix"; + $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX; } } @@ -892,6 +890,8 @@ class install_install extends module } @fclose($fp); + @chmod($phpbb_root_path . 'cache/install_lock', 0666); + $dbpasswd = htmlspecialchars_decode($dbpasswd); $load_extensions = implode(',', $load_extensions); @@ -919,7 +919,7 @@ class install_install extends module // Assume it will work ... if nothing goes wrong below $written = true; - if (!($fp = @fopen($phpbb_root_path . 'config.'.$phpEx, 'w'))) + if (!($fp = @fopen($phpbb_root_path . 'config.' . $phpEx, 'w'))) { // Something went wrong ... so let's try another method $written = false; @@ -932,6 +932,11 @@ class install_install extends module } @fclose($fp); + + if ($written) + { + @chmod($phpbb_root_path . 'config.' . $phpEx, 0644); + } } if (isset($_POST['dldone'])) diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 3a68e271ed..bf1912076f 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -408,11 +408,65 @@ class install_update extends module // Add database update to log add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->latest_version); - $cache->purge(); + // Refresh prosilver css data - this may cause some unhappy users, but + $sql = 'SELECT * + FROM ' . STYLES_THEME_TABLE . " + WHERE theme_name = 'prosilver'"; + $result = $db->sql_query($sql); + $theme = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($theme) + { + $recache = (empty($theme['theme_data'])) ? true : false; + $update_time = time(); + + // We test for stylesheet.css because it is faster and most likely the only file changed on common themes + if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) + { + $recache = true; + $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); + } + else if (!$recache) + { + $last_change = $theme['theme_mtime']; + + foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) + { + if ($last_change < @filemtime($file)) + { + $recache = true; + break; + } + } + } + + if ($recache) + { + include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx); + + $theme['theme_data'] = acp_styles::db_theme_data($theme); + $theme['theme_mtime'] = $update_time; + + // Save CSS contents + $sql_ary = array( + 'theme_mtime' => $theme['theme_mtime'], + 'theme_data' => $theme['theme_data'] + ); + + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE theme_id = ' . $theme['theme_id']; + $db->sql_query($sql); + + $cache->destroy('sql', STYLES_THEME_TABLE); + } + } $db->sql_return_on_error(true); $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); $db->sql_return_on_error(false); + + $cache->purge(); } break; @@ -776,11 +830,18 @@ class install_update extends module global $phpbb_root_path, $template, $user; $this->tpl_name = 'install_update_diff'; + + // Got the diff template itself updated? If so, we are able to directly use it + if (in_array('adm/style/install_update_diff.html', $this->update_info['files'])) + { + $this->tpl_name = '../../install/update/new/adm/style/install_update_diff'; + } + $this->page_title = 'VIEWING_FILE_DIFF'; $status = request_var('status', ''); $file = request_var('file', ''); - $diff_mode = request_var('diff_mode', 'inline'); + $diff_mode = request_var('diff_mode', 'side_by_side'); // First of all make sure the file is within our file update list with the correct status $found_entry = array(); @@ -852,6 +913,8 @@ class install_update extends module 'S_DIFF_CONFLICT_FILE' => true, 'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true)) ); + + $diff = $this->return_diff($phpbb_root_path . $file, $diff->merged_output()); break; } @@ -947,7 +1010,11 @@ class install_update extends module } else { - $update_list['no_update'][] = $file; + // Do not include style-related or language-related content + if (strpos($file, 'styles/') !== 0 && strpos($file, 'language/') !== 0) + { + $update_list['no_update'][] = $file; + } } unset($this->update_info['files'][$index]); } @@ -1090,8 +1157,25 @@ class install_update extends module if ($diff->merged_output(false, false, false, true)) { $update_ary['conflicts'] = $diff->_conflicting_blocks; - $update_list['conflict'][] = $update_ary; + // There is one special case... users having merged with a conflicting file... we need to check this + $tmp = array( + 'file1' => file_get_contents($phpbb_root_path . $file), + 'file2' => implode("\n", $diff->merged_orig_output()), + ); + + $diff = &new diff($tmp['file1'], $tmp['file2'], false); + $empty = $diff->is_empty(); + + if ($empty) + { + unset($update_ary['conflicts']); + unset($diff); + $update_list['up_to_date'][] = $update_ary; + return; + } + + $update_list['conflict'][] = $update_ary; unset($diff); return; @@ -1108,6 +1192,8 @@ class install_update extends module if ($empty) { + unset($diff); + $update_list['up_to_date'][] = $update_ary; return; } @@ -1160,6 +1246,19 @@ class install_update extends module { $info = $this->test_update; } + + // If info is false the fsockopen function may not be working. Instead get the latest version from our update file (and pray it is up-to-date) + if ($info === false) + { + $update_info = array(); + include($phpbb_root_path . 'install/update/index.php'); + $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info; + + if ($info !== false) + { + $info = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false; + } + } break; case 'update_info': diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index f1c74512eb..d0f9cf88d1 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -136,8 +136,8 @@ CREATE TABLE phpbb_banlist ( ban_start INTEGER DEFAULT 0 NOT NULL, ban_end INTEGER DEFAULT 0 NOT NULL, ban_exclude INTEGER DEFAULT 0 NOT NULL, - ban_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - ban_give_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL + ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 6c2e2ee24d..7dd9c4e924 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -178,8 +178,8 @@ CREATE TABLE [phpbb_banlist] ( [ban_start] [int] DEFAULT (0) NOT NULL , [ban_end] [int] DEFAULT (0) NOT NULL , [ban_exclude] [int] DEFAULT (0) NOT NULL , - [ban_reason] [varchar] (3000) DEFAULT ('') NOT NULL , - [ban_give_reason] [varchar] (3000) DEFAULT ('') NOT NULL + [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL , + [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 44b292b7e7..7fee7f696d 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -98,8 +98,8 @@ CREATE TABLE phpbb_banlist ( ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - ban_reason text NOT NULL, - ban_give_reason text NOT NULL, + ban_reason varchar(255) DEFAULT '' NOT NULL, + ban_give_reason varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (ban_id), KEY ban_end (ban_end), KEY ban_user (ban_userid, ban_exclude), diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 489c7e7bc5..69889a3db2 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -220,8 +220,8 @@ CREATE TABLE phpbb_banlist ( ban_start number(11) DEFAULT '0' NOT NULL, ban_end number(11) DEFAULT '0' NOT NULL, ban_exclude number(1) DEFAULT '0' NOT NULL, - ban_reason varchar2(3000) DEFAULT '' , - ban_give_reason varchar2(3000) DEFAULT '' , + ban_reason varchar2(765) DEFAULT '' , + ban_give_reason varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index b1ff1d1d11..c49423bcf9 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -199,8 +199,8 @@ CREATE TABLE phpbb_banlist ( ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0), ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0), ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0), - ban_reason varchar(3000) DEFAULT '' NOT NULL, - ban_give_reason varchar(3000) DEFAULT '' NOT NULL, + ban_reason varchar(255) DEFAULT '' NOT NULL, + ban_give_reason varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (ban_id) ); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 321cae118c..81e8c3cf80 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -138,7 +138,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); @@ -205,7 +205,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.RC2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 70b4f8de22..156e4bfc76 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -97,8 +97,8 @@ CREATE TABLE phpbb_banlist ( ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0', ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0', ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_reason text(65535) NOT NULL DEFAULT '', - ban_give_reason text(65535) NOT NULL DEFAULT '' + ban_reason varchar(255) NOT NULL DEFAULT '', + ban_give_reason varchar(255) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 74a80c5047..90676cf6bc 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -356,7 +356,7 @@ $lang = array_merge($lang, array( 'EMAIL_CHECK_MX' => 'Check e-mail domain for valid MX record', 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the e-mail domain provided on registration and profile changes is checked for a valid MX record.', 'FORCE_PASS_CHANGE' => 'Force password change', - 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Set this value to 0 disables this behaviour.', + 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Setting this value to 0 disables this behaviour.', 'FORWARDED_FOR_VALID' => 'Validated <var>X_FORWARDED_FOR</var> header', 'FORWARDED_FOR_VALID_EXPLAIN' => 'Sessions will only be continued if the sent <var>X_FORWARDED_FOR</var> header equals the one sent with the previous request. Bans will be checked against IPs in <var>X_FORWARDED_FOR</var> too.', 'IP_VALID' => 'Session IP validation', diff --git a/phpBB/language/en/acp/bots.php b/phpBB/language/en/acp/bots.php index d06a90d363..a166142d24 100644 --- a/phpBB/language/en/acp/bots.php +++ b/phpBB/language/en/acp/bots.php @@ -33,7 +33,7 @@ if (empty($lang) || !is_array($lang)) // Bot settings $lang = array_merge($lang, array( 'BOTS' => 'Manage bots', - 'BOTS_EXPLAIN' => 'Bots or crawlers are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', + 'BOTS_EXPLAIN' => '"Bots", "spiders" or "crawlers" are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', 'BOT_ACTIVATE' => 'Activate', 'BOT_ACTIVE' => 'Bot active', 'BOT_ADD' => 'Add bot', @@ -51,12 +51,11 @@ $lang = array_merge($lang, array( 'BOT_IP_EXPLAIN' => 'Partial matches are allowed, separate addresses with a comma.', 'BOT_NAME' => 'Bot name', 'BOT_NAME_EXPLAIN' => 'Used only for your own information.', + 'BOT_NAME_TAKEN' => 'The name is already in use on your board and can\'t be used for the Bot.', 'BOT_NEVER' => 'Never', 'BOT_STYLE' => 'Bot style', 'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot.', 'BOT_UPDATED' => 'Existing bot updated successfully.', - 'BOT_VIS' => 'Bot visible', - 'BOT_VIS_EXPLAIN' => 'Allow bot to be seen by all users in online lists.', 'ERR_BOT_AGENT_MATCHES_UA' => 'The bot agent you supplied is similar to the one you are currently using. Please adjust the agent for this bot.', 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 936dc9bf3c..562e3a89cc 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -31,7 +31,7 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups, you can delete, create and edit existing groups. You may choose group leaders, toggle open/closed group status and set the group name and description.', + 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.', 'ADD_USERS' => 'Add users', 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.', @@ -48,7 +48,7 @@ $lang = array_merge($lang, array( 'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.', 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', - 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.', + 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members’ usernames will appear in, leave blank for user default.', 'GROUP_CONFIRM_ADD_USER' => 'Are you sure that you want to add the user %1$s to the group?', 'GROUP_CONFIRM_ADD_USERS' => 'Are you sure that you want to add the users %1$s to the group?', 'GROUP_CREATED' => 'Group has been created successfully.', @@ -59,10 +59,10 @@ $lang = array_merge($lang, array( 'GROUP_DEMOTE' => 'Demote group leader', 'GROUP_DESC' => 'Group description', 'GROUP_DETAILS' => 'Group details', - 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain group wide options such as colouration, rank, etc. Changes made here override users current settings. Please note that group members can alter their avatar unless you set appropriate user permissions.', + 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain group wide options such as colouration, rank, etc. Changes made here override users’ current settings. Please note that group members can override group-avatar settings, unless you set appropriate user permissions.', 'GROUP_ERR_USERS_EXIST' => 'The specified users are already members of this group.', 'GROUP_FOUNDER_MANAGE' => 'Founder manage only', - 'GROUP_FOUNDER_MANAGE_EXPLAIN' => 'Restrict group management for this group for founders only. Users having group permissions are still able to see this group as well as this groups members.', + 'GROUP_FOUNDER_MANAGE_EXPLAIN' => 'Restrict management of this group to founders only. Users having group permissions are still able to see this group as well as this group’s members.', 'GROUP_HIDDEN' => 'Hidden', 'GROUP_LANG' => 'Group language', 'GROUP_LEAD' => 'Group leaders', @@ -86,10 +86,7 @@ $lang = array_merge($lang, array( 'GROUP_RECEIVE_PM' => 'Group able to receive private messages', 'GROUP_RECEIVE_PM_EXPLAIN' => 'Please note that hidden groups are not able to be messaged, regardless of this setting.', 'GROUP_REQUEST' => 'Request', - 'GROUP_SETTINGS' => 'Set user preferences', - 'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.', 'GROUP_SETTINGS_SAVE' => 'Group wide settings', - 'GROUP_TIMEZONE' => 'Group timezone', 'GROUP_TYPE' => 'Group type', 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', 'GROUP_UPDATED' => 'Group preferences updated successfully.', @@ -106,7 +103,7 @@ $lang = array_merge($lang, array( 'NO_PERMISSIONS' => 'Do not copy permissions', 'NO_USERS' => 'You haven’t entered any users.', - 'SPECIAL_GROUPS' => 'Predefined groups', + 'SPECIAL_GROUPS' => 'Pre-defined groups', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', 'TOTAL_MEMBERS' => 'Members', diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 2681dc32cc..193e8cf3a2 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -132,7 +132,7 @@ $help = array( ), array( 0 => 'Why can’t I access a forum?', - 1 => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special authorization. Contact a moderator or board administrator to grant you access.' + 1 => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special permissions. Contact a moderator or board administrator to grant you access.' ), array( 0 => 'Why can’t I add attachments?', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 8f37b52c09..180157d5e0 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -394,7 +394,7 @@ $lang = array_merge($lang, array( 'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.', 'FILE_USED' => 'Information used from', // Single file 'FILES_CONFLICT' => 'Conflict files', - 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified the them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', 'FILES_MODIFIED' => 'Modified files', 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', 'FILES_NEW' => 'New files', @@ -485,16 +485,16 @@ $lang = array_merge($lang, array( <h1>Release announcement</h1> - <p>Please read <a href="%1$s" title="%1$s">the release announcement for the latest version</a> before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.</p> + <p>Please read <a href="%1$s" title="%1$s"><strong>the release announcement for the latest version</strong></a> before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.</p> <br /> - <h1>How to update your installation</h1> + <h1>How to update your installation with the Automatic Update Package</h1> - <p>The recommended way of updating your installation only takes the following steps:</p> + <p>The recommended way of updating your installation listed here is only valid for the automatic update package. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB3 automatically are:</p> <ul style="margin-left: 20px; font-size: 1.1em;"> - <li>Go to the <a href="http://www.phpbb.com/downloads/" title="http://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the correct "phpBB Update Package" archive.<br /><br /></li> + <li>Go to the <a href="http://www.phpbb.com/downloads/" title="http://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Automatic Update Package" archive.<br /><br /></li> <li>Unpack the archive.<br /><br /></li> <li>Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).<br /><br /></li> </ul> @@ -502,9 +502,15 @@ $lang = array_merge($lang, array( <p>Once uploaded your board will be offline for normal users due to the install directory you uploaded now present.<br /><br /> <strong><a href="%2$s" title="%2$s">Now start the update process by pointing your browser to the install folder</a>.</strong><br /> <br /> - You will then be guided through the update process. You will be notified after the update is complete. + You will then be guided through the update process. You will be notified once the update is complete. </p> ', + 'UPDATE_INSTRUCTIONS_INCOMPLETE' => ' + + <h1>Incomplete update detected</h1> + + <p>phpBB detected an incomplete automatic update. Please make sure you followed every step within the automatic update tool. Below you will find the link again, or go directly to your install directory.</p> + ', 'UPDATE_METHOD' => 'Update method', 'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.', 'UPDATE_SUCCESS' => 'Update was successful', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index f4219feb61..6feb16c02c 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -54,6 +54,7 @@ $lang = array_merge($lang, array( 'EMAIL_TOPIC_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. Please note that the topic information is already included in the message. The return address for this message will be set to your e-mail address.', 'EMPTY_ADDRESS_EMAIL' => 'You must provide a valid e-mail address for the recipient.', 'EMPTY_MESSAGE_EMAIL' => 'You must enter a message to be emailed.', + 'EMPTY_MESSAGE_IM' => 'You must enter a message to be send.', 'EMPTY_NAME_EMAIL' => 'You must enter the real name of the recipient.', 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the e-mail.', 'EQUAL_TO' => 'Equal to', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 79b380b14f..4ff4b9be62 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -151,18 +151,19 @@ $lang = array_merge($lang, array( 'POLL_VOTE_CHANGE' => 'Allow re-voting', 'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.', 'POSTED_ATTACHMENTS' => 'Posted attachments', + 'POST_APPROVAL_NOTIFY' => ' You will be notified when your post has been approved.', 'POST_CONFIRMATION' => 'Confirmation of post', 'POST_CONFIRM_EXPLAIN' => 'To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', 'POST_DELETED' => 'This message has been deleted successfully.', 'POST_EDITED' => 'This message has been edited successfully.', - 'POST_EDITED_MOD' => 'This message has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable. You will be notified when your post has been approved.', + 'POST_EDITED_MOD' => 'This message has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable.', 'POST_GLOBAL' => 'Global', 'POST_ICON' => 'Post icon', 'POST_NORMAL' => 'Normal', 'POST_REVIEW' => 'Post review', 'POST_REVIEW_EXPLAIN' => 'At least one new post has been made to this topic. You may wish to review your post in light of this.', 'POST_STORED' => 'This message has been posted successfully.', - 'POST_STORED_MOD' => 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable. You will be notified when your post has been approved.', + 'POST_STORED_MOD' => 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable.', 'POST_TOPIC_AS' => 'Post topic as', 'PROGRESS_BAR' => 'Progress bar', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 720c39635e..641aa74efc 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -47,6 +47,8 @@ $lang = array_merge($lang, array( 'JUMP_TO_POST' => 'Jump to post', + 'LOGIN_EXPLAIN_EGOSEARCH' => 'The board requires you to be registered and logged in to view your own posts.', + 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %d characters and must not contain more than %d characters excluding wildcards.', 'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.', 'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 304b9952d1..4c402d9b59 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -82,7 +82,7 @@ $lang = array_merge($lang, array( 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', 'AVATAR_CATEGORY' => 'Category', - 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, file size %3$dkB.', + 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$d pixels, height: %2$d pixels, file size: %3$dkB.', 'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.', 'AVATAR_GALLERY' => 'Local gallery', 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.', @@ -210,7 +210,7 @@ $lang = array_merge($lang, array( 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', 'HIDE_ONLINE' => 'Hide my online status', - 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting to "No" won\'t become effective until your next visit to the board.', + 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting won\'t become effective until your next visit to the board.', 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', 'HOLD_NEW_MESSAGES_SHORT' => 'New messages will be held back', @@ -441,7 +441,7 @@ $lang = array_merge($lang, array( 'UNWATCH_MARKED' => 'Unwatch marked', 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', 'UPLOAD_AVATAR_URL' => 'Upload from a URL', - 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it will be copied to this site.', + 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image. The image will be copied to this site.', 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only alphanumeric characters.', 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use alphanumeric, space or -+_[] characters.', 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only ASCII characters, so no special symbols.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 76b6aa2d27..dfeaf9801f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -328,7 +328,12 @@ switch ($mode) include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); - $message = request_var('message', '', true); + $message = trim(request_var('message', '', true)); + + if (empty($message)) + { + trigger_error('EMPTY_MESSAGE_IM'); + } $messenger = new messenger(false); @@ -717,7 +722,7 @@ switch ($mode) } else { - if (!$email || !preg_match('#^.*?@(.*?\.)?[a-z0-9\-]+\.[a-z]{2,4}$#i', $email)) + if (!$email || !preg_match('/^' . get_preg_expression('email') . '$/i', $email)) { $error[] = $user->lang['EMPTY_ADDRESS_EMAIL']; } @@ -934,16 +939,16 @@ switch ($mode) $s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } - $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', '%', utf8_clean_string($username))) : ''; - $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', '%', $email)) . ' ' : ''; - $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', '%', $icq)) . ' ' : ''; - $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', '%', $aim)) . ' ' : ''; - $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', '%', $yahoo)) . ' ' : ''; - $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', '%', $msn)) . ' ' : ''; - $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', '%', $jabber)) . ' ' : ''; + $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; + $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; + $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', $db->any_char, $icq)) . ' ' : ''; + $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : ''; + $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : ''; + $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : ''; + $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : ''; $sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; - $sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; + $sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : ''; if ($search_group_id) @@ -1387,11 +1392,12 @@ switch ($mode) 'U_SORT_AIM' => $sort_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_MSN' => $sort_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_YIM' => $sort_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ACTIVE' => $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', 'U_SORT_RANK' => $sort_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), 'U_LIST_CHAR' => $sort_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, + 'S_VIEWONLINE' => $auth->acl_get('u_viewonline'), 'S_MODE_SELECT' => $s_sort_key, 'S_ORDER_SELECT' => $s_sort_dir, 'S_CHAR_OPTIONS' => $s_char_options, diff --git a/phpBB/posting.php b/phpBB/posting.php index 675b390672..403eea5418 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -164,6 +164,10 @@ if ($post_data['forum_password']) } // Check permissions +if ($user->data['is_bot']) +{ + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); +} // Is the user able to read within this forum? if (!$auth->acl_get('f_read', $forum_id)) @@ -716,7 +720,7 @@ if ($submit || $preview || $refresh) } // Validate username - if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) + if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -977,6 +981,7 @@ if ($submit || $preview || $refresh) if ($mode == 'edit') { $data['topic_replies_real'] = $post_data['topic_replies_real']; + $data['topic_replies'] = $post_data['topic_replies']; } unset($message_parser); @@ -989,6 +994,7 @@ if ($submit || $preview || $refresh) { meta_refresh(10, $redirect_url); $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; + $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : $user->lang['POST_APPROVAL_NOTIFY']); } else { diff --git a/phpBB/search.php b/phpBB/search.php index cbc5b6732f..0693b32569 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -85,6 +85,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($search_id == 'egosearch') { $author_id = $user->data['user_id']; + + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']); + } } // If we are looking for authors get their ids diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index 38dd77bdbe..80dd20da99 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -48,7 +48,7 @@ function initInsertions() { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - document.body.focus(); + // document.body.focus(); } } @@ -74,7 +74,7 @@ function bbstyle(bbnumber) function bbfontstyle(bbopen, bbclose) { theSelection = false; - + var textarea = document.forms[form_name].elements[text_name]; textarea.focus(); @@ -325,7 +325,7 @@ function colorPalette(dir, width, height) for (b = 0; b < 5; b++) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); - document.write('<td bgcolor="#' + color + '">'); + document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">'); document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.writeln('</td>'); } diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 7d267410aa..753d83995c 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -27,7 +27,7 @@ <li class="row"> <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;"> <dt> - <!-- IF forumrow.FORUM_IMAGE --><div class="forum-image">{forumrow.FORUM_IMAGE}</div><!-- ENDIF --> + <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF --> <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br /> {forumrow.FORUM_DESC} <!-- IF forumrow.MODERATORS --> diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index cc41ce9c1f..531a90bb42 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -54,11 +54,11 @@ </dl> <dl> <dt><label for="banreason">{L_BAN_REASON}:</label></dt> - <dd><input name="banreason" id="banreason" type="text" class="inputbox" /></dd> + <dd><input name="banreason" id="banreason" type="text" class="inputbox" maxlength="255" /></dd> </dl> <dl> <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> - <dd><input name="bangivereason" id="bangivereason" type="text" class="inputbox" /></dd> + <dd><input name="bangivereason" id="bangivereason" type="text" class="inputbox" maxlength="255" /></dd> </dl> <hr /> diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 081352924e..0f9d1cb792 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -83,7 +83,7 @@ <th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th> <th class="info"><a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a>{L_COMMA_SEPARATOR}<a href="{U_SORT_LOCATION}">{L_LOCATION}</a></th> <th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th> - <th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th> + <!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF --> </tr> </thead> <tbody> @@ -106,7 +106,7 @@ <th class="posts"> </th> <th class="info"> </th> <th class="joined"> </th> - <th class="active"> </th> + <!-- IF U_SORT_ACTIVE --><th class="active"> </th><!-- ENDIF --> </tr> </thead> <tbody> @@ -119,11 +119,11 @@ <td class="posts"><!-- IF memberrow.POSTS --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td> <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE --> <!-- ENDIF --></td> <td>{memberrow.JOINED}</td> - <td>{memberrow.VISITED} </td> + <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED} </td><!-- ENDIF --> </tr> <!-- BEGINELSE --> <tr class="bg1"> - <td colspan="5">{L_NO_MEMBERS}</td> + <td colspan="<!-- IF S_VIEWONLINE -->5<!-- ELSE -->4<!-- ENDIF -->">{L_NO_MEMBERS}</td> </tr> <!-- END memberrow --> </tbody> diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index b12d5314c7..717273baa3 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -13,7 +13,7 @@ <fieldset> <dl class="fields2"> <dt><label>{L_IM_RECIPIENT}:</label></dt> - <dd><strong>{USERNAME}</strong> [ {IM_CONTACT} ]<!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd> + <dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd> </dl> <!-- IF S_SEND_ICQ --> diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index ac7ac9821d..1061d30628 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -80,10 +80,12 @@ function insert_single(user) <dt><label for="joined">{L_JOINED}:</label></dt> <dd><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="joined" id="joined" value="{JOINED}" /></dd> </dl> +<!-- IF S_VIEWONLINE --> <dl> <dt><label for="active">{L_LAST_ACTIVE}:</label></dt> <dd><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="inputbox medium" type="text" name="active" id="active" value="{ACTIVE}" /></dd> </dl> +<!-- ENDIF --> <dl> <dt><label for="count">{L_POSTS}:</label></dt> <dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="inputbox medium" type="text" name="count" id="count" value="{COUNT}" /></dd> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 1f8bd75718..8a6f129f50 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -113,7 +113,7 @@ <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --> <div id="search-box"> - <form action="{U_SEARCH}" method="get" id="search"> + <form action="{U_SEARCH}" method="post" id="search"> <fieldset> <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /> <input class="button2" value="{L_SEARCH}" type="submit" /><br /> @@ -130,8 +130,7 @@ <div class="inner"><span class="corners-top"><span></span></span> <ul class="linklist navlinks"> - <li><a class="icon-home" href="{U_INDEX}" accesskey="h">{L_INDEX}</a></li> - <!-- BEGIN navlinks --><li> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a></li><!-- END navlinks --> + <li><a class="icon-home" href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li> @@ -144,8 +143,8 @@ <ul class="linklist"> <!-- IF not S_IS_BOT --> <!-- IF S_USER_LOGGED_IN --> - <li><a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u" class="icon-ucp">{L_PROFILE}</a></li> <li> + <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u" class="icon-ucp">{L_PROFILE}</a> <!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --> • <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> <!-- IF U_RESTORE_PERMISSIONS --> • @@ -154,12 +153,14 @@ </li> <!-- ENDIF --> <!-- ENDIF --> - <li class="rightside"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" class="icon-faq">{L_FAQ}</a></li> - <!-- IF not S_IS_BOT --> - <!-- IF S_DISPLAY_MEMBERLIST --><li class="rightside"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" class="icon-members">{L_MEMBERLIST}</a></li><!-- ENDIF --> - <!-- IF not S_USER_LOGGED_IN --><li class="rightside"><a href="{U_REGISTER}" class="icon-register">{L_REGISTER}</a></li><!-- ENDIF --> - <li class="rightside"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="l" class="icon-logout">{L_LOGIN_LOGOUT}</a></li> - <!-- ENDIF --> + <li class="rightside"> + <a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" class="icon-faq">{L_FAQ}</a> + <!-- IF not S_IS_BOT --> + <!-- IF S_DISPLAY_MEMBERLIST --><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" class="icon-members">{L_MEMBERLIST}</a> <!-- ENDIF --> + <!-- IF not S_USER_LOGGED_IN --><a href="{U_REGISTER}" class="icon-register">{L_REGISTER}</a> <!-- ENDIF --> + <a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="l" class="icon-logout">{L_LOGIN_LOGOUT}</a> + <!-- ENDIF --> + </li> </ul> <span class="corners-bottom"><span></span></span></div> diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 5f1f061532..56f8cdf709 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -62,7 +62,8 @@ <div id="colour_palette" style="display: none;"> <dl style="clear: left;"> <dt><label>{L_FONT_COLOR}:</label></dt> - <dd><script type="text/javascript"> + <dd> + <script type="text/javascript"> <!-- function change_palette() { @@ -79,7 +80,7 @@ } } - colorPalette('h', 15, 5); + colorPalette('h', 15, 10); //--> </script> </dd> diff --git a/phpBB/styles/prosilver/template/posting_preview.html b/phpBB/styles/prosilver/template/posting_preview.html index f2a5d635dc..5c99d6f5b4 100644 --- a/phpBB/styles/prosilver/template/posting_preview.html +++ b/phpBB/styles/prosilver/template/posting_preview.html @@ -2,20 +2,18 @@ <div class="inner"><span class="corners-top"><span></span></span> <!-- IF S_HAS_POLL_OPTIONS --> - <div class="postbody"> + <div class="content"> <h2>{L_PREVIEW}: {POLL_QUESTION}</h2> <p class="author"><!-- IF L_POLL_LENGTH -->{L_POLL_LENGTH}<br /><!-- ENDIF -->{L_MAX_VOTES}</p> - <div class="content"> - <fieldset class="polls"> - <!-- BEGIN poll_option --> - <dl> - <dt><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label></dt> - <dd style="width: auto;"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF -->/><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd> - </dl> - <!-- END poll_option --> - </fieldset> - </div> + <fieldset class="polls"> + <!-- BEGIN poll_option --> + <dl> + <dt><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label></dt> + <dd style="width: auto;"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF -->/><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd> + </dl> + <!-- END poll_option --> + </fieldset> </div> <span class="corners-bottom"><span></span></span></div> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index a9f57df354..eaf6e6dd03 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -25,7 +25,7 @@ */ window.onload = function() { - for (i = 0; i <= onload_functions.length; i++) + for (var i = 0; i < onload_functions.length; i++) { eval(onload_functions[i]); } @@ -33,7 +33,7 @@ window.onunload = function() { - for (i = 0; i <= onunload_functions.length; i++) + for (var i = 0; i < onunload_functions.length; i++) { eval(onunload_functions[i]); } diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index f10cbd518b..9aba7614d2 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -6,7 +6,7 @@ </div> <!-- IF S_DISPLAY_HISTORY --> - <fieldset class="display-options"> + <fieldset class="display-options clearfix"> <a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a> <a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a> </fieldset> diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index fea21f9693..6ffe6f69c3 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -107,7 +107,7 @@ <script type="text/javascript"> <!-- - var date_format = '{DATE_FORMAT}'; + var date_format = '{A_DATE_FORMAT}'; function customDates() { diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index fde0bd9726..c950055574 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -47,7 +47,7 @@ <!-- IF S_DISPLAY_SEARCHBOX --> <div class="search-box"> - <form method="get" id="forum-search" action="{S_SEARCHBOX_ACTION}"> + <form method="post" id="forum-search" action="{S_SEARCHBOX_ACTION}"> <fieldset> <input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_FORUM}" onclick="if (this.value == '{L_SEARCH_FORUM}') this.value = '';" onblur="if (this.value == '') this.value = '{L_SEARCH_FORUM}';" /> <input class="button2" type="submit" value="{L_SEARCH}" /> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index d6316b12ec..58d1f1a780 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -38,7 +38,7 @@ <!-- IF S_DISPLAY_SEARCHBOX --> <div class="search-box"> - <form method="get" id="topic-search" action="{S_SEARCHBOX_ACTION}"> + <form method="post" id="topic-search" action="{S_SEARCHBOX_ACTION}"> <fieldset> <input class="inputbox search tiny" type="text" name="keywords" id="search_keywords" size="20" value="{L_SEARCH_TOPIC}" onclick="if(this.value=='{L_SEARCH_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{L_SEARCH_TOPIC}';" /> <input class="button2" type="submit" value="{L_SEARCH}" /> @@ -205,8 +205,7 @@ <!-- IF postrow.U_ICQ --><li class="icq-icon"><a href="{postrow.U_ICQ}" title="{L_ICQ}"><span>{L_ICQ}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_YIM --><li class="yahoo-icon"><a href="{postrow.U_YIM}" title="{L_YIM}"><span>{L_YIM}</span></a></li><!-- ENDIF --> <!-- IF postrow.U_AIM --><li class="aim-icon"><a href="{postrow.U_AIM}" title="{L_AIM}"><span>{L_AIM}</span></a></li><!-- ENDIF --> - <!-- IF postrow.U_JABBER --><li class="jabber-icon"><a href="{postrow.U_JABBER}" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF --> - </ul> + <!-- IF postrow.U_JABBER --><li class="jabber-icon"><a href="{postrow.U_JABBER}" onclick="popup('{postrow.U_JABBER}', 550, 320); return false;" title="{L_JABBER}"><span>{L_JABBER}</span></a></li><!-- ENDIF --> </dd> <!-- ENDIF --> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index 15ef6450f6..52bdb1baaa 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -33,17 +33,18 @@ html>body dd label input { vertical-align: text-bottom; } /* Align checkboxes/ra * html .column1, * html .column2 { width: 45%; } /* Nice method for clearing floated blocks without having to insert any extra markup (like spacer above) - From http://www.positioniseverything.net/easyclearing.html */ + From http://www.positioniseverything.net/easyclearing.html #tabs:after, #minitabs:after, .post:after, .navbar:after, fieldset dl:after, ul.topiclist dl:after, ul.linklist:after, dl.polls:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; -} +}*/ -#tabs, #minitabs, .post, .navbar, fieldset dl, ul.topiclist dl, ul.linklist, dl.polls { +.clearfix, #tabs, #minitabs, .post, .navbar, fieldset dl, ul.topiclist dl, ul.linklist, dl.polls { height: 1%; + overflow: hidden; } /* Simple fix so forum and topic lists always have a min-height set, even in IE6 diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 339609b56e..72de8ef8ff 100644 --- a/phpBB/styles/subsilver2/template/editor.js +++ b/phpBB/styles/subsilver2/template/editor.js @@ -48,7 +48,7 @@ function initInsertions() { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - document.body.focus(); + // document.body.focus(); } } diff --git a/phpBB/styles/subsilver2/template/jumpbox.html b/phpBB/styles/subsilver2/template/jumpbox.html index d56823868b..f46fed9f27 100644 --- a/phpBB/styles/subsilver2/template/jumpbox.html +++ b/phpBB/styles/subsilver2/template/jumpbox.html @@ -7,7 +7,7 @@ <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> <!-- BEGIN jumpbox_forums --> - <!-- IF jumpbox_forums.S_FORUM_COUNT eq 2 --><option value="-1">------------------</option><!-- ENDIF --> + <!-- IF jumpbox_forums.S_FORUM_COUNT eq 1 --><option value="-1">------------------</option><!-- ENDIF --> <option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level --> <!-- END level -->{jumpbox_forums.FORUM_NAME}</option> <!-- END jumpbox_forums --> diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html index 7441e4e71c..389f71c6fc 100644 --- a/phpBB/styles/subsilver2/template/mcp_ban.html +++ b/phpBB/styles/subsilver2/template/mcp_ban.html @@ -57,11 +57,11 @@ </tr> <tr> <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td> - <td class="row2"><input name="banreason" type="text" class="post" /></td> + <td class="row2"><input name="banreason" type="text" class="post" maxlength="255" /></td> </tr> <tr> <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td> - <td class="row2"><input name="bangivereason" type="text" class="post" /></td> + <td class="row2"><input name="bangivereason" type="text" class="post" maxlength="255" /></td> </tr> <tr> <td class="cat" colspan="2" align="center"><input type="submit" name="bansubmit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" class="btnlite" /> </td> diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html index 285190c3d5..860bec608d 100644 --- a/phpBB/styles/subsilver2/template/memberlist_im.html +++ b/phpBB/styles/subsilver2/template/memberlist_im.html @@ -14,7 +14,7 @@ </tr> <tr> <td class="row1"><b class="genmed">{L_IM_RECIPIENT}: </b></td> - <td class="row2"><span class="gen"><b>{USERNAME}</b> [ {IM_CONTACT} ]</span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td> + <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td> </tr> <!-- IF S_SEND_AIM --> diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index 253fff9ecf..4d943e348d 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -96,8 +96,12 @@ <td class="row2"><input class="post" type="text" name="yahoo" value="{YAHOO}" /></td> </tr> <tr> +<!-- IF S_VIEWONLINE --> <td class="row1"><b class="genmed">{L_LAST_ACTIVE}:</b></td> <td class="row2"><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="post" type="text" name="active" value="{ACTIVE}" /></td> +<!-- ELSE --> + <td colspan="2" class="row1"> </td> +<!-- ENDIF --> <td class="row1"><b class="genmed">{L_MSNM}:</b></td> <td class="row2"><input class="post" type="text" name="msn" value="{MSNM}" /></td> </tr> diff --git a/phpBB/ucp.php b/phpBB/ucp.php index b63c07ef2a..e3b665db2b 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -256,7 +256,7 @@ if ($module->is_active('zebra', 'friends')) $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array( USERS_TABLE => 'u', @@ -274,7 +274,7 @@ if ($module->is_active('zebra', 'friends')) AND z.friend = 1 AND u.user_id = z.zebra_id', - 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_allow_viewonline, u.user_colour, u.username', + 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC', )); @@ -283,7 +283,7 @@ if ($module->is_active('zebra', 'friends')) while ($row = $db->sql_fetchrow($result)) { - $which = (time() - $update_time < $row['online_time'] && $row['viewonline'] && $row['user_allow_viewonline']) ? 'online' : 'offline'; + $which = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array( 'USER_ID' => $row['user_id'], diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index f655718d7e..3bd6bfd51d 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -117,7 +117,7 @@ if (!$show_guests) } // Get user list -$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_viewonline +$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_viewonline FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s WHERE u.user_id = s.session_user_id AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . |
