[openstreetmap/openstreetmap-website] Limit note comment size to 2000 characters (#2042)

mmd notifications at github.com
Sat Nov 3 17:35:49 UTC 2018


Follow up for #1543 

There's essentially no upper limit to notes comments, leaving the upload more or less unprotected to nonsense stuff like https://upload.apis.dev.openstreetmap.org/note/3

PR attempts to set the limit to 2000 characters both in the model, as well in the textarea (to avoid dealing with an unhappy backend). I'm not sure anything else needs to be done to deal with existing (too long) comments.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/2042

-- Commit Summary --

  * Limit notes sizes to 2000 characters

-- File Changes --

    M app/models/note_comment.rb (3)
    M app/views/browse/new_note.html.erb (2)
    M app/views/browse/note.html.erb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/2042.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2042.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2042
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20181103/ea0a1694/attachment-0001.html>


More information about the rails-dev mailing list