aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_users.php10
-rw-r--r--phpBB/includes/functions.php8
-rw-r--r--phpBB/includes/functions_module.php6
-rw-r--r--phpBB/includes/mcp/mcp_queue.php6
-rw-r--r--phpBB/includes/search/fulltext_native.php39
5 files changed, 37 insertions, 32 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 70e08f79f2..8aaefb02c5 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -172,8 +172,7 @@ class acp_users
if ($submit)
{
- // You can't delete the founder
- if ($delete && $user_row['user_type'] != USER_FOUNDER)
+ if ($delete)
{
if (!$auth->acl_get('a_userdel'))
{
@@ -186,6 +185,12 @@ class acp_users
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}
+ // Founders can not be deleted.
+ if ($user_row['user_type'] == USER_FOUNDER)
+ {
+ trigger_error($user->lang['CANNOT_REMOVE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
+ }
+
if ($user_id == $user->data['user_id'])
{
trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
@@ -1032,6 +1037,7 @@ class acp_users
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
+ 'U_SEARCH_USER' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$user_row['user_id']}&sr=posts") : '',
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '',
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index eef4ade4e7..f0657b9016 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3367,7 +3367,7 @@ function parse_cfg_file($filename, $lines = false)
}
// Determine first occurrence, since in values the equal sign is allowed
- $key = strtolower(trim(substr($line, 0, $delim_pos)));
+ $key = htmlspecialchars(strtolower(trim(substr($line, 0, $delim_pos))));
$value = trim(substr($line, $delim_pos + 1));
if (in_array($value, array('off', 'false', '0')))
@@ -3384,7 +3384,11 @@ function parse_cfg_file($filename, $lines = false)
}
else if (($value[0] == "'" && $value[sizeof($value) - 1] == "'") || ($value[0] == '"' && $value[sizeof($value) - 1] == '"'))
{
- $value = substr($value, 1, sizeof($value)-2);
+ $value = htmlspecialchars(substr($value, 1, sizeof($value)-2));
+ }
+ else
+ {
+ $value = htmlspecialchars($value);
}
$parsed_items[$key] = $value;
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index d0e7c8cfc8..0cc2425b28 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -436,21 +436,21 @@ class p_master
if ($this->active_module === false)
{
- trigger_error('Module not accessible', E_USER_ERROR);
+ trigger_error('MODULE_NOT_ACCESS', E_USER_ERROR);
}
if (!class_exists("{$this->p_class}_$this->p_name"))
{
if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
{
- trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR);
+ trigger_error($user->lang('MODULE_NOT_FIND', "$module_path/{$this->p_class}_$this->p_name.$phpEx"), E_USER_ERROR);
}
include("$module_path/{$this->p_class}_$this->p_name.$phpEx");
if (!class_exists("{$this->p_class}_$this->p_name"))
{
- trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
+ trigger_error($user->lang('MODULE_FILE_INCORRECT_CLASS', "$module_path/{$this->p_class}_$this->p_name.$phpEx", "{$this->p_class}_$this->p_name"), E_USER_ERROR);
}
if (!empty($mode))
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 764461fa53..acf344fd3c 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -660,15 +660,17 @@ function approve_post($post_id_list, $id, $mode)
foreach ($post_info as $post_id => $post_data)
{
+ $username = ($post_data['post_username']) ? $post_data['post_username'] : $post_data['username'];
+
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
{
// Forum Notifications
- user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
+ user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username);
}
else
{
// Topic Notifications
- user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
+ user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username);
}
}
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index dc961f3c8a..29c5a72874 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -231,7 +231,12 @@ class fulltext_native extends search_backend
}
$db->sql_freeresult($result);
}
- unset($exact_words);
+
+ // Handle +, - without preceeding whitespace character
+ $match = array('#(\S)\+#', '#(\S)-#');
+ $replace = array('$1 +', '$1 +');
+
+ $keywords = preg_replace($match, $replace, $keywords);
// now analyse the search query, first split it using the spaces
$query = explode(' ', $keywords);
@@ -357,39 +362,21 @@ class fulltext_native extends search_backend
$this->{$mode . '_ids'}[] = $words[$word];
}
}
- // throw an error if we shall not ignore unexistant words
- else if (!$ignore_no_id)
+ else
{
if (!isset($common_ids[$word]))
{
$len = utf8_strlen($word);
- if ($len >= $this->word_length['min'] && $len <= $this->word_length['max'])
- {
- trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word));
- }
- else
+ if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
{
$this->common_words[] = $word;
}
}
}
- else
- {
- $len = utf8_strlen($word);
- if ($len < $this->word_length['min'] || $len > $this->word_length['max'])
- {
- $this->common_words[] = $word;
- }
- }
- }
-
- // we can't search for negatives only
- if (!sizeof($this->must_contain_ids))
- {
- return false;
}
- if (!empty($this->search_query))
+ // Return true if all words are not common words
+ if (sizeof($exact_words) - sizeof($this->common_words) > 0)
{
return true;
}
@@ -428,6 +415,12 @@ class fulltext_native extends search_backend
return false;
}
+ // we can't search for negatives only
+ if (empty($this->must_contain_ids))
+ {
+ return false;
+ }
+
$must_contain_ids = $this->must_contain_ids;
$must_not_contain_ids = $this->must_not_contain_ids;
$must_exclude_one_ids = $this->must_exclude_one_ids;