diff options
| author | Peter Lejeck <peter.lejeck@gmail.com> | 2013-12-14 00:31:30 +0100 |
|---|---|---|
| committer | Peter Lejeck <peter.lejeck@gmail.com> | 2013-12-14 00:31:30 +0100 |
| commit | 2dbe8701cb914d7a6e146406522b0db9045725f0 (patch) | |
| tree | 7d694886d93d9424a7c89e1ccf6ff7d187995c3a /static | |
| parent | f0126f1c2bb90ca1c9cbe9d6af856227d9b769c9 (diff) | |
Emergency fix for file extensions
Diffstat (limited to 'static')
| -rw-r--r-- | static/upload.php | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/static/upload.php b/static/upload.php index 13a9133..730e612 100644 --- a/static/upload.php +++ b/static/upload.php @@ -28,15 +28,8 @@ 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 after a file which has no extension, ghetto style naturally! - $ass = pathinfo($file->name, PATHINFO_FILENAME); - $pos = strrpos($ass, '.'); - if ($pos === false) { - // Nothing - }else{ - $newname .= '.' . $ext; - } - + // To add a dot or not after a file which has no extension + if ($ext != '') $newname .= '.' . $ext; } while (file_exists(POMF_FILES_ROOT . $newname)); // TODO: check the database instead? |
