From 145e1ced25627632255a0891bb8130d4c2ef6491 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 12 Oct 2008 02:58:23 +0000 Subject: #319467: SA-2008-47 (#295053): Arbitrary file uploads in Blog API. --- modules/blogapi/blogapi.install | 75 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'modules/blogapi/blogapi.install') diff --git a/modules/blogapi/blogapi.install b/modules/blogapi/blogapi.install index 1855b4935..0bf00659c 100644 --- a/modules/blogapi/blogapi.install +++ b/modules/blogapi/blogapi.install @@ -1,6 +1,65 @@ t('Stores information for files uploaded via the blogapi.'), + 'fields' => array( + 'fid' => array( + 'description' => t('Primary Key: Unique file ID.'), + 'type' => 'serial', + ), + 'uid' => array( + 'description' => t('The {users}.uid of the user who is associated with the file.'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'filepath' => array( + 'description' => t('Path of the file relative to Drupal root.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'filesize' => array( + 'description' => t('The size of the file in bytes.'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('fid'), + 'indexes' => array( + 'uid' => array('uid'), + ), + ); + + return $schema; +} + /** * @defgroup updates-5.x-to-6.x Blog API updates from 5.x to 6.x * @{ @@ -14,6 +73,22 @@ function blogapi_update_6000() { return array(); } +/** + * Add blogapi_files table to enable size restriction for BlogAPI file uploads. + * + * This table was introduced in Drupal 6.4. + */ +function blogapi_update_6001() { + $ret = array(); + + if (!db_table_exists('blogapi_files')) { + $schema = blogapi_schema(); + db_create_table($ret, 'blogapi_files', $schema['blogapi_files']); + } + + return $ret; +} + /** * @} End of "defgroup updates-5.x-to-6.x" * The next series of updates should start at 7000. -- cgit v1.2.3