removed some unused extensions

This commit is contained in:
Chris
2018-12-27 09:21:12 +01:00
parent 5fb9d21016
commit b50e522c0d
5 changed files with 46 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ Table of contents
### Config options
- [x] ALT_FOLDER
- [x] URL
- [x] URL (instead of FORCE_DOMAIN but mandatory)
- [x] LOG_UPLOADER
- [x] FFMPEG_BINARY
- [x] PNG_COMPRESSION
@@ -47,6 +47,12 @@ Table of contents
- [x] MASTER_DELETE_CODE
- [x] MASTER_DELETE_IP
- [ ] UPLOAD_CODE
- [ ] UPLOAD_FORM_LOCATION
- [ ] LOW_PROFILE
- [ ] IMAGE_CHANGE_CODE
- [ ] MAX_RESIZED_IMAGES
- [ ] ALLOW_BLOATING
- [ ] BACKBLAZE
### Image hosting
- [X] Resizing

View File

@@ -11,7 +11,7 @@
class ImageController implements ContentController
{
//returns all extensions registered by this type of content
public function getRegisteredExtensions(){return array('png','bmp','gif','jpg','jpeg','x-png','ico','webp');}
public function getRegisteredExtensions(){return array('png','bmp','gif','jpg','jpeg','x-png','webp');}
public function handleUpload($tmpfile,$hash=false)
{

View File

@@ -3,7 +3,7 @@
class VideoController implements ContentController
{
//returns all extensions registered by this type of content
public function getRegisteredExtensions(){return array('mp4','ogg','webm');}
public function getRegisteredExtensions(){return array('mp4');}
public function handleHash($hash,$url)
{

View File

@@ -405,6 +405,37 @@ function getStorageControllers()
return $controllers;
}
function getAllContentControllers()
{
$controllers = array();
if ($handle = opendir(ROOT.DS.'content-controllers')) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
if(is_dir(ROOT.DS.'content-controllers'.DS.$entry) && file_exists(ROOT.DS.'content-controllers'.DS.$entry.DS."$entry.controller.php"))
{
$controllers[] = ucfirst($entry).'Controller';
include_once(ROOT.DS.'content-controllers'.DS.$entry.DS."$entry.controller.php");
}
}
}
closedir($handle);
}
return $controllers;
}
function getAllContentFiletypes()
{
$types = array();
$controllers = getAllContentControllers(true);
foreach($controllers as $c)
{
$types = array_merge($types,(new $c)->getRegisteredExtensions());
}
return $types;
}
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);

View File

@@ -37,12 +37,14 @@
<div class="row">
<div class="col-md-8">
<a href="/"><img src="/css/imgs/logo/horizontal3.png" /></a>
<h4><?php echo $slogan; ?></h4>
<div class="well">
<div id="uploadinfo"></div>
<p>
<?php
echo "Max Upload size: ". (int)(ini_get('upload_max_filesize'))."MB / File";
echo "Max Upload size: ". (int)(ini_get('upload_max_filesize'))."MB / File<br/>";
echo "Allowed file types: ". implode(', ',getAllContentFiletypes());
?>
</p>
<form class="dropzone well" id="dropzone" method="post" action="/api/upload.php" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" multiple />