<p>Replacement PR for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="580940830" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2557" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/2557/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/2557">#2557</a></p>
<p>The previous regexps only checked that the string started with a url, but would accept further input.</p>
<p>The validates_url gem works well, but only with the inclusion of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="508722487" data-permission-text="Title is private" data-url="https://github.com/perfectline/validates_url/issues/85" data-hovercard-type="pull_request" data-hovercard-url="/perfectline/validates_url/pull/85/hovercard" href="https://github.com/perfectline/validates_url/pull/85">perfectline/validates_url#85</a> which is not yet in a release. I'm not sure if it's better to wait for a release, or go with the git link for the gem.</p>
<p>There's also the fact that validates_url doesn't appear to support arbitrary schemes (e.g. <code>myapp://</code>) so I've used the underlying regexp for that.</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/2578'>https://github.com/openstreetmap/openstreetmap-website/pull/2578</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Ensure that urls are only valid if the entire string is a url</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2578/files#diff-8b7db4d5cc4b8f6dc8feb7030baa2478">Gemfile</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2578/files#diff-e79a60dc6b85309ae70a6ea8261eaf95">Gemfile.lock</a>
(9)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2578/files#diff-3ef1e2237f323b7d4dc1ce1fc11a5c20">app/models/client_application.rb</a>
(7)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2578/files#diff-b427d1b388ac6b7a6394ebdc127e1a0b">test/models/client_application_test.rb</a>
(6)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2578.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2578.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2578.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2578.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/2578">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIZO23MQIII3QKPNA3RKNNULANCNFSM4LZCQJJA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLLJ4UN5T5DQYNT5M2LRKNNULA5CNFSM4LZCQJJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4I2JL4NA.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/2578",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2578",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>