summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rwxr-xr-xstatic/classes/Response.class.php24
-rw-r--r--static/classes/UploadedFile.class.php1
-rw-r--r--static/upload.php6
3 files changed, 29 insertions, 2 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php
index 27dbd74..f8555d6 100755
--- a/static/classes/Response.class.php
+++ b/static/classes/Response.class.php
@@ -105,11 +105,17 @@ class Response
echo $response;
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function csv_error($description)
{
return '"error"'."\r\n"."\"$description\""."\r\n";
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function csv_success($files)
{
$result = '"name","url","hash","size"'."\r\n";
@@ -123,11 +129,17 @@ class Response
return $result;
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function html_error($code, $description)
{
return '<p>ERROR: ('.$code.') '.$description.'</p>';
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function html_success($files)
{
$result = '';
@@ -139,6 +151,9 @@ class Response
return $result;
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function json_error($code, $description)
{
return json_encode(array(
@@ -148,6 +163,9 @@ class Response
), JSON_PRETTY_PRINT);
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function json_success($files)
{
return json_encode(array(
@@ -156,11 +174,17 @@ class Response
), JSON_PRETTY_PRINT);
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function text_error($code, $description)
{
return 'ERROR: ('.$code.') '.$description;
}
+ /**
+ * @deprecated 2.1.0 Will be renamed to camelCase format.
+ */
private static function text_success($files)
{
$result = '';
diff --git a/static/classes/UploadedFile.class.php b/static/classes/UploadedFile.class.php
index ac39646..99020ce 100644
--- a/static/classes/UploadedFile.class.php
+++ b/static/classes/UploadedFile.class.php
@@ -37,6 +37,7 @@ class UploadedFile
/**
* Generates the SHA1 or returns the cached SHA1 hash for the file.
*
+ * @deprecated 2.1.0 To be replaced with SHA-256 hashing.
* @return string
*/
public function get_sha1()
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;
}