Disallow minor comments when $EditAllowed is 3

Otherwise people can sneak some comments in
This commit is contained in:
Aleks-Daniel Jakimenko
2015-08-17 15:11:18 +03:00
parent a50c2da042
commit 5462b215be

View File

@@ -3183,7 +3183,8 @@ sub UserCanEdit {
return 0 if not $EditAllowed or -f $NoEditFile;
return 0 if $editing and UserIsBanned(); # this call is more expensive
return 0 if $EditAllowed >= 2 and (not $CommentsPattern or $id !~ /$CommentsPattern/o);
return 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
return 1 if $EditAllowed >= 3 and not GetParam('recent_edit', '') # disallow minor comments
and ($comment or (GetParam('aftertext', '') and not GetParam('text', '')));
return 0 if $EditAllowed >= 3;
return 1;
}