|
From: Benjamin C. <bc...@us...> - 2002-04-09 23:26:08
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv19699
Modified Files:
attachment.php
Log Message:
Cleanup, bug fixes
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- attachment.php 3 Apr 2002 01:00:52 -0000 1.15
+++ attachment.php 9 Apr 2002 23:26:04 -0000 1.16
@@ -48,7 +48,7 @@
show_text($STRING['bad_attachment'], true);
return false;
}
- $filename = join('/',array(INSTALL_PATH, ATTACHMENT_PATH,
+ $filename = join('/',array(ATTACHMENT_PATH,
$ainfo['project_id'], "{$ainfo['bug_id']}-{$ainfo['file_name']}"));
if (!is_readable($filename)) {
show_text($STRING['bad_attachment'], true);
@@ -90,7 +90,7 @@
}
}
- $filepath = INSTALL_PATH.'/'.ATTACHMENT_PATH;
+ $filepath = ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
@@ -118,10 +118,10 @@
$db->query("insert into ".TBL_ATTACHMENT." (attachment_id, bug_id, file_name, ".
"description, file_size, mime_type, created_by, created_date) values (".
join(', ', array($db->nextId(TBL_ATTACHMENT), $bugid,
- $HTTP_POST_FILES['attachment']['name'],
+ $db->quote($HTTP_POST_FILES['attachment']['name']),
$db->quote(stripslashes($description)),
$HTTP_POST_FILES['attachment']['size'],
- $HTTP_POST_FILES['attachment']['type'], $u, $now)).")");
+ $db->quote($HTTP_POST_FILES['attachment']['type']), $u, $now)).")");
$t->assign('bugid', $bugid);
$t->display('bugattachmentsuccess.html');
}
@@ -129,7 +129,6 @@
function show_attachment_form($bugid, $error = '') {
global $db, $t, $STRING;
- $t->set_file('content', 'bugattachmentform.html');
if (!is_numeric($bugid)) {
show_text($STRING['nobug'], true);
return;
@@ -170,7 +169,7 @@
}
} else {
$perm->check('Editbug');
- show_attachment_form($_gv['bugid']);
+ show_attachment_form($_gv['bug_id']);
}
?>
|