Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions_upload.php 4036 2008-07-24 11:35:12Z ZiNgaBuRgA $
| * $Id: functions_upload.php 4274 2008-11-19 03:22:50Z Tikitiki $
|
*/
| */
|
Zeile 385 | Zeile 385 |
---|
}
// Check if an attachment with this name is already in the post
|
}
// Check if an attachment with this name is already in the post
|
$query = $db->simple_select("attachments", "*", "filename='".$db->escape_string($attachment['name'])."' AND (posthash='$posthash' OR (pid='$pid' AND pid!='0'))");
| $query = $db->simple_select("attachments", "*", "filename='".$db->escape_string($attachment['name'])."' AND (posthash='$posthash' OR (pid='".intval($pid)."' AND pid!='0'))");
|
$prevattach = $db->fetch_array($query); if($prevattach['aid']) {
| $prevattach = $db->fetch_array($query); if($prevattach['aid']) {
|
Zeile 403 | Zeile 403 |
---|
{ $month_dir = ''; }
|
{ $month_dir = ''; }
|
}
| } // If safe_mode is enabled, don't attempt to use the monthly directories as it won't work if(ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode')) == 'on') { $month_dir = ''; }
|
// All seems to be good, lets move the attachment!
|
// All seems to be good, lets move the attachment!
|
$filename = "post_".$mybb->user['uid']."_".TIME_NOW.".attach";
| $filename = "post_".$mybb->user['uid']."_".TIME_NOW."_".md5(uniqid(rand(),�true)).".attach";
|
$file = upload_file($attachment, $mybb->settings['uploadspath']."/".$month_dir, $filename);
|
$file = upload_file($attachment, $mybb->settings['uploadspath']."/".$month_dir, $filename);
|
| // Failed to create the attachment in the monthly directory, just throw it in the main directory if($file['error'] && $month_dir) { $file = upload_file($attachment, $mybb->settings['uploadspath'].'/', $filename); }
|
if($month_dir) {
| if($month_dir) {
|
Zeile 555 | Zeile 569 |
---|
$upload['error'] = 2; return $upload; }
|
$upload['error'] = 2; return $upload; }
|
@my_chmod($path."/".$filename, 0644);
| @my_chmod($path."/".$filename, '0644');
|
$upload['filename'] = $filename; $upload['path'] = $path; $upload['type'] = $file['type'];
| $upload['filename'] = $filename; $upload['path'] = $path; $upload['type'] = $file['type'];
|