Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Add toggle for image extension in URL
Browse files Browse the repository at this point in the history
- I added support for these kind of URLs ages ago, but I never got round to adding it in
- Should solve #17
  • Loading branch information
aerouk committed May 5, 2016
1 parent a49478b commit 974a486
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/protected/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

define('RAW_IMAGE', false);
define('RAW_IMAGE_LINK', false);
define('IMAGE_EXTENSION', false);

define('TWITTER_CARDS', true);

Expand Down
2 changes: 1 addition & 1 deletion public/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function saveImage($mimeType, $tempName)
$hash = generateNewHash($type);

if (move_uploaded_file($tempName, $dir . "$type/$hash.$type")) {
die("success," . (RAW_IMAGE_LINK ? $dir . "$type/$hash.$type" : ($type == "png" ? "" : substr($type, 0, 1) . "/") . "$hash"));
die("success," . (RAW_IMAGE_LINK ? $dir . "$type/$hash.$type" : ($type == "png" ? "" : substr($type, 0, 1) . "/") . "$hash" . (IMAGE_EXTENSION ? ".$type" : "")));
}

die("error,e-500x");
Expand Down

0 comments on commit 974a486

Please sign in to comment.