mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
fix: validate length of each tag
This commit is contained in:
parent
49c5643bc7
commit
95885d6f5a
11 changed files with 21 additions and 6 deletions
|
@ -89,6 +89,8 @@ class TagsInput {
|
||||||
this.inputNode.value = ''
|
this.inputNode.value = ''
|
||||||
this.updateHiddenInputValue();
|
this.updateHiddenInputValue();
|
||||||
|
|
||||||
|
evt.preventDefault();
|
||||||
|
} else if (evt.key !== 'Backspace' && tagValue.length > 255) { // This could be improved to check if it would actually result in a new char being typed...
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,6 +397,8 @@ class TagsInput {
|
||||||
this.inputNode.value = '';
|
this.inputNode.value = '';
|
||||||
this.updateHiddenInputValue();
|
this.updateHiddenInputValue();
|
||||||
|
|
||||||
|
evt.preventDefault();
|
||||||
|
} else if (evt.key !== 'Backspace' && tagValue.length > 255) { // This could be improved to check if it would actually result in a new char being typed...
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
public/assets/bundle/archive.min.js
vendored
2
public/assets/bundle/archive.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -128,6 +128,8 @@ class TagsInput {
|
||||||
this.inputNode.value = '';
|
this.inputNode.value = '';
|
||||||
this.updateHiddenInputValue();
|
this.updateHiddenInputValue();
|
||||||
|
|
||||||
|
evt.preventDefault();
|
||||||
|
} else if (evt.key !== 'Backspace' && tagValue.length > 255) { // This could be improved to check if it would actually result in a new char being typed...
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
public/assets/bundle/generic.min.js
vendored
2
public/assets/bundle/generic.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -397,6 +397,8 @@ class TagsInput {
|
||||||
this.inputNode.value = '';
|
this.inputNode.value = '';
|
||||||
this.updateHiddenInputValue();
|
this.updateHiddenInputValue();
|
||||||
|
|
||||||
|
evt.preventDefault();
|
||||||
|
} else if (evt.key !== 'Backspace' && tagValue.length > 255) { // This could be improved to check if it would actually result in a new char being typed...
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
public/assets/bundle/user_profile.min.js
vendored
2
public/assets/bundle/user_profile.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -96,6 +96,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
goto OutPut;
|
goto OutPut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
if (strlen($tag) > 255) {
|
||||||
|
$error = 'A single tag cannot be longer than 255 characters.';
|
||||||
|
goto OutPut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$editing = isset($_POST['edit']);
|
$editing = isset($_POST['edit']);
|
||||||
|
|
||||||
$paste_title = trim($_POST['title']);
|
$paste_title = trim($_POST['title']);
|
||||||
|
|
Loading…
Add table
Reference in a new issue