|
|
@@ -217,24 +217,20 @@ class Zend_Uri_Http extends Zend_Uri
|
|
|
|
|
|
// Additional decomposition to get username, password, host, and port
|
|
|
$combo = isset($matches[3]) === true ? $matches[3] : '';
|
|
|
- $pattern = '~^(([^:@]*)(:([^@]*))?@)?([^:]+)(:(.*))?$~';
|
|
|
+ $pattern = '~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~';
|
|
|
$status = @preg_match($pattern, $combo, $matches);
|
|
|
if ($status === false) {
|
|
|
require_once 'Zend/Uri/Exception.php';
|
|
|
throw new Zend_Uri_Exception('Internal error: authority decomposition failed');
|
|
|
}
|
|
|
-
|
|
|
- // Failed decomposition; no further processing needed
|
|
|
- if ($status === false) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
// Save remaining URI components
|
|
|
$this->_username = isset($matches[2]) === true ? $matches[2] : '';
|
|
|
$this->_password = isset($matches[4]) === true ? $matches[4] : '';
|
|
|
- $this->_host = isset($matches[5]) === true ? $matches[5] : '';
|
|
|
+ $this->_host = isset($matches[5]) === true
|
|
|
+ ? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal
|
|
|
+ : '';
|
|
|
$this->_port = isset($matches[7]) === true ? $matches[7] : '';
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|