Various emergency fixes

This commit is contained in:
Ken Fallon 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 <?php
require "/home/hpr/php/include.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. //Make sure that it is a POST request.
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){ if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
@ -146,7 +146,7 @@ foreach($decoded['assets'] as $asset) {
if (!in_array( $this_ext, $allowed_extensions, true )) { if (!in_array( $this_ext, $allowed_extensions, true )) {
logextra( "This extension $this_ext, is not in the list of allowed_extensions" ); logextra( "This extension $this_ext, is not in the list of allowed_extensions" );
naughty("dd98c84719083fb80fecbd0405504038"); naughty("dd98c84719083fb80fecbd0405504038 $this_ext");
} }
$filename = $provided_filename; $filename = $provided_filename;
@ -259,7 +259,7 @@ foreach($decoded['assets'] as $asset) {
naughty( "fcec6e4039bc60daede3434e24c97a9f" ); 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 )) { if (!in_array( $content_type, $allowed_content_type, true )) {
logextra( "This content_type \"$content_type\", is not in the list of allowed_extensions" ); logextra( "This content_type \"$content_type\", is not in the list of allowed_extensions" );
naughty("4f29dcd2b3ef7efc5c4bc65be7a787ca"); naughty("4f29dcd2b3ef7efc5c4bc65be7a787ca");

View File

@ -315,7 +315,7 @@ elseif ($format === "csv") {
header("Content-disposition: inline; filename=hpr_stats.csv"); header("Content-disposition: inline; filename=hpr_stats.csv");
print "stats_generated,age_start,age_rename,age_since_start_total_seconds,age_since_start_years,age_since_start_months,age_since_start_days,age_since_rename_total_seconds,age_since_rename_years,age_since_rename_months,age_since_rename_days,shows_total,shows_twt,shows_hpr,hosts,slot_next_free,slot_no_media,number_future_hosts,number_future_shows,unprocessed_comments,shows_in_workflow,queue_reserve,playtime\n"; print "stats_generated,age_start,age_rename,age_since_start_total_seconds,age_since_start_years,age_since_start_months,age_since_start_days,age_since_rename_total_seconds,age_since_rename_years,age_since_rename_months,age_since_rename_days,shows_total,shows_twt,shows_hpr,hosts,slot_next_free,slot_no_media,number_future_hosts,number_future_shows,unprocessed_comments,shows_in_workflow,queue_reserve,playtime\n";
print "${current_time},2005-09-19T00:00:00Z,2007-12-31T00:00:00Z,${agetwt},${twt_years},${twt_months},${twt_days},${agehpr},${hpr_years},${hpr_months},${hpr_days},${totalshows},$total_twt_shows,${totalhpr},${num_of_hosts},${days_to_wait},${un_delivered},${num_future_hosts},${num_future_shows},${unprocessed_comments},${new_shows},${reserve_shows},${total_playtime}\n"; print "${current_time},2005-09-19T00:00:00Z,2007-12-31T00:00:00Z,${agetwt},${twt_years},${twt_months},${twt_days},${agehpr},${hpr_years},${hpr_months},${hpr_days},${totalshows},${total_twt_shows},${$total_hpr_shows},${num_of_hosts},${days_to_wait},${un_delivered},${num_future_hosts},${num_future_shows},${unprocessed_comments},${new_shows},${reserve_shows},${total_playtime}\n";
} }
else { else {

View File

@ -271,7 +271,7 @@ There are only <strong><?php echo "${days_to_wait}"; ?></strong> days to wait un
<ol> <ol>
<li>You must have your audio recording ready to upload <strong>before</strong> you pick a slot.</li> <li>You must have your audio recording ready to upload <strong>before</strong> you pick a slot.</li>
<li>New hosts, Interviews, and other time critical shows should use the first free slot.</li> <li>New hosts, Interviews, and other time critical shows should use the first free slot.</li>
<li>Always try and fill any free slots that are available in the upcoming two weeks.</li> <li>Always try and fill any free slots that are available in the <strong>upcoming two weeks</strong>.</li>
<li>When the queue is filling up then leave some slots free for new contributors.</li> <li>When the queue is filling up then leave some slots free for new contributors.</li>
<li>Post non urgent shows into the first empty week.</li> <li>Post non urgent shows into the first empty week.</li>
<li>If you are uploading a series of shows then post them one every two weeks.</li> <li>If you are uploading a series of shows then post them one every two weeks.</li>

View File

@ -343,7 +343,7 @@ if ( !file_exists( "$dir_structure/shownotes.txt" ) ) {
logextra( "shownotes.txt still exists" ); logextra( "shownotes.txt still exists" );
if ( !file_exists( "$dir_structure/shownotes.json" ) ) { if ( !file_exists( "$dir_structure/shownotes.json" ) ) {
naughty("a9564ebc3289b7a14551baf8ad5ec60a"); naughty("3eb02d6b9ea801d4c5909b4fac0ccd96");
} }
logextra( "shownotes.json still exists" ); logextra( "shownotes.json still exists" );

View File

@ -332,6 +332,6 @@ if ($pos !== false) {
$HPR_Names = "Hackers"; $HPR_Names = "Hackers";
} }
$allowed_extensions = array("flac", "opus", "ogg", "spx", "mp3", "jpg", "png", "json", "srt", "tsv", "txt", "vtt"); $allowed_extensions = array("wav", "flac", "opus", "ogg", "spx", "mp3", "jpg", "png", "json", "srt", "tsv", "txt", "vtt");
?> ?>

View File

@ -39,6 +39,7 @@ switch ($atomurl) {
$format = "mp3"; $format = "mp3";
$mimetype = "audio/mpeg"; $mimetype = "audio/mpeg";
$feed = "future"; $feed = "future";
$limit = 100;
break; break;
case "/hpr_ogg_rss.php": case "/hpr_ogg_rss.php":
$format = "ogg"; $format = "ogg";
@ -245,7 +246,6 @@ if ($result = mysqli_query($connection, $query)) {
$show_notes = "This show has been flagged as $episode_explicit by the host.\n"; $show_notes = "This show has been flagged as $episode_explicit by the host.\n";
$show_notes = $show_notes . htmlspecialchars(stripslashes(strip_tags($row["notes"]))) ; $show_notes = $show_notes . htmlspecialchars(stripslashes(strip_tags($row["notes"]))) ;
} }
$warning = utf8_encode ( $warning );
echo " <item>\n"; echo " <item>\n";
if ( $episode_explicit === "Clean" ) { if ( $episode_explicit === "Clean" ) {
echo " <itunes:explicit>no</itunes:explicit>\n"; echo " <itunes:explicit>no</itunes:explicit>\n";