summaryrefslogtreecommitdiff
path: root/static
AgeCommit message (Collapse)Author
2015-09-15Use unix_socket=/tmp/mysql.sock in POMF_DB_CONNWubTheCaptain
2015-09-15Rework generate_name() logicWubTheCaptain
Adds a new config option POMF_FILES_LENGTH. This will allow the user to adjust the length of filenames. Defaults to 6. The filename generator never used character z in new filenames. There are 27 characters in a-z, but the old code uses a magic number of 26 characters. This bug was introduced in commit 5b77a4eaab418836820b2a0bad7c88f0b88136a0. Instead of relying on magic numbers like with mt_rand(), conveniently use arrays with array_rand() instead. More characters can be added with array_merge() in future if desired.
2015-09-15Full git history nowpantsucat
2015-08-15Update upload.phpEric Johansson (neku)
2015-06-24pass full urlKieran Harkin
2015-06-24pass full url back to clientKieran Harkin
2015-06-13Update UploadedFile.class.phpEric Johansson (neku)
crc32 isn't used
2015-02-03Minor code refactoring and updatescenci0
DATABASE UPDATE: `orginalname` renamed to `originalname` (run update.sql to update `files` table). Run `update.sql` to update your database, no data will be lost (if you don't update it, pomf won't work properly). `schema.sql` - `id`s are now unsigned to double the maximum number of supported indexes - `size` and `user` columns are unsigned too (we can't have a negative file size or a negative user id) `static/classes/Response.class.php` New class to manage responses and errors. Using a class for responses makes the code cleaner and easier to add new response type handlers in the future. - The response type is declared while a new variable is initialized and the `error` and `send` methods will print a proper output according to it - The header for the response is also set accordingly to the response type (`text/plain` for `csv`/`gyazo` output, `application/json` for `json` output) `static/classes/UploadException.class.php` `Exception` class extension to manage errors that may have occurred while uploading files to the server. This way every error is reported in detail. `static/includes/settings.inc.php` - `POMF_URL`: add an option to set the domain of the url to prepend to the newly generated filename (before it was hardcoded and it was `http://a.pomf.se/`) [this option is currently used only when the output is set to `gyazo`] `upload.php` - Add functions calls at the beginning to enable the output compression if possible (gzipped output) - Include new classes - `generate_name ()` --- The new name generation algorithm is basically the same of the old one, but it's easier to add/remove characters if needed (eg. lower-case letters isn't enough and you need to add capital-case letters or digits) --- Check directly the database instead of the filesystem to see if a generated filename is already in use - `upload_file ()` --- File errors generate a `UploadException` instead of a normal `Exception` --- Move common code outside the `if` to avoid useless code repetition (only the query is now inside the condition) --- Change file permissions of a file after moving it to the new directory (if the user didn't set a mask previouly these files wouldn't be world readable, we make sure they are) - `diverse_array ()` --- Function to reorder initial `$_FILES` array (easier to handle for `refiles`) - `refiles ()` --- Use a `foreach` cicle instead of a `for` one, easier to understand - Create a new response object and set its response type (`csv`, `gyazo` or default to `json`) - Edit response handling according to the new response class
2014-12-20removed disgusting "Eric Johansson (neku)
2014-12-20Update upload.phpEric Johansson (neku)
2014-12-20Update upload.phpEric Johansson (neku)
2014-12-20Update upload.phpEric Johansson (neku)
2014-12-20Update upload.phpEric Johansson (neku)
2014-12-20Update upload.phpMichael
2014-12-19Update upload.phpEric Johansson (neku)
2014-12-19Update upload.phpEric Johansson (neku)
2014-11-30Update settings.inc.phpNeku
2014-10-02not even used, shitty, removedNeku
2014-08-24fixed vuln + other ghetto updatesNeku
2014-02-22Update upload.phpNeku
2014-02-22Update upload.phpbenwaffle
database.inc.php already includes settings.inc.php
2014-01-18Lower retries to 15 instead of 30.Peter Lejeck
If we hit the limit of 15, there's something horrible going on and we have bigger problems.
2014-01-18Add double-dot handling. Fixes #1Peter Lejeck
2014-01-18Fix indentation in upload.phpPeter Lejeck
Please, neku, learn to use tabs, okay?
2014-01-15or notneku nekus
2014-01-15accounts?neku nekus
2014-01-15accounts?neku nekus
2014-01-04fix?Neku
2014-01-04fixed some shitNeku
2013-12-16more triesNeku
2013-12-16maybe one more, we need new algoNeku
2013-12-15other name generate algoNeku
2013-12-14rambles about socketsnokonoko
2013-12-14rambles about socketsnokonoko
2013-12-14Emergency fix for file extensionsPeter Lejeck
2013-12-13dot dot dot dots and more dotsnokonoko
2013-12-13fixed dot after extenstionless filenokonoko
2013-12-13ghetto fix for uploading files without extensionnokonoko
2013-12-01Fix output when output isn't setPeter Lejeck
2013-12-01Remove &reference in refiles() (fixes bug reported by catboy)Peter Lejeck
2013-12-01Add response types via ?out=typePeter Lejeck
Types are "gyazo", "csv", and "json" (default)
2013-12-01Add some whitespace and fix the phpdoc commentsPeter Lejeck
2013-11-01Merge branch 'nuck-dev' of github.com:nokonoko/Pomf into nuck-devPeter Lejeck
2013-11-01Fix deduplicationPeter Lejeck
2013-11-01127.0.0.1 is fasternokonoko
2013-10-31Move favicon into static dirPeter Lejeck
2013-10-31Move upload.php into static dir, and do hardcore refactoringPeter Lejeck
2013-10-31Move kawaii.php to grill.phpPeter Lejeck