Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
9c70e10a
Commit
9c70e10a
authored
Oct 21, 2015
by
Lukas Fleischer
Browse files
Check comment length in the backend
Signed-off-by:
Lukas Fleischer
<
lfleischer@archlinux.org
>
parent
16765d55
Changes
2
Show whitespace changes
Inline
Side-by-side
web/html/pkgbase.php
View file @
9c70e10a
...
...
@@ -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
;
}
}
elseif
(
current_action
(
"do_UnFlag"
))
{
list
(
$ret
,
$output
)
=
pkgbase_unflag
(
$ids
);
}
elseif
(
current_action
(
"do_Adopt"
))
{
...
...
web/lib/pkgbasefuncs.inc.php
View file @
9c70e10a
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment