<p></p>
<blockquote>
<p>It would probably be more sensible to use something like <a href="https://github.com/perfectline/validates_url">https://github.com/perfectline/validates_url</a> rather than rolling our own terribly broken regex...</p>
</blockquote>
<p>I'm totally in favour of moving away from maintaining our own regexps! I didn't even realise that this one was broken; I was just trying to make the minimal necessary patch.</p>
<p>I'll close this PR and open a fresh one.</p>
<blockquote>
<p>is this actually fixing anything? and if so what?</p>
</blockquote>
<p>So my line of thinking is that we have a validator to make sure that it's only valid URLs in these attributes, but due to a flaw in the regexp (no <code>\z</code>), you can have inputs that aren't valid URLs. Therefore, we should fix this. Whether that's a security problem or just a user experience problem, I don't think is important.</p>
<p>The side benefit is that this makes one few thing to think about in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="445851912" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2229" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/2229/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/2229">#2229</a>!</p>
<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/2570#issuecomment-607094145">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLP7JVEHZ7HUAZCNZ7DRKLXSHANCNFSM4LTUQYXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLPK6JJAHDU3LAPRIRLRKLXSHA5CNFSM4LTUQYXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEQXYLAI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2570#issuecomment-607094145",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2570#issuecomment-607094145",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>