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_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_jabber.php16
-rw-r--r--phpBB/includes/acp/acp_users.php1
-rw-r--r--phpBB/includes/bbcode.php8
-rw-r--r--phpBB/includes/db/dbal.php4
-rw-r--r--phpBB/includes/db/postgres.php2
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_jabber.php4
-rw-r--r--phpBB/includes/functions_messenger.php2
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php8
-rw-r--r--phpBB/includes/functions_profile_fields.php4
-rw-r--r--phpBB/includes/functions_upload.php18
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/message_parser.php5
-rw-r--r--phpBB/includes/search/fulltext_mysql.php4
-rw-r--r--phpBB/includes/session.php2
-rw-r--r--phpBB/includes/template.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php46
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/includes/ucp/ucp_register.php4
-rw-r--r--phpBB/includes/ucp/ucp_resend.php2
24 files changed, 102 insertions, 46 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index c3567e05a4..69b89a4e2d 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -37,6 +37,8 @@ class acm
{
return false;
}
+
+ return true;
}
function unload()
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 688cb4d20f..cbee63aaf7 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1323,7 +1323,7 @@ class acp_attachments
{
$hostlist_tmp[] = "'" . $row['site_hostname'] . "'";
}
- break;
+ // break;
}
while ($row = $db->sql_fetchrow($result));
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index c81081f685..b4ff8ea854 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -966,6 +966,8 @@ class acp_forums
add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
}
+
+ return $errors;
}
/**
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index ae178aca83..c62cede3df 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -36,12 +36,13 @@ class acp_jabber
$this->tpl_name = 'acp_jabber';
$this->page_title = 'ACP_JABBER_SETTINGS';
- $jab_enable = request_var('jab_enable', $config['jab_enable']);
- $jab_host = request_var('jab_host', $config['jab_host']);
- $jab_port = request_var('jab_port', $config['jab_port']);
- $jab_username = request_var('jab_username', $config['jab_username']);
- $jab_password = request_var('jab_password', $config['jab_password']);
- $jab_resource = request_var('jab_resource', $config['jab_resource']);
+ $jab_enable = request_var('jab_enable', $config['jab_enable']);
+ $jab_host = request_var('jab_host', $config['jab_host']);
+ $jab_port = request_var('jab_port', $config['jab_port']);
+ $jab_username = request_var('jab_username', $config['jab_username']);
+ $jab_password = request_var('jab_password', $config['jab_password']);
+ $jab_resource = request_var('jab_resource', $config['jab_resource']);
+ $jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
$jabber = new jabber();
$error = array();
@@ -160,7 +161,8 @@ class acp_jabber
'JAB_PORT' => $new['jab_port'],
'JAB_USERNAME' => $new['jab_username'],
'JAB_PASSWORD' => $new['jab_password'],
- 'JAB_RESOURCE' => $new['jab_resource'])
+ 'JAB_RESOURCE' => $new['jab_resource'],
+ 'JAB_PACKAGE_SIZE' => $new['jab_package_size'])
);
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 1a079b8e0d..63e5401203 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -621,6 +621,7 @@ class acp_users
{
$error[] = 'NEW_EMAIL_ERROR';
}
+ $error[] = 'NEW_EMAIL_ERROR';
// Which updates do we need to do?
$update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false;
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 3c1e7babbf..98bdb3bfcc 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -50,7 +50,13 @@ class bbcode
if (!$this->bbcode_bitfield)
{
- return $message;
+ // Remove the uid from tags that have not been transformed into HTML
+ if ($this->bbcode_uid)
+ {
+ $message = str_replace(':' . $this->bbcode_uid, '', $message);
+ }
+
+ return;
}
$str = array('search' => array(), 'replace' => array());
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 83e5b1beed..2d8d2e7624 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -341,7 +341,7 @@ class dbal
if (empty($_GET['explain']))
{
- return;
+ return false;
}
if (!$query && $this->query_hold != '')
@@ -516,6 +516,8 @@ class dbal
break;
}
+
+ return true;
}
}
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 22481267e5..f9c2cd1388 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -331,6 +331,8 @@ class dbal_postgres extends dbal
unset($this->open_queries[(int) $query_id]);
return @pg_free_result($query_id);
}
+
+ return false;
}
/**
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 604d0d3870..07783b5876 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1994,7 +1994,7 @@ function add_log()
break;
default:
- return;
+ return false;
}
$db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 00d7a6c5ab..9fd0386511 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -760,7 +760,7 @@ class jabber
function get_info_from_iq_key($packet = NULL)
{
- return (is_array($packet)) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false;
+ return (is_array($packet) && isset($packet['iq']['#']['query'][0]['#']['key'][0]['#'])) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false;
}
function get_info_from_iq_error($packet = NULL)
@@ -1020,6 +1020,8 @@ class make_xml extends jabber
return $text;
}
+
+ return false;
}
function _preg_grep_keys($pattern, $array)
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 50d8ae8fc6..c187bac96a 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -202,7 +202,7 @@ class messenger
if ($break)
{
- return;
+ return true;
}
switch ($method)
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 5d8f1dcb90..9d642457a4 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -178,6 +178,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
WHERE {$type}_id = $update_id";
$db->sql_query($sql);
}
+
+ return;
}
/**
@@ -1263,7 +1265,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// We do not handle erasing posts here
if ($mode == 'delete')
{
- return;
+ return false;
}
$current_time = time();
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4b5a43e2c8..ebbb119851 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -270,7 +270,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if (!$user->data['user_new_privmsg'])
{
- return;
+ return 0;
}
$user_new_privmsg = (int) $user->data['user_new_privmsg'];
@@ -709,7 +709,7 @@ function handle_mark_actions($user_id, $mark_action)
if (!sizeof($msg_ids))
{
- return;
+ return false;
}
switch ($mark_action)
@@ -889,6 +889,8 @@ function delete_pm($user_id, $msg_ids, $folder_id)
WHERE msg_id IN (' . $delete_ids . ')';
$db->sql_query($sql);
}
+
+ return true;
}
/**
@@ -1099,7 +1101,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
// We do not handle erasing posts here
if ($mode == 'delete')
{
- return;
+ return false;
}
$current_time = time();
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 6bea346ef3..4ab5cf39cb 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -414,6 +414,10 @@ class custom_profile
return $tpl_fields;
}
+ else
+ {
+ trigger_error('Wrong mode for custom profile', E_USER_ERROR);
+ }
}
/**
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 8b59cfa5c7..678ca2b493 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -114,16 +114,11 @@ class filespec
function get($property)
{
- if ($this->init_error)
- {
- return;
- }
-
- if (!isset($this->$property))
+ if ($this->init_error || !isset($this->$property))
{
return false;
}
-
+
return $this->$property;
}
@@ -284,6 +279,8 @@ class filespec
$this->file_moved = true;
$this->additional_checks();
unset($this->upload);
+
+ return true;
}
function additional_checks()
@@ -302,13 +299,18 @@ class filespec
$max_filesize = ($this->upload->max_filesize >= 1048576) ? round($this->upload->max_filesize / 1048576 * 100) / 100 : (($this->upload->max_filesize >= 1024) ? round($this->upload->max_filesize / 1024 * 100) / 100 : $this->upload->max_filesize);
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
- return;
+
+ return false;
}
if (!$this->upload->valid_dimensions($this))
{
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->upload->min_width, $this->upload->min_height, $this->upload->max_width, $this->upload->max_height, $this->width, $this->height);
+
+ return false;
}
+
+ return true;
}
}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index d932ae312b..a012415643 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -20,7 +20,7 @@ function user_get_id_name(&$user_id_ary, &$username_ary)
// are neither array filled?
if ($user_id_ary && $username_ary)
{
- return;
+ return false;
}
else if (!$user_id_ary && !$username_ary)
{
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 3060d76ed5..c961062ac8 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -823,7 +823,7 @@ class parse_message extends bbcode_firstpass
}
$this->message_status = 'parsed';
- return;
+ return false;
}
// Formatting text for display
@@ -864,7 +864,7 @@ class parse_message extends bbcode_firstpass
}
$this->message_status = 'display';
- return;
+ return false;
}
// Decode message to be placed back into form box
@@ -887,6 +887,7 @@ class parse_message extends bbcode_firstpass
}
$this->message_status = 'plain';
+ return false;
}
// Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 86ee938d66..8b2abde4f5 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -648,6 +648,8 @@ class fulltext_mysql extends search_backend
}
$db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE);
+
+ return false;
}
/**
@@ -679,6 +681,8 @@ class fulltext_mysql extends search_backend
}
$db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE);
+
+ return false;
}
/**
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 21a3e7f882..7c77a00e3f 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1179,6 +1179,8 @@ class user extends session
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
}
+
+ return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates);
}
function get_iso_lang_id()
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index d8f78a77c1..0a6fb5598d 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -483,6 +483,8 @@ class template
$this->_tpldata[$blockname][$key] = array_merge($this->_tpldata[$blockname][$key], $vararray);
return true;
}
+
+ return false;
}
/**
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 66f98a70c5..9a33405725 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -39,8 +39,7 @@ function compose_pm($id, $mode, $action)
$preview = (isset($_POST['preview']));
$save = (isset($_POST['save']));
$load = (isset($_POST['load']));
- $cancel = (isset($_POST['cancel']));
- $confirm = (isset($_POST['confirm']));
+ $cancel = (isset($_POST['cancel']) && !isset($_POST['save']));
$delete = (isset($_POST['delete']));
$remove_u = (isset($_REQUEST['remove_u']));
@@ -362,24 +361,41 @@ function compose_pm($id, $mode, $action)
if ($subject && $message)
{
- $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'user_id' => $user->data['user_id'],
- 'topic_id' => 0,
- 'forum_id' => 0,
- 'save_time' => $current_time,
- 'draft_subject' => $subject,
- 'draft_message' => $message));
- $db->sql_query($sql);
+ if (confirm_box(true))
+ {
+ $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ 'user_id' => $user->data['user_id'],
+ 'topic_id' => 0,
+ 'forum_id' => 0,
+ 'save_time' => $current_time,
+ 'draft_subject' => $subject,
+ 'draft_message' => $message));
+ $db->sql_query($sql);
- meta_refresh(3, "ucp.$phpEx$SID&i=pm&mode=$mode");
+ meta_refresh(3, "ucp.$phpEx$SID&i=pm&mode=$mode");
- $message = $user->lang['DRAFT_SAVED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=pm&amp;mode=$mode\">", '</a>');
+ $message = $user->lang['DRAFT_SAVED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=pm&amp;mode=$mode\">", '</a>');
- trigger_error($message);
+ trigger_error($message);
+ }
+ else
+ {
+ $s_hidden_fields = build_hidden_fields(array(
+ 'mode' => $mode,
+ 'action' => $action,
+ 'save' => true,
+ 'subject' => $subject,
+ 'message' => $message,
+ 'u' => $to_user_id,
+ 'g' => $to_group_id,
+ 'p' => $msg_id)
+ );
+
+ confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
+ }
}
- unset($subject);
- unset($message);
+ unset($subject, $message);
}
// Load Draft
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index b46aff5eba..4e644dffaa 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -376,7 +376,7 @@ function get_user_informations($user_id, $user_row)
if (!$user_id)
{
- return;
+ return array();
}
if (empty($user_row))
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 28757cf3ca..3305ef8729 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -183,12 +183,12 @@ class ucp_register
{
if ($new_password != $password_confirm)
{
- $error[] = 'NEW_PASSWORD_ERROR';
+ $error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
if ($email != $email_confirm)
{
- $error[] = 'NEW_EMAIL_ERROR';
+ $error[] = $user->lang['NEW_EMAIL_ERROR'];
}
}
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index 6809e84892..96278fd35a 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -51,6 +51,7 @@ class ucp_resend
{
$email_template = 'coppa_welcome_inactive';
}*/
+/*
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
$email_template = 'admin_welcome_inactive';
@@ -59,6 +60,7 @@ class ucp_resend
{
$email_template = 'user_welcome_inactive';
}
+*/
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);