$focus['showreport'] = 'focus';
require_once('./global.php');
+require_once('./includes/class_api_error.php');
require_once('./includes/api_attachment.php');
require_once('./includes/api_comment.php');
+APIError(array(new API_Error_Handler($message), 'user_cumulative'));
+
if (isset($bugsys->in['attachmentid']))
{
$attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . intval($bugsys->in['attachmentid']));
switch ($FILE['error'])
{
case 0: break;
- case 1: $message->items[] = $lang->string('PHP said the file you uploaded was too big.'); break;
- case 2: $message->items[] = $lang->string('The file exceeds the allowed upload size.'); break;
- case 3: $message->items[] = $lang->string('The file was only partially uploaded.'); break;
- case 4: $message->items[] = $lang->string('The file was not uploaded at all.'); break;
- case 6: $message->items[] = $lang->string('PHP could not find the /tmp directory.'); break;
+ case 1: $message->add_error($lang->string('PHP said the file you uploaded was too big.')); break;
+ case 2: $message->add_error($lang->string('The file exceeds the allowed upload size.')); break;
+ case 3: $message->add_error($lang->string('The file was only partially uploaded.')); break;
+ case 4: $message->add_error($lang->string('The file was not uploaded at all.')); break;
+ case 6: $message->add_error($lang->string('PHP could not find the /tmp directory.')); break;
}
// did it upload?
if (!is_uploaded_file($FILE['tmp_name']))
{
- $message->items[] = $lang->string('The file you specified did not upload.');
+ $message->add_error($lang->string('The file you specified did not upload.'));
}
// #*# put some MIME-type validation here
if (filesize($FILE['tmp_name']) > $var['Value'])
{
- $message->items[] = $lang->string('The file you specified exceeds MySQL\'s maximum allowed packet.');
+ $message->add_error($lang->string('The file you specified exceeds MySQL\'s maximum allowed packet.'));
}
$attachapi->set('attachment', file_get_contents($FILE['tmp_name']));