diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-08-24 20:44:06 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-08-24 20:44:06 -0400 |
commit | 9fd3a41576bd5365f9156b47490eecddfb2aa842 (patch) | |
tree | 1f1c1dd82d9d6613ee83748a2aaba93db506afeb | |
parent | ab2f6fb8601fa0463c0fedc872a830b9d5283ba4 (diff) |
ftps protocol should be handled the same way as ftp
Canon urls that have a protocol followed by a host (and no path) automatcally get a trailing slash by the canon function - make the unit test match that
-rw-r--r-- | classes/File_redirection.php | 2 | ||||
-rw-r--r-- | tests/URLDetectionTest.php | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/classes/File_redirection.php b/classes/File_redirection.php index d6fa0bcb6..363e3b947 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -182,7 +182,7 @@ class File_redirection extends Memcached_DataObject } } - if (('ftp' == $p['scheme']) || ('http' == $p['scheme']) || ('https' == $p['scheme'])) { + if (('ftp' == $p['scheme']) || ('ftps' == $p['scheme']) || ('http' == $p['scheme']) || ('https' == $p['scheme'])) { if (empty($p['host'])) return false; if (empty($p['path'])) { $out_url .= '/'; diff --git a/tests/URLDetectionTest.php b/tests/URLDetectionTest.php index ed29dc88e..e69f1a2c3 100644 --- a/tests/URLDetectionTest.php +++ b/tests/URLDetectionTest.php @@ -28,27 +28,27 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase array('example', 'example'), array('http://example', - 'http://example'), + '<a href="http://example/" rel="external">http://example</a>'), array('http://example/', - 'http://example/'), + '<a href="http://example/" rel="external">http://example/</a>'), array('http://example/path', - 'http://example/path'), + '<a href="http://example/path" rel="external">http://example/path</a>'), array('http://example.com', - '<a href="http://example.com" rel="external">http://example.com</a>'), + '<a href="http://example.com/" rel="external">http://example.com</a>'), array('https://example.com', - '<a href="https://example.com" rel="external">https://example.com</a>'), + '<a href="https://example.com/" rel="external">https://example.com</a>'), array('ftp://example.com', - '<a href="ftp://example.com" rel="external">ftp://example.com</a>'), + '<a href="ftp://example.com/" rel="external">ftp://example.com</a>'), array('ftps://example.com', - '<a href="ftps://example.com" rel="external">ftps://example.com</a>'), + '<a href="ftps://example.com/" rel="external">ftps://example.com</a>'), array('http://user@example.com', - '<a href="http://user@example.com" rel="external">http://user@example.com</a>'), + '<a href="http://user@example.com/" rel="external">http://user@example.com</a>'), array('http://user:pass@example.com', - '<a href="http://user:pass@example.com" rel="external">http://user:pass@example.com</a>'), + '<a href="http://user:pass@example.com/" rel="external">http://user:pass@example.com</a>'), array('http://example.com:8080', - '<a href="http://example.com:8080" rel="external">http://example.com:8080</a>'), + '<a href="http://example.com:8080/" rel="external">http://example.com:8080</a>'), array('http://www.example.com', - '<a href="http://www.example.com" rel="external">http://www.example.com</a>'), + '<a href="http://www.example.com/" rel="external">http://www.example.com</a>'), array('http://example.com/', '<a href="http://example.com/" rel="external">http://example.com/</a>'), array('http://example.com/path', @@ -58,7 +58,7 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase array('http://example.com/path.html#fragment', '<a href="http://example.com/path.html#fragment" rel="external">http://example.com/path.html#fragment</a>'), array('http://example.com/path.php?foo=bar&bar=foo', - '<a href="http://example.com/path.php?foo=bar&bar=foo" rel="external">http://example.com/path.php?foo=bar&bar=foo</a>'), + '<a href="http://example.com/path.php?foo=bar&bar=foo" rel="external">http://example.com/path.php?foo=bar&bar=foo</a>'), array('http://müllärör.de', '<a href="http://müllärör.de" rel="external">http://müllärör.de</a>'), array('http://ﺱﺲﺷ.com', |