diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/auth.php | 14 | ||||
-rw-r--r-- | phpBB/includes/bbcode.php | 14 | ||||
-rw-r--r-- | phpBB/includes/cache.php | 7 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 14 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 68 | ||||
-rw-r--r-- | phpBB/includes/functions_compress.php | 22 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_install.php | 26 | ||||
-rw-r--r-- | phpBB/includes/functions_jabber.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_module.php | 14 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 46 | ||||
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 66 | ||||
-rw-r--r-- | phpBB/includes/functions_template.php | 7 | ||||
-rw-r--r-- | phpBB/includes/functions_transfer.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 38 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 55 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 10 |
19 files changed, 277 insertions, 166 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index de9cc9bac7..c965149018 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Permission/Auth class * @package phpBB3 */ @@ -156,7 +164,7 @@ class auth { global $db; - $sql = 'SELECT forum_id + $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE; if (sizeof($this->acl)) @@ -578,7 +586,7 @@ class auth ) ), - 'WHERE' => 'ao.auth_option_id = a.auth_option_id + 'WHERE' => 'ao.auth_option_id = a.auth_option_id AND a.group_id = ug.group_id AND ug.user_pending = 0 ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " @@ -725,7 +733,7 @@ class auth $hold_ary = array(); - // Grab group settings... + // Grab group settings... $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'a.group_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting', diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index c877d56e2b..6610a5c441 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * BBCode class * @package phpBB3 */ diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index ffccf7ff54..5198abdc3c 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -9,6 +9,7 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { @@ -293,14 +294,14 @@ class cache extends acm { case 'mssql': case 'mssql_odbc': - $sql = 'SELECT user_id, bot_agent, bot_ip + $sql = 'SELECT user_id, bot_agent, bot_ip FROM ' . BOTS_TABLE . ' WHERE bot_active = 1 ORDER BY LEN(bot_agent) DESC'; break; case 'firebird': - $sql = 'SELECT user_id, bot_agent, bot_ip + $sql = 'SELECT user_id, bot_agent, bot_ip FROM ' . BOTS_TABLE . ' WHERE bot_active = 1 ORDER BY CHAR_LENGTH(bot_agent) DESC'; @@ -308,7 +309,7 @@ class cache extends acm // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... default: - $sql = 'SELECT user_id, bot_agent, bot_ip + $sql = 'SELECT user_id, bot_agent, bot_ip FROM ' . BOTS_TABLE . ' WHERE bot_active = 1 ORDER BY LENGTH(bot_agent) DESC'; diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index f6622fb43d..18e92d70c0 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * valid external constants: * PHPBB_MSG_HANDLER * PHPBB_ROOT_PATH diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4672751232..37f510ba8c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -232,7 +232,7 @@ function still_on_time($extra_time = 15) return (ceil($current_time - $start_time) < $max_execution_time) ? true : false; } -/** +/** * * @version Version 0.1 / $Id$ * diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index bfb127b270..05872a907a 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Recalculate Binary Tree function recalc_btree($sql_id, $sql_table, $module_class = '') { @@ -33,13 +41,13 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') if ($substract > 0) { - $sql = "UPDATE $sql_table + $sql = "UPDATE $sql_table SET left_id = left_id - $substract, right_id = right_id - $substract $sql_where"; $db->sql_query($sql); } - $sql = "SELECT $sql_id, parent_id, left_id, right_id + $sql = "SELECT $sql_id, parent_id, left_id, right_id FROM $sql_table $sql_where ORDER BY left_id ASC, parent_id ASC, $sql_id ASC"; @@ -219,7 +227,7 @@ function group_select_options($group_id, $exclude_ids = false, $manage_founder = $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : ''; $sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ') . 'group_founder_manage = ' . (int) $manage_founder : ''; - $sql = 'SELECT group_id, group_name, group_type + $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . " $exclude_sql $sql_and @@ -476,8 +484,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) } $db->sql_freeresult($result); - $sql = 'SELECT forum_id - FROM ' . TOPICS_TABLE . ' + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' WHERE topic_id = ' . $topic_id; $result = $db->sql_query($sql); $forum_row = $db->sql_fetchrow($result); @@ -573,7 +581,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s foreach ($table_ary as $table) { - $sql = "DELETE FROM $table + $sql = "DELETE FROM $table WHERE " . $db->sql_in_set('topic_id', $topic_ids); $db->sql_query($sql); } @@ -596,7 +604,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s if (sizeof($moved_topic_ids)) { - $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $moved_topic_ids); $db->sql_query($sql); } @@ -685,7 +693,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = foreach ($table_ary as $table) { - $sql = "DELETE FROM $table + $sql = "DELETE FROM $table WHERE " . $db->sql_in_set('post_id', $post_ids); $db->sql_query($sql); } @@ -698,12 +706,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = { $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = 0 - WHERE user_id = ' . $poster_id . ' + WHERE user_id = ' . $poster_id . ' AND user_posts < ' . $substract; $db->sql_query($sql); $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = user_posts - ' . $substract . ' - WHERE user_id = ' . $poster_id . ' + WHERE user_id = ' . $poster_id . ' AND user_posts >= ' . $substract; $db->sql_query($sql); } @@ -890,7 +898,7 @@ function delete_attachments($mode, $ids, $resync = true) { if ($mode == 'post' || $mode == 'topic') { - $sql = 'UPDATE ' . POSTS_TABLE . ' + $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_attachment = 0 WHERE ' . $db->sql_in_set('post_id', $post_ids); $db->sql_query($sql); @@ -901,7 +909,7 @@ function delete_attachments($mode, $ids, $resync = true) $remaining = array(); $sql = 'SELECT post_msg_id - FROM ' . ATTACHMENTS_TABLE . ' + FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . ' AND in_message = 0'; $result = $db->sql_query($sql); @@ -916,7 +924,7 @@ function delete_attachments($mode, $ids, $resync = true) if (sizeof($unset_ids)) { - $sql = 'UPDATE ' . POSTS_TABLE . ' + $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_attachment = 0 WHERE ' . $db->sql_in_set('post_id', $unset_ids); $db->sql_query($sql); @@ -925,7 +933,7 @@ function delete_attachments($mode, $ids, $resync = true) $remaining = array(); $sql = 'SELECT post_msg_id - FROM ' . ATTACHMENTS_TABLE . ' + FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . ' AND in_message = 1'; $result = $db->sql_query($sql); @@ -940,7 +948,7 @@ function delete_attachments($mode, $ids, $resync = true) if (sizeof($unset_ids)) { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' SET message_attachment = 0 WHERE ' . $db->sql_in_set('msg_id', $unset_ids); $db->sql_query($sql); @@ -964,7 +972,7 @@ function delete_attachments($mode, $ids, $resync = true) $remaining = array(); $sql = 'SELECT topic_id - FROM ' . ATTACHMENTS_TABLE . ' + FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids); $result = $db->sql_query($sql); @@ -978,7 +986,7 @@ function delete_attachments($mode, $ids, $resync = true) if (sizeof($unset_ids)) { - $sql = 'UPDATE ' . TOPICS_TABLE . ' + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_attachment = 0 WHERE ' . $db->sql_in_set('topic_id', $unset_ids); $db->sql_query($sql); @@ -1864,7 +1872,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { $topic_id = (int) $row['topic_id']; - // Ok, there should be a shadow topic. If there isn't, then there's something wrong with the db. + // Ok, there should be a shadow topic. If there isn't, then there's something wrong with the db. // However, there's not much we can do about it. if (!empty($shadow_topic_data[$topic_id])) { @@ -2047,7 +2055,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync $sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_id) . " - AND poll_start = 0 + AND poll_start = 0 $sql_and"; $result = $db->sql_query($sql); @@ -2063,8 +2071,8 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync $sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_id) . " - AND poll_start > 0 - AND poll_last_vote < $prune_date + AND poll_start > 0 + AND poll_last_vote < $prune_date $sql_and"; $result = $db->sql_query($sql); @@ -2455,7 +2463,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id { $topic_id_list = array_unique($topic_id_list); - // This query is not really needed if move_topics() updates the forum_id field, + // This query is not really needed if move_topics() updates the forum_id field, // although it's also used to determine if the topic still exists in the database $sql = 'SELECT topic_id, forum_id FROM ' . TOPICS_TABLE . ' @@ -2555,7 +2563,7 @@ function update_foes($group_id = false, $user_id = false) // update foes for some user if (is_array($user_id) && sizeof($user_id)) { - $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' WHERE ' . $db->sql_in_set('zebra_id', $user_id) . ' AND foe = 1'; $db->sql_query($sql); @@ -2565,7 +2573,7 @@ function update_foes($group_id = false, $user_id = false) // update foes for some group if (is_array($group_id) && sizeof($group_id)) { - // Grab group settings... + // Grab group settings... $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'a.group_id', @@ -2628,7 +2636,7 @@ function update_foes($group_id = false, $user_id = false) if (sizeof($users)) { - $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' WHERE ' . $db->sql_in_set('zebra_id', $users) . ' AND foe = 1'; $db->sql_query($sql); @@ -2651,7 +2659,7 @@ function update_foes($group_id = false, $user_id = false) if (sizeof($perms)) { - $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . ' AND foe = 1'; $db->sql_query($sql); @@ -2667,9 +2675,9 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li global $db, $user; $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason - FROM ' . USERS_TABLE . ' - WHERE user_type = ' . USER_INACTIVE . - (($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . " + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . " ORDER BY $sort_by"; $result = $db->sql_query_limit($sql, $limit, $offset); @@ -2700,7 +2708,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li $sql = 'SELECT COUNT(user_id) AS user_count FROM ' . USERS_TABLE . ' - WHERE user_type = ' . USER_INACTIVE . + WHERE user_type = ' . USER_INACTIVE . (($limit_days) ? " AND user_inactive_time >= $limit_days" : ''); $result = $db->sql_query($sql); $user_count = (int) $db->sql_fetchfield('user_count'); diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index ade844b262..36b7d575d9 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 -* @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Class for handling archives (compression/decompression) * @package phpBB3 */ @@ -121,7 +129,7 @@ class compress } /** -* Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, +* Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, * Marc Delisle, http://www.phpmyadmin.net/ * * Zip extraction function by Alexandre Tedeschi, alexandrebr at gmail dot com @@ -452,7 +460,7 @@ class compress_zip extends compress * * @package phpBB3 */ -class compress_tar extends compress +class compress_tar extends compress { var $isgz = false; var $isbz = false; @@ -545,7 +553,7 @@ class compress_tar extends compress { $fzclose = ($this->isbz && function_exists('bzclose')) ? 'bzclose' : (($this->isgz && @extension_loaded('zlib')) ? 'gzclose' : 'fclose'); - if ($this->wrote) + if ($this->wrote) { $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 1e5dce49ec..b75747a862 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Display Forums */ function display_forums($root_data = '', $display_moderators = true, $return_moderators = false) @@ -833,8 +841,8 @@ function display_reasons($reason_id = 0) { global $db, $user, $template; - $sql = 'SELECT * - FROM ' . REPORTS_REASONS_TABLE . ' + $sql = 'SELECT * + FROM ' . REPORTS_REASONS_TABLE . ' ORDER BY reason_order ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index d5994f9f98..3e4bd27bcc 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Determine if we are able to load a specified PHP module and do so if possible */ function can_load_dll($dll) @@ -27,7 +35,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'firebird' => array( 'LABEL' => 'FireBird', 'SCHEMA' => 'firebird', - 'MODULE' => 'interbase', + 'MODULE' => 'interbase', 'DELIM' => ';;', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'firebird', @@ -47,7 +55,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'mysql' => array( 'LABEL' => 'MySQL', 'SCHEMA' => 'mysql', - 'MODULE' => 'mysql', + 'MODULE' => 'mysql', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'mysql', @@ -57,7 +65,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'mssql' => array( 'LABEL' => 'MS SQL Server 2000+', 'SCHEMA' => 'mssql', - 'MODULE' => 'mssql', + 'MODULE' => 'mssql', 'DELIM' => 'GO', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql', @@ -67,7 +75,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'mssql_odbc'=> array( 'LABEL' => 'MS SQL Server [ ODBC ]', 'SCHEMA' => 'mssql', - 'MODULE' => 'odbc', + 'MODULE' => 'odbc', 'DELIM' => 'GO', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql_odbc', @@ -77,7 +85,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'oracle' => array( 'LABEL' => 'Oracle', 'SCHEMA' => 'oracle', - 'MODULE' => 'oci8', + 'MODULE' => 'oci8', 'DELIM' => '/', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'oracle', @@ -87,7 +95,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'postgres' => array( 'LABEL' => 'PostgreSQL 7.x/8.x', 'SCHEMA' => 'postgres', - 'MODULE' => 'pgsql', + 'MODULE' => 'pgsql', 'DELIM' => ';', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'postgres', @@ -97,7 +105,7 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'sqlite' => array( 'LABEL' => 'SQLite', 'SCHEMA' => 'sqlite', - 'MODULE' => 'sqlite', + 'MODULE' => 'sqlite', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'sqlite', @@ -199,8 +207,8 @@ function get_tables($db) case 'mssql': case 'mssql_odbc': - $sql = "SELECT name - FROM sysobjects + $sql = "SELECT name + FROM sysobjects WHERE type='U'"; break; diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index e15033b7e0..8575f339c1 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * * Jabber class from Flyspray project * diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 30d2a6fc30..6bce44209a 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Messenger * @package phpBB3 */ @@ -1058,7 +1066,7 @@ class smtp_class // If we are authenticating through pop-before-smtp, we // have to login ones before we get authenticated - // NOTE: on some configurations the time between an update of the auth database takes so + // NOTE: on some configurations the time between an update of the auth database takes so // long that the first email send does not work. This is not a biggie on a live board (only // the install mail will most likely fail) - but on a dynamic ip connection this might produce // severe problems and is not fixable! @@ -1311,7 +1319,7 @@ class smtp_class { $tokens[$matches[1]] = array($tokens[$matches[1]], preg_replace('/^"(.*)"$/', '\\1', $matches[2])); } - } + } else if (!empty($tokens[$matches[1]])) // Any other multiple instance = failure { $tokens = array(); diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 9db2c4fa25..b55c408b8c 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Class handling all types of 'plugins' (a future term) * @package phpBB3 */ diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index d62a0d7719..485ba5028b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Fill smiley templates (or just the variables) with smilies, either in a window or inline */ function generate_smilies($mode, $forum_id) @@ -59,7 +67,7 @@ function generate_smilies($mode, $forum_id) $last_url = ''; $sql = 'SELECT * - FROM ' . SMILIES_TABLE . + FROM ' . SMILIES_TABLE . (($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . ' ORDER BY smiley_order'; $result = $db->sql_query($sql, 3600); @@ -311,7 +319,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) $topic_type_array = array_merge(array(0 => array( 'VALUE' => POST_NORMAL, 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', - 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), + 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), $topic_type_array ); @@ -571,7 +579,7 @@ function get_supported_image_types($type = false) /** * Create Thumbnail */ -function create_thumbnail($source, $destination, $mimetype) +function create_thumbnail($source, $destination, $mimetype) { global $config; @@ -618,7 +626,7 @@ function create_thumbnail($source, $destination, $mimetype) } } - if (!$used_imagick) + if (!$used_imagick) { $type = get_supported_image_types($type); @@ -630,7 +638,7 @@ function create_thumbnail($source, $destination, $mimetype) return false; } - switch ($type['format']) + switch ($type['format']) { case IMG_GIF: $image = @imagecreatefromgif($source); @@ -786,7 +794,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data) } $template->assign_vars(array( - 'FILE_COMMENT' => $filename_data['filecomment'], + 'FILE_COMMENT' => $filename_data['filecomment'], 'FILESIZE' => $config['max_filesize']) ); @@ -1106,7 +1114,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = censor_text($topic_title); // Get banned User ID's - $sql = 'SELECT ban_userid + $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE; $result = $db->sql_query($sql); @@ -1123,7 +1131,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $notify_rows = array(); // -- get forum_userids || topic_userids - $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber + $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " AND w.user_id NOT IN ($sql_ignore_users) @@ -1138,11 +1146,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_email' => $row['user_email'], - 'user_jabber' => $row['user_jabber'], - 'user_lang' => $row['user_lang'], + 'user_jabber' => $row['user_jabber'], + 'user_lang' => $row['user_lang'], 'notify_type' => ($topic_notification) ? 'topic' : 'forum', 'template' => ($topic_notification) ? 'topic_notify' : 'newtopic_notify', - 'method' => $row['user_notify_type'], + 'method' => $row['user_notify_type'], 'allowed' => false ); } @@ -1156,7 +1164,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); } - $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber + $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id AND fw.user_id NOT IN ($sql_ignore_users) @@ -1171,11 +1179,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_email' => $row['user_email'], - 'user_jabber' => $row['user_jabber'], + 'user_jabber' => $row['user_jabber'], 'user_lang' => $row['user_lang'], 'notify_type' => 'forum', 'template' => 'forum_notify', - 'method' => $row['user_notify_type'], + 'method' => $row['user_notify_type'], 'allowed' => false ); } @@ -1224,7 +1232,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $msg_list_ary = array(); foreach ($msg_users as $row) - { + { $pos = (!isset($msg_list_ary[$row['template']])) ? 0 : sizeof($msg_list_ary[$row['template']]); $msg_list_ary[$row['template']][$pos]['method'] = $row['method']; @@ -1253,7 +1261,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id", 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic", - 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum", + 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum", )); $messenger->send($addr['method']); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index e19d191d2c..68e77ec421 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -334,7 +334,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) // Newly processing on-hold messages if ($release) { - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET folder_id = ' . PRIVMSGS_NO_BOX . ' WHERE folder_id = ' . PRIVMSGS_HOLD_BOX . " AND user_id = $user_id"; @@ -423,7 +423,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $user_ids = $memberships = array(); // First of all, grab all rules and retrieve friends/foes - $sql = 'SELECT * + $sql = 'SELECT * FROM ' . PRIVMSGS_RULES_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query($sql); @@ -466,7 +466,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) if (sizeof($user_ids)) { $sql = 'SELECT * - FROM ' . USER_GROUP_TABLE . ' + FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $user_ids) . ' AND user_pending = 0'; $result = $db->sql_query($sql); @@ -581,7 +581,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) // Set messages to Unread if (sizeof($unread_ids)) { - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET pm_unread = 0 WHERE ' . $db->sql_in_set('msg_id', $unread_ids) . " AND user_id = $user_id @@ -614,7 +614,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $sql_folder[] = $full_folder_action; } - $sql = 'SELECT folder_id, pm_count + $sql = 'SELECT folder_id, pm_count FROM ' . PRIVMSGS_FOLDER_TABLE . ' WHERE ' . $db->sql_in_set('folder_id', $sql_folder) . " AND user_id = $user_id"; @@ -684,13 +684,13 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } } - // + // if ($full_folder_action == FULL_FOLDER_HOLD) { $num_not_moved += sizeof($msg_ary); $num_new -= sizeof($msg_ary); - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET folder_id = ' . PRIVMSGS_HOLD_BOX . ' WHERE folder_id = ' . PRIVMSGS_NO_BOX . " AND user_id = $user_id @@ -699,7 +699,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } else { - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " SET folder_id = $dest_folder, pm_new = 0 WHERE folder_id = " . PRIVMSGS_NO_BOX . " AND user_id = $user_id @@ -726,7 +726,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) { // Move from OUTBOX to SENTBOX // We are not checking any full folder status here... SENTBOX is a special treatment (old messages get deleted) - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET folder_id = ' . PRIVMSGS_SENTBOX . ' WHERE folder_id = ' . PRIVMSGS_OUTBOX . ' AND ' . $db->sql_in_set('msg_id', array_keys($action_ary)); @@ -770,7 +770,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol $move_msg_ids = array($move_msg_ids); } - if (sizeof($move_msg_ids) && !in_array($dest_folder, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)) && + if (sizeof($move_msg_ids) && !in_array($dest_folder, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)) && !in_array($cur_folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)) && $cur_folder_id != $dest_folder) { // We have to check the destination folder ;) @@ -843,7 +843,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol $db->sql_query($sql); } } - } + } else if (in_array($cur_folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX))) { trigger_error('CANNOT_MOVE_SPECIAL'); @@ -864,14 +864,14 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) global $db, $user; - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " SET pm_unread = 0 WHERE msg_id = $msg_id AND user_id = $user_id AND folder_id = $folder_id"; $db->sql_query($sql); - $sql = 'UPDATE ' . USERS_TABLE . " + $sql = 'UPDATE ' . USERS_TABLE . " SET user_unread_privmsg = user_unread_privmsg - 1 WHERE user_id = $user_id"; $db->sql_query($sql); @@ -883,7 +883,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) // Try to cope with previous wrong conversions... if ($user->data['user_unread_privmsg'] < 0) { - $sql = 'UPDATE ' . USERS_TABLE . " + $sql = 'UPDATE ' . USERS_TABLE . " SET user_unread_privmsg = 0 WHERE user_id = $user_id"; $db->sql_query($sql); @@ -937,7 +937,7 @@ function handle_mark_actions($user_id, $mark_action) else { $s_hidden_fields = array( - 'cur_folder_id' => $cur_folder_id, + 'cur_folder_id' => $cur_folder_id, 'mark_option' => 'delete_marked', 'submit_mark' => true, 'marked_msg_id' => $msg_ids @@ -1047,8 +1047,8 @@ function delete_pm($user_id, $msg_ids, $folder_id) // if folder id is user defined folder then decrease pm_count if (!in_array($folder_id, array(PRIVMSGS_INBOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX, PRIVMSGS_NO_BOX))) { - $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " - SET pm_count = pm_count - $num_deleted + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET pm_count = pm_count - $num_deleted WHERE folder_id = $folder_id"; $db->sql_query($sql); } @@ -1071,7 +1071,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) } // Now we have to check which messages we can delete completely - $sql = 'SELECT msg_id + $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); $result = $db->sql_query($sql); @@ -1161,7 +1161,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) $address = array(); if (sizeof($u)) { - $sql = 'SELECT user_id, username, user_colour + $sql = 'SELECT user_id, username, user_colour FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $u) . ' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; @@ -1189,7 +1189,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) if ($plaintext) { $sql = 'SELECT group_name, group_type - FROM ' . GROUPS_TABLE . ' + FROM ' . GROUPS_TABLE . ' WHERE ' . $db->sql_in_set('group_id', $g); $result = $db->sql_query($sql); @@ -1290,7 +1290,7 @@ function get_folder_status($folder_id, $folder) } $return = array( - 'folder_name' => $folder['folder_name'], + 'folder_name' => $folder['folder_name'], 'cur' => $folder['num_messages'], 'remaining' => ($user->data['message_limit']) ? $user->data['message_limit'] - $folder['num_messages'] : 0, 'max' => $user->data['message_limit'], @@ -1359,11 +1359,11 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) if (isset($data['address_list']['g']) && sizeof($data['address_list']['g'])) { - $sql = 'SELECT u.user_type, ug.group_id, ug.user_id - FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + $sql = 'SELECT u.user_type, ug.group_id, ug.user_id + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . ' AND ug.user_pending = 0 - AND u.user_id = ug.user_id + AND u.user_id = ug.user_id AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); @@ -1389,7 +1389,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) { case 'reply': case 'quote': - $root_level = ($data['reply_from_root_level']) ? $data['reply_from_root_level'] : $data['reply_from_msg_id']; + $root_level = ($data['reply_from_root_level']) ? $data['reply_from_root_level'] : $data['reply_from_msg_id']; // Set message_replied switch for this user $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' @@ -1405,7 +1405,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $sql_data = array( 'root_level' => $root_level, 'author_id' => $data['from_user_id'], - 'icon_id' => $data['icon_id'], + 'icon_id' => $data['icon_id'], 'author_ip' => $data['from_user_ip'], 'message_time' => $current_time, 'enable_bbcode' => $data['enable_bbcode'], @@ -1450,8 +1450,8 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) } else if ($mode == 'edit') { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' - SET message_edit_count = message_edit_count + 1, ' . $db->sql_build_array('UPDATE', $sql_data) . ' + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET message_edit_count = message_edit_count + 1, ' . $db->sql_build_array('UPDATE', $sql_data) . ' WHERE msg_id = ' . $data['msg_id']; $db->sql_query($sql); } @@ -1481,7 +1481,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $db->sql_multi_insert(PRIVMSGS_TO_TABLE, $sql_ary); - $sql = 'UPDATE ' . USERS_TABLE . ' + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg + 1, user_unread_privmsg = user_unread_privmsg + 1, user_last_privmsg = ' . time() . ' WHERE ' . $db->sql_in_set('user_id', array_keys($recipients)); $db->sql_query($sql); @@ -1593,8 +1593,8 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $draft_id = request_var('draft_loaded', 0); if ($draft_id) { - $sql = 'DELETE FROM ' . DRAFTS_TABLE . " - WHERE draft_id = $draft_id + $sql = 'DELETE FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id AND user_id = " . $data['from_user_id']; $db->sql_query($sql); } @@ -1627,7 +1627,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message) } // Get banned User ID's - $sql = 'SELECT ban_userid + $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . ' WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . ' AND ban_exclude = 0'; @@ -1644,7 +1644,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message) return; } - $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber + $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients))); $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index c7c7ac1215..17d3328427 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -1,14 +1,15 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore */ if (!defined('IN_PHPBB')) { @@ -29,7 +30,7 @@ if (!defined('IN_PHPBB')) * (on its own and in whole) under the LGPL. Section 3 of the LGPL states that any code * derived from an LGPL application may be relicenced under the GPL, this applies * to this source -* +* * DEFINE directive inspired by a request by Cyberalien * * @package phpBB3 diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 2a38c8c7ad..2925a2df77 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Transfer class, wrapper for ftp/sftp/ssh * @package phpBB3 */ diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index d3110869af..8e4bb6284a 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -1,14 +1,22 @@ <?php -/** +/** * * @package phpBB3 -* @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Responsible for holding all file relevant information, as well as doing file-specific operations. * The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. * @package phpBB3 @@ -76,7 +84,7 @@ class filespec /** * Cleans destination filename - * + * * @param real|unique|unique_ext $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename * @param string $prefix Prefix applied to filename * @access public @@ -269,9 +277,9 @@ class filespec { case 'copy': - if (!@copy($this->filename, $this->destination_file)) + if (!@copy($this->filename, $this->destination_file)) { - if (!@move_uploaded_file($this->filename, $this->destination_file)) + if (!@move_uploaded_file($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); return false; @@ -284,9 +292,9 @@ class filespec case 'move': - if (!@move_uploaded_file($this->filename, $this->destination_file)) + if (!@move_uploaded_file($this->filename, $this->destination_file)) { - if (!@copy($this->filename, $this->destination_file)) + if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); return false; @@ -299,7 +307,7 @@ class filespec case 'local': - if (!@copy($this->filename, $this->destination_file)) + if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); return false; @@ -653,7 +661,7 @@ class fileupload $file = new fileerror($user->lang[$this->error_prefix . 'URL_INVALID']); return $file; } - + if (empty($match[2])) { $file = new fileerror($user->lang[$this->error_prefix . 'URL_INVALID']); @@ -813,7 +821,7 @@ class fileupload // check Filename if (preg_match("#[\\/:*?\"<>|]#i", $file->get('realname'))) - { + { $file->error[] = sprintf($user->lang[$this->error_prefix . 'INVALID_FILENAME'], $file->get('realname')); } @@ -842,8 +850,8 @@ class fileupload return true; } - if (($file->get('width') > $this->max_width && $this->max_width) || - ($file->get('height') > $this->max_height && $this->max_height) || + if (($file->get('width') > $this->max_width && $this->max_width) || + ($file->get('height') > $this->max_height && $this->max_height) || ($file->get('width') < $this->min_width && $this->min_width) || ($file->get('height') < $this->min_height && $this->min_height)) { @@ -862,7 +870,7 @@ class fileupload } /** - * Return image type/extension mapping + * Return image type/extension mapping */ function image_types() { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index fe9ba1bc92..8501175d5f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Obtain user_ids from usernames or vice versa. Returns false on * success else the error string * @@ -245,7 +253,7 @@ function user_add($user_row, $cp_data = false) include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); } - $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data)); $db->sql_query($sql); } @@ -527,7 +535,7 @@ function user_delete($mode, $user_id, $post_username = false) continue; } - $sql = 'UPDATE ' . USERS_TABLE . ' + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' WHERE user_id = ' . $_user_id; @@ -553,7 +561,7 @@ function user_delete($mode, $user_id, $post_username = false) /** * Flips user_type from active to inactive and vice versa, handles group membership updates -* +* * @param string $mode can be flip for flipping from active/inactive, activate or deactivate */ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) @@ -582,8 +590,8 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) { $sql_ary = array(); - if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER || - ($mode == 'activate' && $row['user_type'] != USER_INACTIVE) || + if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER || + ($mode == 'activate' && $row['user_type'] != USER_INACTIVE) || ($mode == 'deactivate' && $row['user_type'] == USER_INACTIVE)) { continue; @@ -674,7 +682,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas else { $ban_other = explode('-', $ban_len_other); - if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) && + if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) && (strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2)) { $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0])); @@ -2210,7 +2218,7 @@ function avatar_process_user(&$error, $custom_userdata = false) } } } - if (($config['avatar_max_width'] || $config['avatar_max_height']) && + if (($config['avatar_max_width'] || $config['avatar_max_height']) && (($data['width'] != $userdata['user_avatar_width']) || $data['height'] != $userdata['user_avatar_height'])) { if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height']) @@ -2306,7 +2314,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { $error[] = $user->lang[$err]; } - + if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE))) { $error[] = $user->lang['GROUP_ERR_TYPE']; @@ -2416,7 +2424,6 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow if (sizeof($sql_ary) && sizeof($user_ary)) { group_set_user_default($group_id, $user_ary, $sql_ary); - } $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; @@ -2462,7 +2469,7 @@ function avatar_remove_db($avatar_name) $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', - user_avatar_type = 0 + user_avatar_type = 0 WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\''; $db->sql_query($sql); } @@ -2790,14 +2797,14 @@ function remove_default_avatar($group_id, $user_ids) } $db->sql_freeresult($result); - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_avatar = \'\', - user_avatar_type = 0, - user_avatar_width = 0, - user_avatar_height = 0 - WHERE group_id = ' . (int)$group_id . ' - AND user_avatar = \'' . $db->sql_escape($row['group_avatar']) . '\' - AND ' . $db->sql_in_set('user_id', $user_ids); + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_avatar = '', + user_avatar_type = 0, + user_avatar_width = 0, + user_avatar_height = 0 + WHERE group_id = " . (int) $group_id . " + AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "' + AND " . $db->sql_in_set('user_id', $user_ids); $db->sql_query($sql); } @@ -2833,9 +2840,9 @@ function remove_default_rank($group_id, $user_ids) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_rank = 0 - WHERE group_id = ' . (int)$group_id . ' - AND user_rank <> 0 - AND user_rank = ' . (int)$row['group_rank'] . ' + WHERE group_id = ' . (int)$group_id . ' + AND user_rank <> 0 + AND user_rank = ' . (int)$row['group_rank'] . ' AND ' . $db->sql_in_set('user_id', $user_ids); $db->sql_query($sql); } @@ -2928,7 +2935,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna break; case 'default': - $sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . ' + $sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true); $result = $db->sql_query($sql); @@ -2970,7 +2977,7 @@ function group_validate_groupname($group_id, $group_name) { global $config, $db; - $group_name = utf8_clean_string($group_name); + $group_name = utf8_clean_string($group_name); if (!empty($group_id)) { @@ -3047,8 +3054,6 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal $db->sql_freeresult($result); } - - foreach ($attribute_ary as $attribute => $type) { if (isset($group_attributes[$attribute])) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 1879f38ab4..f80715f211 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -875,7 +875,7 @@ class bbcode_firstpass extends bbcode * Validate url * * @param string $var1 optional url parameter for url bbcode: [url(=$var1)]$var2[/url] - * @param string $var2 url bbcode content: [url(=$var1)]$var2[/url] + * @param string $var2 url bbcode content: [url(=$var1)]$var2[/url] */ function validate_url($var1, $var2) { @@ -921,7 +921,7 @@ class bbcode_firstpass extends bbcode $url = append_sid($url); } - return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']'; + return ($var1) ? '[url=' . $this->bbcode_specialchars($url) . ':' . $this->bbcode_uid . ']' . $var2 . '[/url:' . $this->bbcode_uid . ']' : '[url:' . $this->bbcode_uid . ']' . $this->bbcode_specialchars($url) . '[/url:' . $this->bbcode_uid . ']'; } return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]'; @@ -1221,20 +1221,20 @@ class parse_message extends bbcode_firstpass { case 'mssql': case 'mssql_odbc': - $sql = 'SELECT * + $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ORDER BY LEN(code) DESC'; break; case 'firebird': - $sql = 'SELECT * + $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ORDER BY CHAR_LENGTH(code) DESC'; break; // LENGTH supported by MySQL, IBM DB2, Oracle and Access for sure... default: - $sql = 'SELECT * + $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' ORDER BY LENGTH(code) DESC'; break; |