aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/cache.php33
-rw-r--r--phpBB/includes/functions.php8
-rw-r--r--phpBB/includes/functions_display.php3
-rw-r--r--phpBB/includes/functions_posting.php7
-rw-r--r--phpBB/includes/functions_user.php3
-rw-r--r--phpBB/includes/mcp/mcp_forum.php3
-rw-r--r--phpBB/includes/session.php3
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php3
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php6
9 files changed, 29 insertions, 40 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index 01dcf5b722..6266d32c0f 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -70,13 +70,13 @@ class cache extends acm
* Obtain list of naughty words and build preg style replacement arrays for use by the
* calling script
*/
- function obtain_word_list(&$censors)
+ function obtain_word_list()
{
global $config, $user, $db;
if (!$user->optionget('viewcensors') && $config['allow_nocensors'])
{
- return false;
+ return array();
}
if (($censors = $this->get('word_censors')) === false)
@@ -96,13 +96,13 @@ class cache extends acm
$this->put('word_censors', $censors);
}
- return true;
+ return $censors;
}
/**
* Obtain currently listed icons
*/
- function obtain_icons(&$icons)
+ function obtain_icons()
{
if (($icons = $this->get('icons')) === false)
{
@@ -127,13 +127,13 @@ class cache extends acm
$this->put('icons', $icons);
}
- return;
+ return $icons;
}
/**
* Obtain ranks
*/
- function obtain_ranks(&$ranks)
+ function obtain_ranks()
{
if (($ranks = $this->get('ranks')) === false)
{
@@ -168,13 +168,13 @@ class cache extends acm
$this->put('ranks', $ranks);
}
- return;
+ return $ranks;
}
/**
* Obtain allowed extensions
*/
- function obtain_attach_extensions(&$extensions, $forum_id = false)
+ function obtain_attach_extensions($forum_id = false)
{
if (($extensions = $this->get('_extensions')) === false)
{
@@ -254,13 +254,13 @@ class cache extends acm
$extensions['_allowed_'] = array();
}
- return;
+ return $extensions;
}
/**
* Obtain active bots
*/
- function obtain_bots(&$bots)
+ function obtain_bots()
{
if (($bots = $this->get('bots')) === false)
{
@@ -303,7 +303,7 @@ class cache extends acm
$this->put('bots', $bots);
}
- return;
+ return $bots;
}
/**
@@ -355,9 +355,12 @@ class cache extends acm
return $parsed_items;
}
- function obtain_disallowed_usernames(&$usernames)
+ /**
+ * Obtain disallowed usernames
+ */
+ function obtain_disallowed_usernames()
{
- if (($usernames = $this->get('disallowed_usernames')) === false)
+ if (($usernames = $this->get('_disallowed_usernames')) === false)
{
global $db;
@@ -372,10 +375,10 @@ class cache extends acm
}
$db->sql_freeresult($result);
- $this->put('disallowed_usernames', $usernames);
+ $this->put('_disallowed_usernames', $usernames);
}
- return true;
+ return $usernames;
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 17c15fda30..814dcc74af 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2387,10 +2387,8 @@ function censor_text($text)
if (!isset($censors) || !is_array($censors))
{
- $censors = array();
-
// obtain_word_list is taking care of the users censor option and the board-wide option
- $cache->obtain_word_list($censors);
+ $censors = $cache->obtain_word_list();
}
if (sizeof($censors))
@@ -2466,9 +2464,7 @@ function extension_allowed($forum_id, $extension, &$extensions)
if (!sizeof($extensions))
{
global $cache;
-
- $extensions = array();
- $cache->obtain_attach_extensions($extensions);
+ $extensions = $cache->obtain_attach_extensions();
}
if (!isset($extensions['_allowed_'][$extension]))
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index dd9b1d7afa..086bd0532a 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -709,8 +709,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
if (empty($extensions) || !is_array($extensions))
{
- $extensions = array();
- $cache->obtain_attach_extensions($extensions);
+ $extensions = $cache->obtain_attach_extensions();
}
// Look for missing attachment informations...
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index a16870f01c..b15466b487 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -214,8 +214,7 @@ function posting_gen_topic_icons($mode, $icon_id)
global $phpbb_root_path, $config, $template, $cache;
// Grab icons
- $icons = array();
- $cache->obtain_icons($icons);
+ $icons = $cache->obtain_icons();
if (!$icon_id)
{
@@ -339,9 +338,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
return $filedata;
}
- $extensions = array();
- $cache->obtain_attach_extensions($extensions, $forum_id);
-
+ $extensions = $cache->obtain_attach_extensions($forum_id);
$upload->set_allowed_extensions(array_keys($extensions['_allowed_']));
$file = ($local) ? $upload->local_upload($local_storage) : $upload->form_upload($form_name);
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index a1bdec1695..15daa0c999 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1159,8 +1159,7 @@ function validate_username($username)
}
- $bad_usernames = array();
- $cache->obtain_disallowed_usernames($bad_usernames);
+ $bad_usernames = $cache->obtain_disallowed_usernames();
foreach ($bad_usernames as $bad_username)
{
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 959ff52a1b..b20bd63a08 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -87,8 +87,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
);
// Grab icons
- $icons = array();
- $cache->obtain_icons($icons);
+ $icons = $cache->obtain_icons();
$topic_rows = array();
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 6a8d3142d8..b69bcc5f44 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -324,8 +324,7 @@ class session
* bot, act accordingly
*/
$bot = false;
- $active_bots = array();
- $cache->obtain_bots($active_bots);
+ $active_bots = $cache->obtain_bots();
foreach ($active_bots as $row)
{
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index 6ce9ef187d..862702d7fc 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -26,8 +26,7 @@ function view_folder($id, $mode, $folder_id, $folder)
$user->add_lang('viewforum');
// Grab icons
- $icons = array();
- $cache->obtain_icons($icons);
+ $icons = $cache->obtain_icons();
$color_rows = array('marked', 'replied');
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index ad386ea4b5..8da8f0bd18 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -35,8 +35,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
}
// Grab icons
- $icons = array();
- $cache->obtain_icons($icons);
+ $icons = $cache->obtain_icons();
$bbcode = false;
@@ -395,8 +394,7 @@ function get_user_informations($user_id, $user_row)
}
// Grab ranks
- $ranks = array();
- $cache->obtain_ranks($ranks);
+ $ranks = $cache->obtain_ranks();
// Generate online information for user
if ($config['load_onlinetrack'])