mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -04:00
Fixed parsing bug
This issue was one where custom headers that consisted of digits and were less than three characters long could be mistaken for standard headers when being edited again.
This commit is contained in:
parent
da7cd1668a
commit
b615d1350d
1 changed files with 5 additions and 5 deletions
|
@ -1471,15 +1471,15 @@ class InputWaiter {
|
|||
renameContents = renameContents.substring(0, renameContentsColon);
|
||||
}
|
||||
|
||||
// Remove the single quotation marks from the renaming section
|
||||
renameContents = renameContents.replaceAll("'", "");
|
||||
|
||||
if (renameContents.length < 3 && !isNaN(parseInt(renameContents, 10))) {
|
||||
// Restore the full header if it hasn't been renamed
|
||||
if (renameContents.indexOf("'") === -1 && !isNaN(parseInt(renameContents, 10))) {
|
||||
renameContents = `Tab ${renameContents.toString()}`;
|
||||
}
|
||||
|
||||
// Remove the single quotation marks from the renaming section
|
||||
renameContents = renameContents.replaceAll("'", "");
|
||||
|
||||
editingElement.setAttribute("value", renameContents);
|
||||
editingElement.setAttribute("minlength", "3"); // Delimiting between shortened tab headers and custom ones.
|
||||
targetElement.textContent = "";
|
||||
editingElement.style.height = "1.5em";
|
||||
editingElement.style.textAlign = "center";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue