mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-14 04:04:01 +00:00
removed some unused extensions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
31
inc/core.php
31
inc/core.php
@@ -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);
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user