<p>Follow up for <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="229007323" data-permission-text="Issue title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/1543" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/1543/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/1543">#1543</a></p>
<p>There's essentially no upper limit to notes comments, leaving the upload more or less unprotected to nonsense stuff like <a href="https://upload.apis.dev.openstreetmap.org/note/3" rel="nofollow">https://upload.apis.dev.openstreetmap.org/note/3</a></p>
<p>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.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/2042'>https://github.com/openstreetmap/openstreetmap-website/pull/2042</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Limit notes sizes to 2000 characters</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-0">app/models/note_comment.rb</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-1">app/views/browse/new_note.html.erb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-2">app/views/browse/note.html.erb</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2042.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2042.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2042.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2042.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2042">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLX8RESRxwEjtKHC2XJgPM86gJ6rUks5urdP1gaJpZM4YM6Tx">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLXSXLGjGHFOcvM845d2Q4DfkPKZpks5urdP1gaJpZM4YM6Tx.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Limit note comment size to 2000 characters (#2042)"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/2042"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2042",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2042",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Limit note comment size to 2000 characters (#2042)",
"sections": [
{
"text": "",
"activityTitle": "**mmd**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@mmd-osm",
"facts": [

]
},
{
"title": "Commit Summary",
"facts": [
{
"name": "d9a48d6",
"value": "Limit notes sizes to 2000 characters"
}
]
},
{
"title": "File Changes",
"facts": [
{
"name": "Modified",
"value": "[app/models/note_comment.rb](https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-0) (3 changes)"
},
{
"name": "Modified",
"value": "[app/views/browse/new_note.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-1) (2 changes)"
},
{
"name": "Modified",
"value": "[app/views/browse/note.html.erb](https://github.com/openstreetmap/openstreetmap-website/pull/2042/files#diff-2) (2 changes)"
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"issueId\": 2042,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"pullRequestId\": 2042\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/2042"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/2042.patch"
}
],
"@type": "OpenUri",
"name": "View patch"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/2042.diff"
}
],
"@type": "OpenUri",
"name": "View diff"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 406037745\n}"
}
],
"themeColor": "26292E"
}
]</script>