From 1612659b44e5e80e521dd3e48a92f65d45718b91 Mon Sep 17 00:00:00 2001 From: Ken Fallon Date: Sun, 3 May 2026 16:37:33 +0200 Subject: [PATCH] 2026-05-03_14-37-33Z_Sunday #104 shownotes must be provided --- hub/upload.php | 10 ++++++++++ hub/upload_confirm.php | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hub/upload.php b/hub/upload.php index e438e07..1ddf673 100644 --- a/hub/upload.php +++ b/hub/upload.php @@ -371,6 +371,16 @@ include 'header.php'; } const form = document.querySelector('form'); + + form.addEventListener('submit', function (event) { + const text = quill.getText().trim(); + + if (text.length < 30) { + event.preventDefault(); + alert('You must provide shownotes'); + } + }); + form.addEventListener('formdata', event => { const rawHTML = quill.getSemanticHTML(); const prettyHTML = prettyPrintHTML(rawHTML); diff --git a/hub/upload_confirm.php b/hub/upload_confirm.php index bb83a54..4740521 100755 --- a/hub/upload_confirm.php +++ b/hub/upload_confirm.php @@ -51,7 +51,7 @@ if (count($_POST) !== 15) { if (count($_POST) !== 17) { # 19 is for mosaic # if this reports 0 is could be that the max upload is not set correctly in php.ini. - naughty("7a994999b40e3dc2e3eecfdc36a78d23 Incorrect number of POST entries".count($_POST) ); + naughty("7a994999b40e3dc2e3eecfdc36a78d23 Incorrect number of POST entries ".count($_POST) ); } } logextra( "Correct number of POST entries" ); @@ -160,6 +160,11 @@ logextra( "license is a valid value" ); // } // logextra( "Notes are less than max" ); +if ( empty($_POST["notes"]) or strlen($_POST["notes"]) < 30 ) { + naughty("5860799406a323209b902d5104fe7bae The shownotes are too short"); +} +logextra( "Notes are not too short" ); + $notes_length = strlen($_POST["notes"]); logextra( "Notes are $notes_length long." );