1
0
forked from HPR/hpr_hub

Support for WYSIWYG upload

This commit is contained in:
2024-12-24 15:52:25 +01:00
parent 71124ab014
commit a553beafd5
3 changed files with 25 additions and 4 deletions

View File

@@ -1,4 +1,8 @@
<?php
## Recent Changes
# $allowed_content_type moved to include.php
require "/home/hpr/php/include.php";
// curl --netrc-file $HOME/.netrc --verbose --request POST https://hub.hackerpublicradio.org/cms/assets.php --data-ascii @assets.json --header "Content-Type: application/json"
@@ -259,7 +263,6 @@ foreach($decoded['assets'] as $asset) {
naughty( "fcec6e4039bc60daede3434e24c97a9f" );
}
$allowed_content_type = array( "application/json", "application/octet-stream", "application/ogg", "application/x-subrip", "audio/flac", "audio/mpeg", "audio/ogg", "audio/x-flac", "audio/x-wav", "image/jpeg", "image/png", "text/plain", "text/plain", "text/vtt");
if (!in_array( $content_type, $allowed_content_type, true )) {
logextra( "This content_type \"$content_type\", is not in the list of allowed_extensions" );
naughty("4f29dcd2b3ef7efc5c4bc65be7a787ca");