diff options
| author | nokonoko <neku@pomf.se> | 2013-12-13 21:54:05 +0100 |
|---|---|---|
| committer | nokonoko <neku@pomf.se> | 2013-12-13 21:54:05 +0100 |
| commit | f0126f1c2bb90ca1c9cbe9d6af856227d9b769c9 (patch) | |
| tree | 81002d32563bf62e16fcb1f02363a4e1e96a1f5a /static/upload.php | |
| parent | 90e047984ab37e57ea446050a05293de3f6ea88a (diff) | |
dot dot dot dots and more dots
Diffstat (limited to 'static/upload.php')
| -rw-r--r-- | static/upload.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/static/upload.php b/static/upload.php index 824ffca..13a9133 100644 --- a/static/upload.php +++ b/static/upload.php @@ -14,7 +14,7 @@ function generate_name ($file) { // We start at N retries, and --N until we give up $tries = POMF_FILES_RETRIES; // We rip out the extension using pathinfo - // TODO: figure out a solution for .tar.gz and similar files? This has now been ghetto fixed! + // TODO: figure out a solution for .tar.gz and similar files? This has now been ghetto fixed, read below! $ext = pathinfo($file->name, PATHINFO_EXTENSION); // Take the first 3 chars of the CRC32 checksum $hashchunk = substr($file->get_crc32(), 0, 3); @@ -28,7 +28,7 @@ function generate_name ($file) { $newname .= $hashchunk; // + first 3 of crc32b checksum $newname .= chr(mt_rand(ord("a"), ord("z"))); // + random lowercase letter - // To add a dot or not to add a dot ghetto style + // To add a dot or not after a file which has no extension, ghetto style naturally! $ass = pathinfo($file->name, PATHINFO_FILENAME); $pos = strrpos($ass, '.'); if ($pos === false) { |
