From c9ffe04d6c5474587e4928fa0d18d5d48df7531d Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 28 Sep 2026 22:23:58 +0200 Subject: [PATCH] Validate that tag descriptions are more than a copy of the tag name. --- src/NodaValidationHelper.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NodaValidationHelper.php b/src/NodaValidationHelper.php index c9a345b..8a090d9 100644 --- a/src/NodaValidationHelper.php +++ b/src/NodaValidationHelper.php @@ -39,6 +39,11 @@ final class NodaValidationHelper { throw new MDgenericInvalidInputsException("Tag description is too short"); } + // Ensure the description is not just a copy-pasted version of the tag name. + if (empty(trim(str_replace($description, $name, ''), "#,.;:\t " . PHP_EOL))) { + throw new MDgenericInvalidInputsException("The tag description cannot be simply a fancy copy of the tag's name. Please define it."); + } + // Validate tag description based on character composition. // Ensure more than 3 distinct characters are used.