summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWubTheCaptain <wub@partyvan.eu>2015-09-18 02:45:58 +0200
committerpantsucat <contact@pantsu.cat>2015-09-19 01:56:23 +0200
commit5ad07e817a65d058b493bbeaaf00b8d60fe13f27 (patch)
tree87287a83f19ad198e62275e2fdadcdb599461954
parenta8216dfebedbb0739a423873cd86a82e4b15fdac (diff)
Revert ShareX / URL change commits
These commits are ShareX issues, not Pomf issues. Allowing these commits to be in the source reduces maintainability. This reverts commits bbcffe8d745937677352edf25e6a250ca8fd507b, 943e7e62a8ca814d47168bcebf2cc92dbce9a45a and partially 1411bce1dc13bf6fea66b5899ba29d50d5c53bb0.
-rw-r--r--js/pomf.js3
-rwxr-xr-xstatic/classes/Response.class.php2
-rw-r--r--static/upload.php9
3 files changed, 6 insertions, 8 deletions
diff --git a/js/pomf.js b/js/pomf.js
index 29ef20b..5496284 100644
--- a/js/pomf.js
+++ b/js/pomf.js
@@ -122,10 +122,9 @@ $(function () {
break
}
eachRow(res.files, function (row, file, files) {
- var url = 'https://i.pantsu.cat/' + file.url
var link = $('<a>')
- link.attr('href', url)
+ link.attr('href', file.url)
.attr('target', '_BLANK')
.text(file.url.replace("http://","").replace("https://",""))
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php
index c44230d..4f18a12 100755
--- a/static/classes/Response.class.php
+++ b/static/classes/Response.class.php
@@ -129,7 +129,7 @@ class Response
private static function html_success($files)
{
foreach ($files as $file) {
- $result .= "<a href=\"https://i.pantsu.cat/".$file['url']."\">".$file['url']."</a><br>";
+ $result .= "<a href=\"".$file['url']."\">".$file['url']."</a><br>";
}
return $result;
diff --git a/static/upload.php b/static/upload.php
index 21ae386..0504e54 100644
--- a/static/upload.php
+++ b/static/upload.php
@@ -93,10 +93,11 @@ function upload_file($file)
$result = $q->fetch();
if ($result['count'] > 0) {
unlink($file->tempfile);
+
return array(
'hash' => $file->get_sha1(),
'name' => $file->name,
- 'url' => $result['filename'],
+ 'url' => POMF_URL.$result['filename'],
'size' => $file->size,
);
}
@@ -131,10 +132,11 @@ function upload_file($file)
$q->bindValue(':exp', null, PDO::PARAM_STR);
$q->bindValue(':del', sha1($file->tempfile), PDO::PARAM_STR);
$q->execute();
+
return array(
'hash' => $file->get_sha1(),
'name' => $file->name,
- 'url' => $newname,
+ 'url' => POMF_URL.$newname,
'size' => $file->size,
);
} else {
@@ -194,7 +196,6 @@ function refiles($files)
}
$type = isset($_GET['output']) ? $_GET['output'] : 'json';
-
$response = new Response($type);
if (isset($_FILES['files'])) {
@@ -211,5 +212,3 @@ if (isset($_FILES['files'])) {
} else {
$response->error(400, 'No input file(s)');
}
-
-