2026-05-03_14-37-33Z_Sunday #104 shownotes must be provided

This commit is contained in:
2026-05-03 16:37:33 +02:00
parent e59d26d0ea
commit 1612659b44
2 changed files with 16 additions and 1 deletions

View File

@@ -371,6 +371,16 @@ include 'header.php';
} }
const form = document.querySelector('form'); 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 => { form.addEventListener('formdata', event => {
const rawHTML = quill.getSemanticHTML(); const rawHTML = quill.getSemanticHTML();
const prettyHTML = prettyPrintHTML(rawHTML); const prettyHTML = prettyPrintHTML(rawHTML);

View File

@@ -51,7 +51,7 @@ if (count($_POST) !== 15) {
if (count($_POST) !== 17) { if (count($_POST) !== 17) {
# 19 is for mosaic # 19 is for mosaic
# if this reports 0 is could be that the max upload is not set correctly in php.ini. # 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" ); logextra( "Correct number of POST entries" );
@@ -160,6 +160,11 @@ logextra( "license is a valid value" );
// } // }
// logextra( "Notes are less than max" ); // 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"]); $notes_length = strlen($_POST["notes"]);
logextra( "Notes are $notes_length long." ); logextra( "Notes are $notes_length long." );