aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-04-15 18:56:31 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-04-15 18:56:31 +0000
commit42b50a5d0ff5addd51da09bd169c0474ee3949a7 (patch)
tree362388dab90631013cdfcf60334e2dca90ddc1fe /phpBB/includes/functions_posting.php
parent93cb1853b5978cb7d46ccda0567cae6b119d3761 (diff)
downloadforums-42b50a5d0ff5addd51da09bd169c0474ee3949a7.tar
forums-42b50a5d0ff5addd51da09bd169c0474ee3949a7.tar.gz
forums-42b50a5d0ff5addd51da09bd169c0474ee3949a7.tar.bz2
forums-42b50a5d0ff5addd51da09bd169c0474ee3949a7.tar.xz
forums-42b50a5d0ff5addd51da09bd169c0474ee3949a7.zip
fixed delete post bug, use extension cache while posting, fix download counter for images
git-svn-id: file:///svn/phpbb/trunk@3838 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php30
1 files changed, 13 insertions, 17 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 0dd91d4f78..5b0ae41cf9 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -956,7 +956,7 @@ function delete_post($mode, $post_id, $topic_id, $forum_id, $post_data)
$forum_update_sql = '';
$user_update_sql = '';
- $topic_update_sql = 'topic_replies = topic_replies - 1, topic_replies_real = topic_replies_real - 1, ';
+ $topic_update_sql = 'topic_replies = topic_replies - 1, topic_replies_real = topic_replies_real - 1';
// Only one post... delete topic
if ($post_data['topic_first_post_id'] == $post_data['topic_last_post_id'])
@@ -1401,16 +1401,20 @@ function upload_attachment($filename)
$filedata['filesize'] = (!@filesize($file)) ? intval($_FILES['size']) : @filesize($file);
- $sql = "SELECT g.allow_group, g.max_filesize, g.cat_id
- FROM " . EXTENSION_GROUPS_TABLE . " g, " . EXTENSIONS_TABLE . " e
- WHERE (g.group_id = e.group_id) AND (e.extension = '" . $filedata['extension'] . "')";
- $result = $db->sql_query_limit($sql, 1);
+ $extensions = array();
+ obtain_attach_extensions($extensions);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ // Check Extension
+ if (!in_array($filedata['extension'], $extensions['_allowed_']))
+ {
+ $filedata['error'] = true;
+ $filedata['err_msg'] = sprintf($user->lang['DISALLOWED_EXTENSION'], $filedata['extension']);
+ $filedata['post_attach'] = false;
+ return ($filedata);
+ }
- $allowed_filesize = ( intval($row['max_filesize']) != 0 ) ? intval($row['max_filesize']) : intval($config['max_filesize']);
- $cat_id = intval($row['cat_id']);
+ $allowed_filesize = ($extensions[$filedata['extension']]['max_filesize'] != 0) ? $extensions[$filedata['extension']]['max_filesize'] : $config['max_filesize'];
+ $cat_id = $extensions[$filedata['extension']]['display_cat'];
// check Filename
if ( preg_match("/[\\/:*?\"<>|]/i", $filename) )
@@ -1430,14 +1434,6 @@ function upload_attachment($filename)
return ($filedata);
}
- // Check Extension
- if (intval($row['allow_group']) == 0)
- {
- $filedata['error'] = true;
- $filedata['err_msg'] = sprintf($user->lang['DISALLOWED_EXTENSION'], $filedata['extension']);
- $filedata['post_attach'] = false;
- return ($filedata);
- }
/*
// Check Image Size, if it is an image
if ( (!$acl->gets('m_', 'a_')) && ($cat_id == IMAGE_CAT) )