--- a/includes/http.php Fri Aug 21 11:47:26 2009 -0400
+++ b/includes/http.php Fri Aug 21 11:54:26 2009 -0400
@@ -197,8 +197,9 @@
function Request_HTTP($host, $uri, $method = 'GET', $port = 80)
{
- if ( !preg_match('/^(([a-z0-9-]+\.)*?)([a-z0-9-]+)$/', $host) )
+ if ( !preg_match('/^(?:(([a-z0-9-]+\.)*?)([a-z0-9-]+)|\[[a-f0-9:]+\])$/', $host) )
throw new Exception(__CLASS__ . ': Invalid hostname');
+ // Yes - this really does support IPv6 URLs!
$this->host = $host;
$this->uri = $uri;
if ( is_int($port) && $port >= 1 && $port <= 65535 )