Merge pull request #3 from electerious/develop

Develop
This commit is contained in:
Quentin Ligier 2016-03-19 10:07:39 +01:00
commit e39d84f1b2
5 changed files with 7 additions and 8 deletions

BIN
dist/main.js vendored Normal file → Executable file

Binary file not shown.

View File

@ -278,7 +278,7 @@ final class Album {
if (!@is_readable($photo->url)) continue; if (!@is_readable($photo->url)) continue;
// Get extension of image // Get extension of image
$extension = getExtension($photo->url, true); $extension = getExtension($photo->url, false);
// Set title for photo // Set title for photo
$zipFileName = $zipTitle . '/' . $photo->title . $extension; $zipFileName = $zipTitle . '/' . $photo->title . $extension;

View File

@ -845,7 +845,7 @@ final class Photo {
} }
// Get extension // Get extension
$extension = getExtension($photo->url, true); $extension = getExtension($photo->url, false);
if (empty($extension)===true) { if (empty($extension)===true) {
Log::error(Database::get(), __METHOD__, __LINE__, 'Invalid photo extension'); Log::error(Database::get(), __METHOD__, __LINE__, 'Invalid photo extension');
return false; return false;

View File

@ -11,6 +11,11 @@ function getExtension($filename, $isURI = false) {
$extension = pathinfo($filename, PATHINFO_EXTENSION); $extension = pathinfo($filename, PATHINFO_EXTENSION);
// Special cases
// https://github.com/electerious/Lychee/issues/482
list($extension) = explode(':', $extension, 2);
list($extension) = explode('?', $extension, 2);
if (empty($extension)===false) $extension = '.' . $extension; if (empty($extension)===false) $extension = '.' . $extension;
return $extension; return $extension;

View File

@ -275,12 +275,6 @@ upload.start = {
basicModal.close() basicModal.close()
let extension = data.link.split('.').pop()
if (extension!=='jpeg' && extension!=='jpg' && extension!=='png' && extension!=='gif' && extension!=='webp') {
loadingBar.show('error', 'File format of link not supported.')
return false
}
files[0] = { files[0] = {
name : data.link, name : data.link,
supported : true supported : true