aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-09-17 09:11:48 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-09-17 09:11:48 +0000
commit8906e07d414a2fa379e3aba0b96b4f3ea468699f (patch)
tree861c223dc014c75aecd107501b46c831296df4b1 /phpBB
parentf8c8d23a726df53c420268fd5c4d7aec468a107b (diff)
downloadforums-8906e07d414a2fa379e3aba0b96b4f3ea468699f.tar
forums-8906e07d414a2fa379e3aba0b96b4f3ea468699f.tar.gz
forums-8906e07d414a2fa379e3aba0b96b4f3ea468699f.tar.bz2
forums-8906e07d414a2fa379e3aba0b96b4f3ea468699f.tar.xz
forums-8906e07d414a2fa379e3aba0b96b4f3ea468699f.zip
- extensions_allowed changed a bit.
git-svn-id: file:///svn/phpbb/trunk@4986 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/download.php5
-rw-r--r--phpBB/includes/functions.php6
-rw-r--r--phpBB/includes/functions_display.php2
-rw-r--r--phpBB/includes/functions_posting.php2
4 files changed, 7 insertions, 8 deletions
diff --git a/phpBB/download.php b/phpBB/download.php
index eff6d0c603..2cac956a53 100644
--- a/phpBB/download.php
+++ b/phpBB/download.php
@@ -87,7 +87,8 @@ else
}
// disallowed ?
-if (!extension_allowed($row['forum_id'], $attachment['extension']))
+$extensions = array();
+if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
@@ -207,7 +208,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
header("Content-length: $size");
}
$result = @readfile($filename);
-
+
if (!$result)
{
trigger_error('Unable to deliver file.<br />Error was: ' . $php_errormsg, E_USER_WARNING);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 6589f804bd..1d1c32119b 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1341,11 +1341,9 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_
}
// Check if extension is allowed to be posted within forum X (forum_id 0 == private messaging)
-function extension_allowed($forum_id, $extension)
+function extension_allowed($forum_id, $extension, &$extensions)
{
- global $extensions;
-
- if (!isset($extensions) || !is_array($extensions))
+ if (!sizeof($extensions))
{
$extensions = array();
obtain_attach_extensions($extensions);
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 71c76b24f6..3e6a511c62 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -422,7 +422,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$denied = false;
- if (!extension_allowed($forum_id, $attachment['extension']))
+ if (!extension_allowed($forum_id, $attachment['extension'], $extensions))
{
$denied = true;
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 5946183b21..61a2620e74 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -157,7 +157,7 @@ function upload_attachment($forum_id, $filename, $local = false, $local_storage
obtain_attach_extensions($extensions);
// Check Extension
- if (!extension_allowed($forum_id, $filedata['extension']))
+ if (!extension_allowed($forum_id, $filedata['extension'], $extensions))
{
$filedata['error'][] = sprintf($user->lang['DISALLOWED_EXTENSION'], $filedata['extension']);
$filedata['post_attach'] = false;