Skip to content

Commit

Permalink
avoid MySQL data truncation (file name too long). close #2222
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Dec 5, 2023
1 parent 9a59d7d commit b3135a0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ public boolean execute() throws Exception {
if (newName.trim().length() == 0) {
newName = "beA-Nachricht";
}
if (newName.length() > 230) {
newName = newName.substring(0, 229);
if (newName.length() > 228) {
newName = newName.substring(0, 227);
}

if (!newName.toLowerCase().endsWith(".bea")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,8 @@ public boolean execute() throws Exception {
if (newName.trim().length() == 0) {
newName = "beA-Nachricht";
}
if (newName.length() > 230) {
newName = newName.substring(0, 229);
if (newName.length() > 228) {
newName = newName.substring(0, 227);
}

if (!newName.toLowerCase().endsWith(".bea")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,8 @@ public PasswordAuthentication getPasswordAuthentication() {
if (attachmentNames.trim().length() > 0) {
newName = attachmentNames.trim() + " per E-Mail";
}
if (newName.length() > 230) {
newName = newName.substring(0, 229);
if (newName.length() > 228) {
newName = newName.substring(0, 227);
}
newName = newName + ".eml";
newName = FileUtils.sanitizeFileName(newName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,8 @@ public void display() {

String newName = "E-POST-Brief_" + l.getFileName();

if (newName.length() > 230) {
newName = newName.substring(0, 229);
if (newName.length() > 228) {
newName = newName.substring(0, 227);
}
newName = FileUtils.sanitizeFileName(newName);
java.util.Date sentPrefix = new Date();
Expand Down

0 comments on commit b3135a0

Please sign in to comment.