Skip to content

Commit

Permalink
URL is not a scheme (#17631)
Browse files Browse the repository at this point in the history
* url is not a valid scheme

* url is not a scheme

* codestyle

* codestyle

* space

* make drone happy

* remove one tab
  • Loading branch information
brianteeman authored and Michael Babker committed Aug 21, 2017
1 parent f0b4080 commit 9bef947
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_menus/controllers/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ public function save($key = null, $urlVar = null)
{
$segments = explode(':', $data['link']);
$protocol = strtolower($segments[0]);
$scheme = array('http', 'https', 'ftp', 'ftps', 'gopher', 'mailto', 'news', 'prospero', 'telnet', 'rlogin', 'tn3270', 'wais', 'url',
'mid', 'cid', 'nntp', 'tel', 'urn', 'ldap', 'file', 'fax', 'modem', 'git', 'sms');
$scheme = array('http', 'https', 'ftp', 'ftps', 'gopher', 'mailto', 'news', 'prospero', 'telnet', 'rlogin', 'tn3270', 'wais','mid', 'cid', 'nntp',
'tel', 'urn', 'ldap', 'file', 'fax', 'modem', 'git', 'sms');

if (!in_array($protocol, $scheme))
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Rule/UrlRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test(\SimpleXMLElement $element, $value, $group = null, Registry
// Use the full list or optionally specify a list of permitted schemes.
if ($element['schemes'] == '')
{
$scheme = array('http', 'https', 'ftp', 'ftps', 'gopher', 'mailto', 'news', 'prospero', 'telnet', 'rlogin', 'sftp', 'tn3270', 'wais', 'url',
$scheme = array('http', 'https', 'ftp', 'ftps', 'gopher', 'mailto', 'news', 'prospero', 'telnet', 'rlogin', 'sftp', 'tn3270', 'wais',
'mid', 'cid', 'nntp', 'tel', 'urn', 'ldap', 'file', 'fax', 'modem', 'git');
}
else
Expand Down
1 change: 0 additions & 1 deletion plugins/fields/url/params/url.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<option value="https">HTTPS</option>
<option value="ftp">FTP</option>
<option value="ftps">FTPS</option>
<option value="url">URL</option>
<option value="file">FILE</option>
<option value="mailto">MAILTO</option>
</field>
Expand Down
1 change: 0 additions & 1 deletion plugins/fields/url/url.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<option value="https">HTTPS</option>
<option value="ftp">FTP</option>
<option value="ftps">FTPS</option>
<option value="url">URL</option>
<option value="file">FILE</option>
<option value="mailto">MAILTO</option>
</field>
Expand Down

0 comments on commit 9bef947

Please sign in to comment.