diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-07 16:11:03 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2016-05-07 16:16:07 +0200 |
| commit | 4fb3a0a9b300ecc896875bd4148a006f7887706e (patch) | |
| tree | 1f3898975a677e69344754ab376a93caf3d0246a | |
| parent | f19f79b18e6220ca1154f66a951eb1d6bf851615 (diff) | |
Deprecate file expiration support in Pomf 2.1.0
File expiration support has never been properly implemented in Pomf core
or moe panel. It serves as legacy baggage before nekunekus got an idea
to create nokonoko/Uguu for temporary uploads.
In current plans, this non-feature will be removed in the 3.0.0 release
which is the next SemVer major version that allows to remove this.
Reviewed-by: Austin Gillmann <alucard@cuntflaps.me>
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | schema.sql | 2 | ||||
| -rw-r--r-- | static/upload.php | 6 |
3 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5879890..d886df7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Deprecated - Swig banners. Use Swig templates or an alternative. (Juuso Lapinlampi) +- Unused file expiration (`expire`). This feature may be removed in next major + version. (Juuso Lapinlampi) ## `2.0.2` - Unreleased @@ -13,7 +13,7 @@ CREATE TABLE `files` ( `filename` varchar(30) default NULL, `size` int(10) unsigned default NULL, `date` date default NULL, - `expire` date default NULL, + `expire` date default NULL, -- Deprecated since version 2.1.0 `delid` char(40) default NULL, `user` int(10) unsigned default '0', `dir` int(2) default '0', diff --git a/static/upload.php b/static/upload.php index a37c549..c7d5ea7 100644 --- a/static/upload.php +++ b/static/upload.php @@ -133,6 +133,8 @@ function upload_file($file) // Need to change permissions for the new file to make it world readable if (chmod(POMF_FILES_ROOT.$newname, 0644)) { // Add it to the database + // 'expire' support is deprecated since version 2.1.0. It may be + // removed in a future release. $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, '. 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, '. ':exp, :del)'); @@ -143,7 +145,7 @@ function upload_file($file) $q->bindValue(':name', $newname, PDO::PARAM_STR); $q->bindValue(':size', $file->size, PDO::PARAM_INT); $q->bindValue(':date', date('Y-m-d'), PDO::PARAM_STR); - $q->bindValue(':exp', null, PDO::PARAM_STR); + $q->bindValue(':exp', null, PDO::PARAM_STR); // Deprecated since version 2.1.0 $q->bindValue(':del', sha1($file->tempfile), PDO::PARAM_STR); $q->execute(); @@ -201,7 +203,7 @@ function refiles($files) $f->tempfile = $file['tmp_name']; $f->error = $file['error']; // 'expire' doesn't exist neither in $_FILES nor in UploadedFile; - // commented out for future implementation + // it was never implemented and has been deprecated since version 2.1.0. //$f->expire = $file['expire']; $result[] = $f; } |
