aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acm/acm_file.php2
-rw-r--r--phpBB/includes/acp/acp_forums.php10
-rw-r--r--phpBB/includes/acp/acp_profile.php549
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/db/dbal.php2
-rw-r--r--phpBB/includes/functions_posting.php6
-rw-r--r--phpBB/includes/functions_privmsgs.php16
-rw-r--r--phpBB/includes/functions_profile_fields.php10
-rw-r--r--phpBB/includes/message_parser.php3
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
-rw-r--r--phpBB/includes/ucp/ucp_register.php2
11 files changed, 318 insertions, 286 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 7cfc487518..175ef0ad81 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -389,7 +389,7 @@ class acm
{
if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
{
- return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]];
+ return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
}
return false;
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 8542d44301..ac461772d6 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1082,7 +1082,7 @@ class acp_forums
{
global $db;
- $table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
+ $table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
@@ -1123,6 +1123,7 @@ class acp_forums
$errors = array();
$log_action_posts = $log_action_forums = $posts_to_name = $subforums_to_name = '';
+ $forum_ids = array($forum_id);
if ($action_posts == 'delete')
{
@@ -1166,8 +1167,6 @@ class acp_forums
if ($action_subforums == 'delete')
{
$log_action_forums = 'FORUMS';
-
- $forum_ids = array($forum_id);
$rows = get_forum_branch($forum_id, 'children', 'descending', false);
foreach ($rows as $row)
@@ -1259,11 +1258,6 @@ class acp_forums
WHERE left_id > {$forum_data['right_id']}";
$db->sql_query($sql);
- if (!isset($forum_ids) || !is_array($forum_ids))
- {
- $forum_ids = array($forum_id);
- }
-
// Delete forum ids from extension groups table
$sql = 'SELECT group_id, allowed_forums
FROM ' . EXTENSION_GROUPS_TABLE;
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 65589dd0c1..c361c47c2e 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -549,7 +549,7 @@ class acp_profile
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
}
- }
+ }
}
$step = (isset($_REQUEST['next'])) ? $step + 1 : ((isset($_REQUEST['prev'])) ? $step - 1 : $step);
@@ -933,280 +933,23 @@ class acp_profile
'field_active' => 1
);
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $profile_fields));
+ $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $profile_fields);
+ $db->sql_query($sql);
$field_id = $db->sql_nextid();
}
else
{
- $db->sql_query('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $profile_fields) . "
- WHERE field_id = $field_id");
+ $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $profile_fields) . "
+ WHERE field_id = $field_id";
+ $db->sql_query($sql);
}
if ($action == 'create')
{
-
$field_ident = '_' . $field_ident;
-
- switch (SQL_LAYER)
- {
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'TINYINT(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'MEDIUMINT(8) ';
- break;
-
- case FIELD_INT:
- $sql .= 'BIGINT(20) ';
- break;
- }
-
- break;
-
- case 'sqlite':
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $type = ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $type = 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $type = "TEXT(65535)";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $type = 'TINYINT(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $type = 'MEDIUMINT(8) ';
- break;
-
- case FIELD_INT:
- $type = 'BIGINT(20) ';
- break;
- }
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- if (version_compare(sqlite_libversion(), '3.0') == -1)
- {
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
- ORDER BY type DESC, name;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Create a temp table and populate it, destroy the existing one
- $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
-
- preg_match('#\((.*)\)#s', $row['sql'], $matches);
-
- $new_table_cols = trim($matches[1]);
- $old_table_cols = explode(',', $new_table_cols);
- $column_list = array();
- foreach($old_table_cols as $declaration)
- {
- $entities = preg_split('#\s+#', trim($declaration));
- if ($entities == 'PRIMARY')
- {
- continue;
- }
- $column_list[] = $entities[0];
- }
-
- $columns = implode(',', $column_list);
-
- $new_table_cols = $field_ident . ' ' . $type . ',' . $new_table_cols;
-
- // create a new table and fill it up. destroy the temp one
- $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
- $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
- $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
- }
- else
- {
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident [$type]";
- }
-
-
- break;
-
- case 'mssql':
- case 'mssql_odbc':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' [VARCHAR] (255) ';
- break;
-
- case FIELD_DATE:
- $sql .= '[VARCHAR] (10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "[TEXT]";
- // ADD {$field_ident}_bbcode_uid [VARCHAR] (5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield [INT] UNSIGNED";
- break;
-
- case FIELD_BOOL:
- case FIELD_DROPDOWN:
- $sql .= '[INT] ';
- break;
-
- case FIELD_INT:
- $sql .= '[FLOAT] ';
- break;
- }
-
- break;
-
- case 'postgres':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN \"$field_ident\" ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'INT2 ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'INT4 ';
- break;
-
- case FIELD_INT:
- $sql .= 'INT8 ';
- break;
- }
-
- break;
-
- case 'firebird':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
-
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "BLOB SUB_TYPE TEXT";
- // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield INTEGER UNSIGNED";
- break;
-
- case FIELD_BOOL:
- case FIELD_DROPDOWN:
- $sql .= 'INTEGER ';
- break;
-
- case FIELD_INT:
- $sql .= 'DOUBLE PRECISION ';
- break;
- }
-
- break;
-
- case 'oracle':
-
- // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
- $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
- switch ($field_type)
- {
- case FIELD_STRING:
- $sql .= ' VARCHAR2(255) ';
- break;
-
- case FIELD_DATE:
- $sql .= 'VARCHAR2(10) ';
- break;
-
- case FIELD_TEXT:
- $sql .= "CLOB";
- // ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
- // ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
- break;
-
- case FIELD_BOOL:
- $sql .= 'NUMBER(2) ';
- break;
-
- case FIELD_DROPDOWN:
- $sql .= 'NUMBER(8) ';
- break;
-
- case FIELD_INT:
- $sql .= 'NUMBER(20) ';
- break;
- }
-
- break;
- }
-
- $profile_sql[] = $sql;
+ $profile_sql[] = $this->add_field_ident($field_ident, $field_type);
}
$sql_ary = array(
@@ -1298,9 +1041,9 @@ class acp_profile
else
{
$this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql_ary, array(
- 'field_id' => $field_id,
- 'lang_id' => (int) $default_lang_id,
- 'option_id' => (int) $option_id)
+ 'field_id' => $field_id,
+ 'lang_id' => (int) $default_lang_id,
+ 'option_id' => (int) $option_id)
);
}
}
@@ -1464,6 +1207,276 @@ class acp_profile
}
}
}
+
+ /**
+ * Return sql statement for adding a new field ident (profile field) to the profile fields data table
+ */
+ function add_field_ident($field_ident, $field_type)
+ {
+ global $db;
+
+ switch (SQL_LAYER)
+ {
+ case 'mysql':
+ case 'mysql4':
+ case 'mysqli':
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD `$field_ident` ";
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $sql .= ' VARCHAR(255) ';
+ break;
+
+ case FIELD_DATE:
+ $sql .= 'VARCHAR(10) ';
+ break;
+
+ case FIELD_TEXT:
+ $sql .= "TEXT";
+ // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ $sql .= 'TINYINT(2) ';
+ break;
+
+ case FIELD_DROPDOWN:
+ $sql .= 'MEDIUMINT(8) ';
+ break;
+
+ case FIELD_INT:
+ $sql .= 'BIGINT(20) ';
+ break;
+ }
+
+ break;
+
+ case 'sqlite':
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $type = ' VARCHAR(255) ';
+ break;
+
+ case FIELD_DATE:
+ $type = 'VARCHAR(10) ';
+ break;
+
+ case FIELD_TEXT:
+ $type = "TEXT(65535)";
+ // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield INT(11) UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ $type = 'TINYINT(2) ';
+ break;
+
+ case FIELD_DROPDOWN:
+ $type = 'MEDIUMINT(8) ';
+ break;
+
+ case FIELD_INT:
+ $type = 'BIGINT(20) ';
+ break;
+ }
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ if (version_compare(sqlite_libversion(), '3.0') == -1)
+ {
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '" . PROFILE_FIELDS_DATA_TABLE . "'
+ ORDER BY type DESC, name;";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ // Create a temp table and populate it, destroy the existing one
+ $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
+ $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
+ $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE);
+
+ preg_match('#\((.*)\)#s', $row['sql'], $matches);
+
+ $new_table_cols = trim($matches[1]);
+ $old_table_cols = explode(',', $new_table_cols);
+ $column_list = array();
+
+ foreach ($old_table_cols as $declaration)
+ {
+ $entities = preg_split('#\s+#', trim($declaration));
+ if ($entities == 'PRIMARY')
+ {
+ continue;
+ }
+ $column_list[] = $entities[0];
+ }
+
+ $columns = implode(',', $column_list);
+
+ $new_table_cols = $field_ident . ' ' . $type . ',' . $new_table_cols;
+
+ // create a new table and fill it up. destroy the temp one
+ $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
+ $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
+ $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
+ }
+ else
+ {
+ $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident [$type]";
+ }
+
+ break;
+
+ case 'mssql':
+ case 'mssql_odbc':
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ $sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $sql .= ' [VARCHAR] (255) ';
+ break;
+
+ case FIELD_DATE:
+ $sql .= '[VARCHAR] (10) ';
+ break;
+
+ case FIELD_TEXT:
+ $sql .= "[TEXT]";
+ // ADD {$field_ident}_bbcode_uid [VARCHAR] (5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield [INT] UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ case FIELD_DROPDOWN:
+ $sql .= '[INT] ';
+ break;
+
+ case FIELD_INT:
+ $sql .= '[FLOAT] ';
+ break;
+ }
+
+ break;
+
+ case 'postgres':
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD COLUMN \"$field_ident\" ";
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $sql .= ' VARCHAR(255) ';
+ break;
+
+ case FIELD_DATE:
+ $sql .= 'VARCHAR(10) ';
+ break;
+
+ case FIELD_TEXT:
+ $sql .= "TEXT";
+ // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield INT4 UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ $sql .= 'INT2 ';
+ break;
+
+ case FIELD_DROPDOWN:
+ $sql .= 'INT4 ';
+ break;
+
+ case FIELD_INT:
+ $sql .= 'INT8 ';
+ break;
+ }
+
+ break;
+
+ case 'firebird':
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $sql .= ' VARCHAR(255) ';
+ break;
+
+ case FIELD_DATE:
+ $sql .= 'VARCHAR(10) ';
+ break;
+
+ case FIELD_TEXT:
+ $sql .= "BLOB SUB_TYPE TEXT";
+ // ADD {$field_ident}_bbcode_uid VARCHAR(5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield INTEGER UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ case FIELD_DROPDOWN:
+ $sql .= 'INTEGER ';
+ break;
+
+ case FIELD_INT:
+ $sql .= 'DOUBLE PRECISION ';
+ break;
+ }
+
+ break;
+
+ case 'oracle':
+
+ // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
+ $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
+
+ switch ($field_type)
+ {
+ case FIELD_STRING:
+ $sql .= ' VARCHAR2(255) ';
+ break;
+
+ case FIELD_DATE:
+ $sql .= 'VARCHAR2(10) ';
+ break;
+
+ case FIELD_TEXT:
+ $sql .= "CLOB";
+ // ADD {$field_ident}_bbcode_uid VARCHAR2(5) NOT NULL,
+ // ADD {$field_ident}_bbcode_bitfield NUMBER(11) UNSIGNED";
+ break;
+
+ case FIELD_BOOL:
+ $sql .= 'NUMBER(2) ';
+ break;
+
+ case FIELD_DROPDOWN:
+ $sql .= 'NUMBER(8) ';
+ break;
+
+ case FIELD_INT:
+ $sql .= 'NUMBER(20) ';
+ break;
+ }
+
+ break;
+ }
+
+ return $sql;
+ }
}
?> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 83d9e1c950..a69a0f6681 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -618,8 +618,8 @@ class acp_users
// Validation data
$var_ary = array(
- 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'user_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
+ 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'warnings' => array('num'),
);
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index d7a274643a..8660c43546 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -361,7 +361,7 @@ class dbal
// This could happen if the connection could not be established for example (then we are not able to grab the default language)
if (!isset($user->lang['SQL_ERROR_OCCURRED']))
{
- $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persist.';
+ $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persists.';
}
else
{
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index f2dd8d70f4..0fb2f72b2c 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -582,6 +582,12 @@ function create_thumbnail($source, $destination, $mimetype)
imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
}
+ // If we are in safe mode create the destination file prior to using the gd functions to circumvent a PHP bug
+ if (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on')
+ {
+ @touch($destination);
+ }
+
switch ($type['format'])
{
case IMG_GIF:
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index dde811c3f3..b41a2f8b8f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -262,7 +262,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
// Replace Rule Literals
$evaluate = preg_replace('/{(STRING|USER_ID|GROUP_ID)}/', '$rule_row["rule_" . strtolower("\1")]', $evaluate);
- // Eval Statement
+ // Evil Statement
$result = false;
eval('$result = (' . $evaluate . ') ? true : false;');
@@ -447,8 +447,10 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
switch ($rule_ary['action'])
{
case ACTION_PLACE_INTO_FOLDER:
+ // Folder actions have precedence, so we will remove any other ones
$folder_action = true;
$_folder_id = (int) $rule_ary['folder_id'];
+ $move_into_folder = array();
$move_into_folder[$_folder_id][] = $msg_id;
$num_new++;
break;
@@ -458,7 +460,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
{
$unread_ids[] = $msg_id;
}
- $move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
+
+ if (!$folder_action)
+ {
+ $move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
+ }
break;
case ACTION_DELETE_MESSAGE:
@@ -470,7 +476,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
{
$important_ids[] = $msg_id;
}
- $move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
+
+ if (!$folder_action)
+ {
+ $move_into_folder[PRIVMSGS_INBOX][] = $msg_id;
+ }
break;
}
}
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index cbeea2b13d..505e61b67b 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -494,7 +494,15 @@ class custom_profile
return NULL;
}
- return $this->options_lang[$field_id][$lang_id][(int) $value];
+ $value = (int) $value;
+
+ // User not having a value assigned
+ if (!isset($this->options_lang[$field_id][$lang_id][$value]))
+ {
+ return NULL;
+ }
+
+ return $this->options_lang[$field_id][$lang_id][$value];
break;
case 'bool':
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 37376c17e8..8d51a195c6 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -692,7 +692,8 @@ class bbcode_firstpass extends bbcode
else
{
$out .= $buffer . $tok;
- $tok = ($tok == '[') ? ']' : '[]';
+ // $tok = ($tok == '[') ? ']' : '[]';
+ $tok = '[]';
$buffer = '';
}
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 522aa29723..6a557bc264 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -51,8 +51,8 @@ class ucp_profile
// Do not check cur_password, it is the old one.
$var_ary = array(
- 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'new_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
+ 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array(
array('string', false, 6, 60),
array('email', $data['email'])),
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index b364775c7a..727979d439 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -117,8 +117,8 @@ class ucp_register
'username' => array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
array('username')),
- 'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
'new_password' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
+ 'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array(
array('string', false, 6, 60),
array('email')),