<p dir="auto">This adds validation to page/before/after/max_id parameters to various paginated requests so that we get a clean error instead of exception from the database when some nonsense value is fed into a query.</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/4680'>https://github.com/openstreetmap/openstreetmap-website/pull/4680</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/commits/b4d0ce49133cbd87a53d03f2f331a4182e1c4ab1" class="commit-link">b4d0ce4</a>  Add framework for parameter validation using rails_param gem</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/commits/7f432b108afacbacaef22a587756a88c6c36d58f" class="commit-link">7f432b1</a>  Add validation for page number passed to notes#index</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/commits/fe30aaed7cac13b05affe90e35d1f92cca906b2b" class="commit-link">fe30aae</a>  Add validation for before/after parameters to pagination concern</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/commits/8b14f72fab45a9ee9cd681f85c8ec3ffddb34118" class="commit-link">8b14f72</a>  Add validation for maximum ID passed to changesets#index</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files">17 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-d09ea66f8227784ff4393d88a19836f321c915ae10031d16c93d67e6283ab55f">Gemfile</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731f">Gemfile.lock</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-766c34fd6533171eaf54300c153f89d6002c35c02cfc9c5b219251f85180ad07">app/controllers/application_controller.rb</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-cf3fe9dc357f802fd9155582ffc8c6f71185065267991a2135323ad2d044b4f3">app/controllers/changesets_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-4f5bc884ee2d0b00f5f34aadef6573b1886dec57eb4340b59f464db9b2853721">app/controllers/concerns/pagination_methods.rb</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-cbee0f22c5698851d46ad32e4b65e6a7d9217ca5289b9f35415d2b4f45316f66">app/controllers/errors_controller.rb</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-c254740097a8c0601832077488db77e572b2c2b926f77508fadc6081b0052804">app/controllers/notes_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-d9f56a351f35cefad13c18cb9cc7499efbb244bc003804ec7a2c5c9509487587">app/views/errors/bad_request.html.erb</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-6cdb8b8fa44e422834c4815943a8e4933d6d09e4687f338d007daeff1a90daa9">test/controllers/changesets_controller_test.rb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-10a5c4533814c8b1222f0ef0833c82edd68584d85757fc431557b39813777c19">test/controllers/diary_entries_controller_test.rb</a>
    (23)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-abde62546ee6ee65167ea920090135e93b32932f3efcd5bed4eb894a400de402">test/controllers/errors_controller_test.rb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-b41a560e061b578bbf13158bf175036a9489241ab69f59137c44d57df9682fa7">test/controllers/notes_controller_test.rb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-db7c9d7ea4afdcafd812aac88f5a378c22117fbce829dc93d905152f2c09f471">test/controllers/traces_controller_test.rb</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-9ca0f3412d30fa75d21d710e7d0f07b08a8eeb934543b9db405b8d63619548c1">test/controllers/user_blocks_controller_test.rb</a>
    (40)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680/files#diff-2719d3c650da3c587f727ca3c105e6bc93a7113f85717bb15983543cf4f85ae5">test/controllers/users_controller_test.rb</a>
    (12)
  </li>
</ul>

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

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4680">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNGQ34IASN27FC5WI3Y4ZGL3AVCNFSM6AAAAABGB4W4YSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTOMRUGU3DMNY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLP7K54GM2ZS3YO664DY4ZGL3A5CNFSM6AAAAABGB4W4YSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIKWNI4M.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4680</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4680",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4680",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>