Fix Bug #12: Bindestrich im Titel wird jetzt erlaubt
- Validierungsregel in AiResponseValidator erweitert um Bindestrich (-) - Test angepasst: validate_titleWithHyphen jetzt als Valid-Case akzeptiert - Dokumentation (fachliche Anforderungen, CLAUDE.md) aktualisiert - mvn clean verify erfolgreich durchgelaufen
This commit is contained in:
+3
-3
@@ -102,7 +102,7 @@ public final class AiResponseValidator {
|
||||
|
||||
if (!isAllowedTitleCharacters(title)) {
|
||||
return AiValidationResult.invalid(
|
||||
"Title contains disallowed characters (only letters, digits, and spaces are permitted): '"
|
||||
"Title contains disallowed characters (only letters, digits, spaces, and hyphens are permitted): '"
|
||||
+ title + "'",
|
||||
AiErrorClassification.FUNCTIONAL);
|
||||
}
|
||||
@@ -142,14 +142,14 @@ public final class AiResponseValidator {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns {@code true} if every character in the title is a letter, digit, or space.
|
||||
* Returns {@code true} if every character in the title is a letter, digit, space, or hyphen.
|
||||
* <p>
|
||||
* Permits Unicode letters including German Umlauts (ä, ö, ü, Ä, Ö, Ü) and ß.
|
||||
*/
|
||||
private static boolean isAllowedTitleCharacters(String title) {
|
||||
for (int i = 0; i < title.length(); i++) {
|
||||
char c = title.charAt(i);
|
||||
if (!Character.isLetter(c) && !Character.isDigit(c) && c != ' ') {
|
||||
if (!Character.isLetter(c) && !Character.isDigit(c) && c != ' ' && c != '-') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user