From 90dcd408d311b215a15ee6a96f1f965540189846 Mon Sep 17 00:00:00 2001 From: henoheno Date: Sun, 30 Jan 2005 21:02:37 +0900 Subject: [PATCH] Check PKWK_QUERY_STRING_MAX --- plugin/attach.inc.php | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/plugin/attach.inc.php b/plugin/attach.inc.php index 9d63ef7..da7e139 100644 --- a/plugin/attach.inc.php +++ b/plugin/attach.inc.php @@ -1,6 +1,6 @@ PKWK_QUERY_STRING_MAX) { + pkwk_common_headers(); + echo('Query string (page name and/or file name) too long'); + exit; + } else if (! is_page($page)) { + die_message('No such page'); } else if ($file['tmp_name'] == '' || ! is_uploaded_file($file['tmp_name'])) { return array('result'=>FALSE); } else if ($file['size'] > PLUGIN_ATTACH_MAX_FILESIZE) { @@ -169,18 +178,15 @@ function attach_upload($file, $page, $pass = NULL) } $obj = & new AttachFile($page, $file['name']); - if ($obj->exist) { + if ($obj->exist) return array('result'=>FALSE, 'msg'=>$_attach_messages['err_exists']); - } - if (move_uploaded_file($file['tmp_name'], $obj->filename)) { + if (move_uploaded_file($file['tmp_name'], $obj->filename)) chmod($obj->filename, PLUGIN_ATTACH_FILE_MODE); - } - if (is_page($page)) { + if (is_page($page)) touch(get_filename($page)); - } $obj->getstatus(); $obj->status['pass'] = ($pass !== TRUE && $pass !== NULL) ? md5($pass) : ''; -- 2.11.0