Various emergency fixes

This commit is contained in:
2024-11-25 18:23:43 +01:00
parent 4dcdb38d86
commit 2ac5bd0e51
6 changed files with 8 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
<?php
require "/home/hpr/php/include.php";
// curl --netrc-file $HOME/.netrc --verbose --request POST https://hub.hackerpublicradio.org/cms/asset.php --data-ascii @assets.json --header "Content-Type: application/json"
// curl --netrc-file $HOME/.netrc --verbose --request POST https://hub.hackerpublicradio.org/cms/assets.php --data-ascii @assets.json --header "Content-Type: application/json"
//Make sure that it is a POST request.
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
@@ -146,7 +146,7 @@ foreach($decoded['assets'] as $asset) {
if (!in_array( $this_ext, $allowed_extensions, true )) {
logextra( "This extension $this_ext, is not in the list of allowed_extensions" );
naughty("dd98c84719083fb80fecbd0405504038");
naughty("dd98c84719083fb80fecbd0405504038 $this_ext");
}
$filename = $provided_filename;
@@ -259,7 +259,7 @@ foreach($decoded['assets'] as $asset) {
naughty( "fcec6e4039bc60daede3434e24c97a9f" );
}
$allowed_content_type = array( "application/json", "application/octet-stream", "application/ogg", "audio/flac", "audio/mpeg", "audio/ogg", "audio/x-flac", "audio/x-wav", "image/jpeg", "image/png", "text/plain");
$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");