aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-12-27 17:43:55 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-12-27 17:43:55 +0000
commit945afbc5fa427f6e6fa15f3e2f5c67969121b01e (patch)
tree1742cf822c3339eec48d8d54e6ce08c51316b59b /phpBB/includes/functions.php
parentb9da985180730252133699242ef639f91da2880e (diff)
downloadforums-945afbc5fa427f6e6fa15f3e2f5c67969121b01e.tar
forums-945afbc5fa427f6e6fa15f3e2f5c67969121b01e.tar.gz
forums-945afbc5fa427f6e6fa15f3e2f5c67969121b01e.tar.bz2
forums-945afbc5fa427f6e6fa15f3e2f5c67969121b01e.tar.xz
forums-945afbc5fa427f6e6fa15f3e2f5c67969121b01e.zip
Unused Code inside function update_forum_data [Bug #6606]
Copy permissions protection for groups [Bug #6594] HTML issues in ACP [Bug #6580, #6578] Always send the correct encoding [related to bug #6576] Mass email fixes for first loop iteration [Bug #6570] Extension groups to be allowed in PM's and/or Posts [Bug #6558] Extension allowance checking clarified (no longer using forum id 0 for private messaging) Using request_var() array method for some variables [Bug #6556] Added confirmation for deletion of ranks/smilies/icons/word censores [Bug #6548, #6530, #6512, #6466] Only show postable forums in dropdown list for moving posts on forum deletion as well as correct re-indexing [Bug #6510, #6476, #6384] Jabber password being password field in jabber settings screen [Bug #6478] user activity language variable if viewing not own profile [Bug #6432] Show moderator group/user-name colour [Bug #6402] Log rank creation/updating/removing [Bug #6398] Update check permission changed from a_ to a_board [Bug #6392] git-svn-id: file:///svn/phpbb/trunk@6816 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php47
1 files changed, 17 insertions, 30 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index a88e3be9bf..8e1df45cb0 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2446,7 +2446,7 @@ function smiley_text($text, $force_option = false)
/**
* General attachment parsing
*
-* @param int $forum_id The forum id the attachments are displayed in (0 for private messages)
+* @param mixed $forum_id The forum id the attachments are displayed in (false if in private message)
* @param string &$message The post/private message
* @param array &$attachments The attachments to parse for (inline) display. The attachments array will hold templated data after parsing.
* @param array &$update_count The attachment counts to be updated - will be filled
@@ -2475,7 +2475,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
if (empty($extensions) || !is_array($extensions))
{
- $extensions = $cache->obtain_attach_extensions();
+ $extensions = $cache->obtain_attach_extensions($forum_id);
}
// Look for missing attachment information...
@@ -2620,7 +2620,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
}
- $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;f=' . $forum_id) : $filename;
+ $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;f=' . (int) $forum_id) : $filename;
switch ($display_cat)
{
@@ -2638,7 +2638,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Images, but display Thumbnail
case ATTACHMENT_CATEGORY_THUMB:
$l_downloaded_viewed = $user->lang['VIEWED'];
- $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;t=1&amp;f=' . $forum_id) : $thumbnail_filename;
+ $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&amp;t=1&amp;f=' . (int) $forum_id) : $thumbnail_filename;
$block_array += array(
'S_THUMBNAIL' => true,
@@ -2754,35 +2754,23 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
/**
-* Check if extension is allowed to be posted within forum X (forum_id 0 == private messaging)
+* Check if extension is allowed to be posted.
+*
+* @param mixed $forum_id The forum id to check or false if private message
+* @param string $extension The extension to check, for example zip.
+* @param array &$extensions The extension array holding the information from the cache (will be obtained if empty)
+*
+* @return bool False if the extension is not allowed to be posted, else true.
*/
function extension_allowed($forum_id, $extension, &$extensions)
{
- if (!sizeof($extensions))
+ if (empty($extensions))
{
global $cache;
- $extensions = $cache->obtain_attach_extensions();
+ $extensions = $cache->obtain_attach_extensions($forum_id);
}
- if (!isset($extensions['_allowed_'][$extension]))
- {
- return false;
- }
-
- $check = $extensions['_allowed_'][$extension];
-
- if (is_array($check))
- {
- // Check for private messaging AND all forums allowed
- if (sizeof($check) == 1 && $check[0] == 0)
- {
- return true;
- }
-
- return (!in_array($forum_id, $check)) ? false : true;
- }
-
- return ($forum_id == 0) ? false : true;
+ return (!isset($extensions['_allowed_'][$extension])) ? false : true;
}
// Little helpers
@@ -3700,10 +3688,9 @@ function page_header($page_title = '', $display_online_list = true)
'SITE_LOGO_IMG' => $user->img('site_logo'))
);
- if ($config['send_encoding'])
- {
- header('Content-type: text/html; charset=UTF-8');
- }
+ // application/xhtml+xml not used because of IE
+ header('Content-type: text/html; charset=UTF-8');
+
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');