<p>I was playing with the notes search API and tried to search for a string containing <code>(</code> which caused it treat the search term as a regex. The API docs forget to mention anywhere that the search supports regex so that was a surprise. But that is another matter.</p>
<p>The issue is that if an invalid regex is supplied to the search API, it returns a SQL error from postgres back to the client in a HTTP 500 response that includes the full SQL query being executed. The error should be caught and HTTP 400 status sent back to the client.</p>
<p>Reproducible with the following URL:<br><br><a href="http://api.openstreetmap.org/api/0.6/notes/search?q=bounds+%28">http://api.openstreetmap.org/api/0.6/notes/search?q=bounds+%28</a></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/issues/673'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNDc4MTgwMSwiZGF0YSI6eyJpZCI6MjMxODgzMzV9fQ==--a80d6073dee514189a4a47fcd36e21246ea3a992.gif' height='1' width='1'></p>