projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added option to do data and attachment directory hashing, up to four levels. Will...
[squirrelmail.git]
/
src
/
retrievalerror.php
diff --git
a/src/retrievalerror.php
b/src/retrievalerror.php
index
d2623ab
..
0fd94f2
100644
(file)
--- a/
src/retrievalerror.php
+++ b/
src/retrievalerror.php
@@
-42,11
+42,13
@@
require_once("../src/load_prefs.php");
function ClearAttachments() {
function ClearAttachments() {
- global $attachments, $attachment_dir;
+ global $attachments, $attachment_dir
, $username
;
+ $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
foreach ($attachments as $info) {
foreach ($attachments as $info) {
- if (file_exists($attachment_dir . $info['localfilename'])) {
- unlink($attachment_dir . $info['localfilename']);
+ $attached_file = "$hashed_attachment_dir/$info[localfilename]";
+ if (file_exists($attached_file)) {
+ unlink($attached_file);
}
}
}
}
@@
-63,12
+65,16
@@
require_once("../src/load_prefs.php");
$thebastard = implode('', $data);
$thebastard = implode('', $data);
-
+ $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$localfilename = GenerateRandomString(32, '', 7);
$localfilename = GenerateRandomString(32, '', 7);
- while (file_exists($attachment_dir . $localfilename))
+ $full_localfilename = "$hashed_attachment_dir/$localfilename";
+ while (file_exists($full_localfilename)) {
$localfilename = GenerateRandomString(32, '', 7);
$localfilename = GenerateRandomString(32, '', 7);
+ $full_localfilename = "$hashed_attachment_dir/$localfilename";
+ }
+
// Write Attachment to file
// Write Attachment to file
- $fp = fopen ($
attachment_dir.$
localfilename, 'w');
+ $fp = fopen ($
full_
localfilename, 'w');
fputs ($fp, $thebastard);
fclose ($fp);
fputs ($fp, $thebastard);
fclose ($fp);