mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Check comment length in the backend
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
16765d5532
commit
9c70e10aeb
2 changed files with 5 additions and 6 deletions
|
@ -49,12 +49,7 @@ $output = "";
|
|||
$fragment = "";
|
||||
if (check_token()) {
|
||||
if (current_action("do_Flag")) {
|
||||
if (strlen($_POST['comments']) >= 3) {
|
||||
list($ret, $output) = pkgbase_flag($ids, $_POST['comments']);
|
||||
} else {
|
||||
$output = __("The selected packages have not been flagged, please enter a comment.");
|
||||
$ret = false;
|
||||
}
|
||||
list($ret, $output) = pkgbase_flag($ids, $_POST['comments']);
|
||||
} elseif (current_action("do_UnFlag")) {
|
||||
list($ret, $output) = pkgbase_unflag($ids);
|
||||
} elseif (current_action("do_Adopt")) {
|
||||
|
|
|
@ -330,6 +330,10 @@ function pkgbase_flag($base_ids, $comment) {
|
|||
return array(false, __("You did not select any packages to flag."));
|
||||
}
|
||||
|
||||
if (strlen($comment) < 3) {
|
||||
return array(false, __("The selected packages have not been flagged, please enter a comment."));
|
||||
}
|
||||
|
||||
$uid = uid_from_sid($_COOKIE['AURSID']);
|
||||
$dbh = DB::connect();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue